LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Run DLL in C++ from Labview

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.

0 Kudos
Message 1 of 12
(3,440 Views)

capsim wrote:

 

Join my project...


How much are you ready to pay me by hour, if I join your project... ?! Smiley Very Happy

- Partha ( CLD until Oct 2024 🙂 )
0 Kudos
Message 2 of 12
(3,418 Views)

parthabe a écrit:

capsim wrote:

 

Join my project...


How much are you ready to pay me by hour, if I join your project... ?! Smiley Very Happy


 

Smiley Tongue

 

How much time do you spend on my problem?
 ;))
and do you find my errors?
Ben.
0 Kudos
Message 3 of 12
(3,412 Views)

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.

 

0 Kudos
Message 4 of 12
(3,406 Views)

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++ ! Smiley Wink

but I've been adding :

char * var = new char[];

...

delete [] var; 

 

but... it's the same pb... 😞

 

help// plzzz ...

0 Kudos
Message 5 of 12
(3,396 Views)

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 ! 😉
0 Kudos
Message 6 of 12
(3,393 Views)

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???

 

0 Kudos
Message 7 of 12
(3,392 Views)

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 ! 😉

0 Kudos
Message 8 of 12
(3,386 Views)

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

 

 

0 Kudos
Message 9 of 12
(3,385 Views)

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

 

0 Kudos
Message 10 of 12
(3,364 Views)