use freebasic dll with msaccess

New to FreeBASIC? Post your questions here.
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: use freebasic dll with msaccess

Post by jj2007 »

michaelleewebb wrote:jj2007, that worked
Good ;-)

The culprit in this case is MS Access. Instead of wrongly shouting "dll not found", it should use the built-in Windows error message, which returns in my case (Italian OS) "somepath\Whatever.dll non è un'applicazione di Win32 valida". Which is correct if the Dll is a 64-bit DLL.
deltarho[1859]
Posts: 4292
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: use freebasic dll with msaccess

Post by deltarho[1859] »

That was a good catch, Jochen. I had forgotten the method you used: Compile a list of possible solutions and work down from the most likely except for newbies where we should work up from the least likely. <Ha, ha>.

Just kidding, michaelleewebb. <wink>. Anyway, I can now see a plague of FB dlls for MS Access coming over the horizon.
michaelleewebb wrote:i see pointers (shudder).
There is a nice little tutorial on pointers at Introduction to Pointers.
dodicat
Posts: 7976
Joined: Jan 10, 2006 20:30
Location: Scotland

Re: use freebasic dll with msaccess

Post by dodicat »

Glad you got sorted out michaelleewebb.
I feel I should buy Microsoft office just to keep up with you all.
. . .
But the feeling has faded already.
michaelleewebb
Posts: 23
Joined: Jul 09, 2019 21:18

Re: use freebasic dll with msaccess

Post by michaelleewebb »

" I can now see a plague of FB dlls for MS Access coming over the horizon"
tcp without mscomm, modbus, mqtt,email sent from within msaccess. would be a good start.
jj2007
Posts: 2326
Joined: Oct 23, 2016 15:28
Location: Roma, Italia
Contact:

Re: use freebasic dll with msaccess

Post by jj2007 »

dodicat wrote:I feel I should buy Microsoft office just to keep up with you all.
. . .
But the feeling has faded already.
<smile>My old Office 2003 copy still works perfectly. Poor Micros**t, nobody wants to buy their new toys ;-)
michaelleewebb
Posts: 23
Joined: Jul 09, 2019 21:18

Re: use freebasic dll with msaccess

Post by michaelleewebb »

"My old Office 2003 copy still works perfectly. Poor Micros**t, nobody wants to buy their new toys" it would help if they would add new useful features to msaccess.
change line from:
Function SayHello(text As string ptr) As integer EXPORT
to:
Function SayHello(byval text As ZString ptr) As integer EXPORT
as per mrswiss instructions , now works without giving a warning message during compile.

i'm am ready, i begin with this usb to rs485 converter:
https://www.ebay.com/itm/CH340-USB-to-R ... 2749.l2649

i will connect it to a EPever MPPT Solar Charge Controller, uses modbus protocol.

i feel i can do this because you guys taught me, then you armed me with pointers :) what ever happens it will be all your fault.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: use freebasic dll with msaccess

Post by MrSwiss »

michaelleewebb wrote:Function SayHello(byval text As ZString ptr) As integer EXPORT
as per mrswiss instructions , now works without giving a warning message during compile.
Sorry, to correct again (but important to understand).
use either:
Function SayHello(Byval text As ZString Ptr) As Short EXPORT (if you are using "Integer" in Access)
or:
Function SayHello(Byval text As ZString Ptr) As Long EXPORT (if you are using "Long" in Access)
This is the correct translation of the data-types, as well as "portable code".
(the very same code works, independent of the compiler used: 32/64 bit's)
michaelleewebb
Posts: 23
Joined: Jul 09, 2019 21:18

Re: use freebasic dll with msaccess

Post by michaelleewebb »

yes i was taught that before but forgot to apply it. thank you mrswiss.
Post Reply