LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing the DataSocket only using nids.dll

Solved!
Go to solution

Hello Candidus,

 

thank you very much. This really is it.
Honestly speaking, I do not (yet) see the difference to my previous attempts and why I always gotback a variant VT_I4 instead of an VT_ARRAY|VT_R8 (or VT_R4), but since I have a working version I can analyze this , modify it and learn.

 

Thanks again

 Peter

0 Kudos
Message 11 of 14
(1,237 Views)

To all who might be interested:

 

If I use CoInitialize(NULL) it fails, if I use CoInitializeEx( NULL, COINIT_MULTITHREADED ) it works.:smileysurprised:

 

Again thanks to Chris and candidus for their help.

 Peter

0 Kudos
Message 12 of 14
(1,232 Views)

That seems to be the key.

 

CoInitialize(NULL) is the same as CoInitializeEx(NULL, COINIT_APARTMENTTHREADED) .

Our DataSocket client can't live in a single-threaded apartment.

 

That's especially important if you want to use MFC: MFC only supports single-threaded apartments

so you must do your DataSocket stuff from another thread.

 

 

0 Kudos
Message 13 of 14
(1,228 Views)
The nasty thing was, that it worked for individual data, but it failed for arrays.
0 Kudos
Message 14 of 14
(1,217 Views)