10-23-2007 11:09 AM
10-23-2007 11:15 AM
10-24-2007 03:17 AM - edited 10-24-2007 03:17 AM
@OnlyOne wrote:
Hello,
i have a DLL where the documentation says:
"The DLL library is a standard windows function library which can be easly used with most common application development tools such as Visal Basic, Visual C++ etc"
I try to call a function like:
int result = funcName(int Parm1_in, long *Parm2_out, long *Parm3_out)
which is attached as an empty example.
But when i run it then LV crashes completely.
Do i pass the Pointer things correct?
What is the difference between "int" and long?
Thx
int is a signed integer that depends on the used CPU architecture. 16 bit for 16 bit Windows (Win3.1), 32 bit for modern x86 based OSes. long is always a 32 bit integer independant of the underlaying CPU architecture.
Your first parameter should be passed as a int32 by value and the other two as int32 as a pointer. This assumes that they are just simple skalars. If they are arrays (and there is usually no way to see that from the function prototype since C treats arrays just as pointers too), then that is an entirely dfferent story.
The last thing that can neck you is the calling convention. cdecl and stdcall are absolutely incompatible so if you get that wrong you crash guaranteed the first time you execute the VI.
Rolf Kalbermatter
Message Edited by rolfk on 10-24-2007 10:19 AM