LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

problem in using objbase.h ,help!!!

Hi
I have some problems in using the header file <objbase.h>
when I want to use the functions defined in objbase.h,such as " WINOLEAPI  CoInitialize(IN LPVOID pvReserved)",
labwindows cvi will give error information:
 
  Undefined symbol '_CoInitialize@4' referenced in "test.c".
 
who can tell me why??
thanks a lot ~~~~~~~~~
0 Kudos
Message 1 of 3
(3,959 Views)
Hi phoenixmy,

You need to include the ole32.lib import library in your project. You can find this library in the <CVI>\sdk\lib directory if you have the Windows SDK installed for CVI. 

I would like to add that you should really be calling CA_InitActiveXThreadStyleForCurrentThread instead of CoInitialize. CVI provides routines for using ActiveX, and this function initializes COM (by calling CoInitialize) and takes care of any other initialization CVI might need (ActiveX callbacks in multiple threads etc.)

Best Regards,
Jonathan N.
National Instruments
0 Kudos
Message 2 of 3
(3,938 Views)
hello jonatha..i have tried putting ole32.lib into the project...but it still doesntwork....I get the same error message as the other person
Message Edited by adasdasdasd on 02-18-2010 09:11 AM
0 Kudos
Message 3 of 3
(3,647 Views)