LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

I'm sure I'm doing something really silly but.....

Solved!
Go to solution

Now that it's working I'm kind of unsatisfied because I don't actually know WHY it's working.  I'll be stuck next time I have the same problem.

 

Are there any special things I need to watch when declaring exported functions or something which could have lead to this problem?

 

Shane.

0 Kudos
Message 21 of 23
(1,011 Views)

Intaris wrote:

 

Apparently CVI can only use __cdecl DLLs?  Is this correct?

 


No - I've used both schemes with CVI. Apparantly the Microsoft recommendation is that for 'public' dlls, that are intended for commercial distribution and possible use by VB based programs, __stdcall is the convention of choice. For private dlls with a well-controlled pattern of usage, that excludes VB code, __cdecl is preferred. It is possible to mix both types within a single dll.

 

CVI can be set to use one type or the other by default, but this can easily be over-ridden for individual functions.

 

Confusingly, it is not always disastrous to get the conventions mis-matched - I have seen some functions continue to work just fine, even though the programmer got it wrong. (Depends on the number of function parameters, the number of local variables in the function, if those locals are used before or after further function calls, the compiler,...)

 

JR

Message 22 of 23
(1,010 Views)

Well I've no idea any more as to what was wrong with my software.

 

Either LabVIEW or CVI has decided to do something different today.

 

As long as it stays that way I'll be OK.....

 

Thanks for all the help.

 

Shane.

0 Kudos
Message 23 of 23
(1,000 Views)