LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run DLL in C++ from Labview

 You call delete[] on arrays that are parameters so your DLL _does_ modify parameters!

See snip below:

 

char PSIM[250];

 

_declspec(dllexport) int32_t dllbeta1(..., char cheminpsim[], ...)

{

  strcpy(PSIM,cheminpsim);
  delete [] cheminpsim;

  ...

}

 

Since LabVIEW doesn't allocate "char cheminpsim[]" via plain operator new[]

you _mustn't_ call delete[] on it!!!

 

And if you don't use your variables in other functions make the variables local.

Use global variables only if you have to.

 

It isn't a problem with LabVIEW here, any caller in C++ which doesn't use new[]

and calls your function will also fail in the very same manner.

 

Message Edited by candidus on 07-02-2009 08:59 AM
0 Kudos
Message 11 of 12
(949 Views)

nobody for my F**k C++ code ?.... lol

It's maybe in my way to create DLL ...

thanks

0 Kudos
Message 12 of 12
(927 Views)