LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

The pascal calling convention is not supported in the WIN32 version of CVI.

I am having one project.This project our seniors done by using LabWindows/CVI 4.5 version.Now i am trying to compile this project with 8.5 version but i am getting error message saying that "The pascal calling convention is not supported in the WIN32 version of CVI.".Is there any solution to solve this problem?
0 Kudos
Message 1 of 19
(5,276 Views)
Hey Pradeep2207,

I believe that the reason you're getting this error is because the program was created for a WIN16 system.  To resolve this issue type this in your source code: #define PASCAL __stdcall. This should take care of the calling convention.

Furthermore, this forum thread describes this issue as well.
Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 2 of 19
(5,249 Views)
Will this work when more than one parameter is passed to a function? I have a vague recollection that pascal used left-to-right parameter pushing and stdcall uses right-to-left? Maybe that was just on a really old system...
 
JR
0 Kudos
Message 3 of 19
(5,248 Views)
JR,

You are correct that stdcall uses right-to-left parameter pushing, but I am honestly unsure of Pascal.  As a result of your post, I check with R&D just to make sure that this would still work.  Assuming that the project involved doesn't call a DLL...
  1. If you're building an application that does not interface with any DLLs, you can even just eliminate the PASCAL convention; in this instance, CVI will simply default to the setting chosen in the Options » Build Options menu.
  2. If you're building a DLL, you can choose either the cdecl or the stdcall convention. 
However, if the project does in fact call a DLL, then you need to pull the calling convention from the header file of the DLL.

I hope this helps, JR.

Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 4 of 19
(5,220 Views)
Hai Derrick S,
Tanx for responding my mail.
In which file i have to insert this statement in my project #define PASCAL __stdcall.
0 Kudos
Message 5 of 19
(5,204 Views)
Hi Pradeep,

Do you have a header file associated with your project?  Try putting it at the top of the header file before any function prototypes that use the PASCAL convention are declared.
Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 6 of 19
(5,182 Views)
Hi Derrick S,
I added that statement in all .h files those having  _pascal statements.then also i am getting same type of error.
0 Kudos
Message 7 of 19
(5,173 Views)
Hey Pradeep,

How is the PASCAL calling convention used in your *.h file(s)?  Is it used as PASCAL or __pascal ?  Why don't you try posting a single example *.h file that uses the convention and where you tried to make the change and we'll take a look.
Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 8 of 19
(5,150 Views)

I am Sending one .h file.we are using both _pascal and PASCAL.i think u can get by seeing this file how we are using both _pascal and PASCAL.i am attaching 1 .h file here.

 

0 Kudos
Message 9 of 19
(5,143 Views)
Pradeep,

Go ahead and delete the _pascal keyword from all of the lines that use it.  Don't forget that you can use CVI's "Replace" feature to find and replace all instances of the occurrence (that way you don't have to find each instance manually) - the "Replace" feature can be accessed via the Edit»Replace menu, or by using the keyboard shortcut Ctrl+H.

Once you delete the keyword, the option selected in your Options » Build Options menu will take over, as I stated in my previous post.
Derrick S.
Product Manager
NI DIAdem
National Instruments
0 Kudos
Message 10 of 19
(5,114 Views)