LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

MSXML ActiveX problem

I am using MS XML 3.0 activex server in CVI. I used the CVI feature to
create an instrument driver and it is working fine. Now I have interfaced my
CVI code with a VC++ DLL made by another person which also used MS XML
parser inside one of the functions that I call.

I can call my function which uses MS XML and also the function in the VC++
DLL but problem comes after I have made the call to the VC++ function. Now
if I call my CVI function again, it fails, when I try to create a new MS XML
object. I get an error "CoInitialize has not been called". If I don't make
call to VC++ DLL function (which also uses MS XML), everything works fine. I
have looked at the VC++ DLL code and it seems to be properly creating the MS
XML parser object and destroying it at
the end. So don't know if the problem
is in my CVI or VC++.

Anyone seen any issues with MS XML 3.0 sp2 parser in CVI?


vishi
0 Kudos
Message 1 of 2
(3,143 Views)
Hello

This might be happening because the XML server needs an STA thread to operate. In the beginning of your CVI code, try calling CA_InitActiveXThreadStyleForCurrentThread() ( as one of the very first functions in main() for example ).

I hope this helps

Bilal Durrani
NI
Bilal Durrani
NI
0 Kudos
Message 2 of 2
(3,143 Views)