c# - unmanaged/managed interop - trouble passing int[] -


I am working on my PhD in chemistry and for this reason I have a software to help me with imaging Writing the app is a microscope to sample under this microscope, with an X-Y-Z nanoponization phase fit. The platform is controlled by the hardware vendor using an unmanaged DLL written in VC ++. I can provide you with more features but let me start with it;

One of the ways in DLL allows me to read the settings for the speed axis:

C ++ syntax:

  BOOL E7XX_qSVO (int id, const char * szAxes, bool * pbValueArray)  

Where according to convention BOOL int 0 or 1.

This seems right to me, however, when I try to do something in my main application (to query Axis 1,2 and 3):

  Int32 [] _iValues ​​= new Int32 [3]; E7XXController.qSVO (m_iControllerID, "123", _iValues);  

I get an array like this continuously:

{6, 0, 10} While I, 0, 0, 0, the equipment works as a complement:

Also do not work to set the same position bits on the BOOL E7XX_SVO (int id, const char * szAxes, const bool * pbValueArray) step.

Other commands in DLL work perfectly. I can put strings and doubles out without any hassle but not a bull type ...

Do you know what can be wrong?

In C ++, BOOL is indeed an "int", so make sure 32 and not the system. Boolean Alternatively, it can use the COM data type i.e. VARIANT_BOOL, for which you need the system. Boolean Have you tried running a dependency viewer to confirm the function prototype?


Comments