thanks for a quick answer, however, wouldnt it be a piece of cake for velleman to include
another .lib that could be used for fixed linking with a .dll for c (c++, are these the same ? no)
ok, I know that the multiplicity of variants gets bogging to have update and check, but …
I will try out the runtime linking, while that seem much more cumbersome than letting
the linker work…
It does not have to do with the programming language. Both Borland and Microsoft compilers generate a different format for their .lib files. Borland generates lib files in OMF format, Microsoft generates them in COFF format. Both are not interchangeable.
So, if the DLL was written in Borland Delphi (now Embarcadero Delphi), the corresponding .lib file will be in OMF format and will not be useable in Microsoft Visual Studio. Same thing goes the other way around.
Thus whether the .lib file can be used has absolutely nothing to do with a programming language, but with the programming environment.
As a sidenote, a .lib file is simply a definition of where the linker can find the functions inside the DLL, sort of like a list (very simplistically put). And if the linker can’t interpret that list (doesn’t know the format), the software won’t link.
with using runtime linkage as proposed, the program links ok, i.e. the linker seem satisfied,
however it wanted 2 parameters declared when accessing the procedure, where
the procedure only had one defined for its parameter passing
in the exampel you referred to these two parameters were also differntly defined
dwParam1 and uParam2 (DWORD and UINT resp).
so what are these; the second one being the passing of the routine parameter ?
while the first is the return value from the routine/function in case it
is defined to give a return value ?
<<
anyway running the produced exe produces a return value of -1 for calling the opendev
(indicating success ?) ( the runtime connecting seem to be successfull)
while a return of 0 for calling the setDigitalChannel (indicating fail, connecting also seem
successfull)
works just fine, and is straight forward C code, however the boolean
definition of func5 type definition was too much for the complier
why I haven’t figured out. removing it (and including the K8055.cpp inline
instead of include which I found unecessary) everything went right through