Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems running in CVI a DLL made in Visual c++ 2008

Hello,

 

I  have made a DLL in visual c++ 2008.

 

The function declaration prottypes are defined  as:

 

#define DLLTYPE void __declspec(dllexport)

 

#ifdef __cplusplus

extern "C" {

#endif

 

 

DLLTYPE RS232OpenPort(const char *Port, int* handle, int *iResult);

 

 

#ifdef __cplusplus

}

#endif

 

Calling the function in cvi always generates an General Protection Fault at address 6865A1C8.

 

The dll was tested succesfully in Visual c++ 2008.

 

Anyone has a solution for that?

 

 

0 Kudos
Message 1 of 3
(6,456 Views)

Hi Danut81,

 

If this dll is written using c++ .NET, the problem may be that you are not using our .NET library.  This post has more information on this possibility:

 

NI forums: CVI call to Managed C++ DLL causes 'General Protection' fault

 

If you are not using .NET, or this does not resolve your problem, please attach your dll and source so that I can attempt to replicate the issue.

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 2 of 3
(6,432 Views)

By reading the post CVI call to Managed C++ DLL causes 'General Protection' fault I indentify the same issue on my DLL. 

I was able to get rid of the anoing crash only by removing some calls from a DLL  that was probably using some .NET assemblies (functionality).

Anyway this did not really solved my problem, only I was able to find the root cause. Dynamically loading the library works fine also in my case but this is not what I wanted.

By the way I'm using CVI 8.5

0 Kudos
Message 3 of 3
(6,423 Views)