LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Pixelink API

Hi everybody.
Did anyone used in the past the Pixelink camera API to build an application with LW/CVI ? The .h file Pixelink gives does not compile. This is a short sample of what happens. The .h file looks for instance like this:

....
// Capture AVI file
PXL_API
PimMegaCaptureAVI(IN HANDLE hImager, // Imager object handle
IN U32 uNumberFrames, // Number of frames in AVI
IN LPSTR pFileName); // File name for AVI
....

and I get the following compiler messages:

about the line PXL_API: "PimMegaApiUser.h"(96,1) Warning: Empty declaration.
"PimMegaApiUser.h"(96,1) syntax error; found 'string constant' expecting ';'.
"PimMegaApiUser.h"(96,1) Unrecognized declaration.

about the next line: "PimMegaApiUser.h"(97,1) syntax error; found 'identifier' expecting ';'.
about the HANDLE keyword: "PimMegaApiUser.h"(97,22) syntax error; found 'identifier' expecting ')'.
about the closing ; : "PimMegaApiUser.h"(99,40) Extraneous formal parameter specification.


Does anyone hace some suggestion ?
Many thanks in advance,
Enrico
0 Kudos
Message 1 of 8
(4,912 Views)
At the top of your source code, try to put #include first then #include
Regards, Philippe proud to be using LabWindows since version 1.2
// --------------------------------------------------------------------------------------------
0 Kudos
Message 2 of 8
(4,890 Views)
Philippe,
your suggestion is too cryptic for me or something went lost in the message.
Which #include have I to put before what else #include ?
Many thanks, regards
Enrico
0 Kudos
Message 3 of 8
(4,877 Views)
What does Pixelink say about that .h file?
If it is compatible with ANSI C code, then there is no reason why CVI would not compile it?
Did you manage to compile it correctly with any other compiler?
Does it compile under VC++, for example?
Pxelink should tell you at least if their API is ANSI C compatible.

Regards,

AlessioD
0 Kudos
Message 4 of 8
(4,858 Views)
Hello,

With these kind of cryptic compile options, I start to look for missing #define and #include.
In this particular case, I would first try an extra include in your source before you include any Pixelink h-files: #include "windows.h". This file is located in the CVI\sdk\include subdirectory.

Good luck,
Jos
0 Kudos
Message 5 of 8
(4,854 Views)
This is an issue with the forum !
My suggestion was to make sure you put

#include "windows.h"

before

#include "pixellink.h"
Regards, Philippe proud to be using LabWindows since version 1.2
// --------------------------------------------------------------------------------------------
0 Kudos
Message 6 of 8
(4,846 Views)
First, thanks to everyone for your suggestions.
I asked Pixelink some days ago and I am waiting for an answer (I posted on the Pixelink forum too, but I did not get anything).
In the meanwhile, I am trying to play with #include orders and include files (like windows.h), but with no success up to now.
I am trying also VC++ and it gives me errors too, some similar and others different.
Thank-you again, regards
Enrico
0 Kudos
Message 7 of 8
(4,840 Views)
Hi to everybody.
after your hints and some help from PixLink I solved the problem. As some of you suggested, the .h file actually was for C++ so I had first to remove any default inizialization from function headers and also to change the directive

#define PXL_API extern "C" __declspec(dllimport) PXL_RETURN_CODE WINAPI

to

#define PXL_API extern __declspec(dllimport) PXL_RETURN_CODE WINAPI

As previously stated, the #include windows.h is required too.

Many thanks,
Enrico
0 Kudos
Message 8 of 8
(4,808 Views)