LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

OPENFILENAME

I am trying to use the WinSDK function GetOpenFileName( ) which takes as a parameter a pointer to a structure of type OPENFILENAME. I ran the program fine in CVI V6.0. Now with verions 8.0 I can't get the module to compile. I get an error saying undeclared indentifier OPENFILENAME. I have included "windows.h" which then includes "commdlg.h" which contains the definition. I don't understand why the compiler does not see a reference to it. I am thinking that maybe there is some macro definition that is not set correctly or something like that but not totally sure on this. Any ideas out there??
0 Kudos
Message 1 of 4
(3,126 Views)
Possibly try undefining WIN32_LEAN_AND_MEAN ?
 
Though that may cause other problems and will process a whole bunch of header stuff and slow your compiles down by a lot.
 
The only other thing I can suggest is tracing all the way down through everything to make sure all of the needed defines are being hit with the right structure. That can be a real pain sometimes.
Martin Fredrickson
Test Engineer

Northrop Grumman
Advanced Systems and Products
San Diego, CA 92128
0 Kudos
Message 2 of 4
(3,107 Views)

I was able to get this to work fine but you need to make sure of three things.

1. You have to have the full SDK installed (included only with the FDS package).

2. You have to make sure WIN32_LEAN_AND_MEAN is not defined (check the Build Options dialog).

3. You have to include ComDlg32.lib in the project (found in CVI\sdk\lib).

Hope this helps,

-alex

0 Kudos
Message 3 of 4
(3,104 Views)
Thanks, 
 
Undefining WIN32_LEAN_AND_MEAN took care of it.
 
Mike
 
0 Kudos
Message 4 of 4
(3,100 Views)