07-02-2009 02:58 AM
Hi the world !
Ive got a pb in labview when I call my DLL or in VB6 when I build my DLL.
Join my project... what do you think about my pb ?
thanks for help !
Ben.
07-02-2009 05:06 AM
capsim wrote:
Join my project...
How much are you ready to pay me by hour, if I join your project... ?!
07-02-2009 05:32 AM
parthabe a écrit:
capsim wrote:
Join my project...
How much are you ready to pay me by hour, if I join your project... ?!
07-02-2009 06:42 AM
Your C++ code looks a little bit strange to me:
I hope that you allocated the arrays you give to dllbeta1() via C++ operator new[].
I f you didn't, anything will fail. The error message you posted looks like that's the problem.
07-02-2009 07:30 AM
candidus a écrit:Your C++ code looks a little bit strange to me:
I hope that you allocated the arrays you give to dllbeta1() via C++ operator new[].
I f you didn't, anything will fail. The error message you posted looks like that's the problem.
Yes my C++ code is Strange...like me in C++ !
but I've been adding :
char * var = new char[];
...
delete [] var;
but... it's the same pb... 😞
help// plzzz ...
07-02-2009 07:34 AM
candidus a écrit:Your C++ code looks a little bit strange to me:
I hope that you allocated the arrays you give to dllbeta1() via C++ operator new[].
I f you didn't, anything will fail. The error message you posted looks like that's the problem.
Gift ! 😉
07-02-2009 07:35 AM
I'm confused... Seems that you're calling a DLL written in C++ from C++,
else you couldn't use new[] from the caller's side... How is your problem related to LabVIEW???
07-02-2009 07:45 AM
candidus a écrit:I'm confused... Seems that you're calling a DLL written in C++ from C++,
else you couldn't use new[] from the caller's side... How is your problem related to LabVIEW???
2d gift from labview ! 😉
07-02-2009 07:47 AM
OK, I got your gift 🙂
It's pretty useless to use new[] inside your function, static arrays will do it.
The question is, how does your caller allocate the arrays?
It's a bad idea to use operator delete[] on arrays you given as parameters:
You should allocate them, call you dllbeta1() function which shouldn't modify these parameters
and deallocate them in your caller function.
I can't look into your VI, I don't have 8.6 but since we're in a LabVIEW forum
I assume you want to call your DLL from LabVIEW.
LabVIEW has its own memory management
which doesn't just use new[]/delete[] so you shouldn't modify strings in your DLL unless
you're familiar with the memory management functions in "extcode.h".
And be careful to use the right calling convention: __cdecl or __stdcall
07-02-2009 08:31 AM
candidus a écrit:OK, I got your gift 🙂
It's pretty useless to use new[] inside your function, static arrays will do it.
The question is, how does your caller allocate the arrays?
It's a bad idea to use operator delete[] on arrays you given as parameters:
You should allocate them, call you dllbeta1() function which shouldn't modify these parameters
and deallocate them in your caller function.
I can't look into your VI, I don't have 8.6 but since we're in a LabVIEW forum
I assume you want to call your DLL from LabVIEW.
LabVIEW has its own memory management
which doesn't just use new[]/delete[] so you shouldn't modify strings in your DLL unless
you're familiar with the memory management functions in "extcode.h".And be careful to use the right calling convention: __cdecl or __stdcall
Calling convention is __cdecl.
My dll doesn't modify these parameters... just uses for functions.
Have you got a solution for me ? 😉
thanks