Hello
Here's my problem. DLL looked always magic to me, so I tried to work
with them to see how it works. I wrote a DLL in Labwindow/CVI 6.0 and
my first fonction  had the following prototype

extern int  __cdecl MyDLL_Init (int In1,char *Out2);

I did'nt exactly know why using a C type declaration or a standard one
but the I followed a typical example found in the Developer zone.
Actually my function had one integer input (In1) and two output: a
status Integer and a C string parameter. I called the function in
Labview 6i following the example given and I was surprised that
everything worked the first time. I wanted to add another output
string to my function, so I changed the prototype

extern int  __cdecl MyDLL_Init (int In1,char *Out2,char *Out3);

I changed the configuration in Labview Call Library Function and then
Labview crashed all the time. I tried to call the DLL in a CVI program
and everything went well. I came back to Labview and it crashed again.
I came back to the first prototype and it worked well. I thought it
might be the fact that Labview does not use C type string but it
worked fine with only one output string, so it does do the conversion
if the String Format is correctly chosen in the configuration. Finally
I just changed the convention from cdecl to stdcall and everything
worked well. As a mechanical engineer, I am more a self-taught
programmer and most of the time I change everything till it works
without understanding very well but I wonder why this happens like
this.
Thank you very much
Louis

Reply via email to