LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

CoInitialize() Error

I'm using CVI Version 6.0 with the Windows SDK installed. When I try to
initialize the COM library using CoInitialize(NULL) I receive the following
link error:

Undefined symbol ' CoInitialize@4" referenced in "myproject.c"

Any help would be greatly appreciated.

George
0 Kudos
Message 1 of 3
(3,135 Views)
Hello

You would probably need to add ole32.lib from the ..\CVI\sdk\lib folder to the project.
You should really call 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..)

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 3
(3,135 Views)
Include ole32.lib in your project. If you have the Windows SDK installed and CVI is installed to the default directory this file should be in C:\Program Files\National Instruments\CVI70\sdk\lib
Hope that helps,
Ryan K.
NI
0 Kudos
Message 3 of 3
(3,135 Views)