05-12-2016 01:33 AM - edited 05-12-2016 01:36 AM
I used the labview to build a model to add up 2 numbers, such as 1+2=3.
After I produced the ".net file" of the model, I transformed the ".net file" to "com" by the Visual Studio 2010.
Then I run the following code both in 2012 32-bite diadem and 2015 64-bite diadem.
dim objvi set objvi = createobject("shiyan.class1") shiyan.X=1 shiyan.Y=2 call msgboxdisp(shiyan.Z)
1.shiyan is the name of model.
2.2012 version: The return value is 3.
3.2015 version: The ActiveX can't creat object"add.class1".
So why?
Solved! Go to Solution.
05-12-2016 02:02 AM
Hi tww1994
The problem is, that you try to open a 32 bit ActiveX from a 64 bit software. That does not work (or you need a DllSurrogate, which requires some hacks in the Registry). So if possible try to get a 64 bit version of you ActiveX control.
Winfried
05-12-2016 02:36 AM
Hi,Winfried.
What you said means that the version of ActiveX is 32-bite. The labview whta I used is 2014 32-bite version. So the version of labview is the key which caused the ActiveX problem.
That means if I change the labview version to 64-bite, the ActiveX version will change to 64-bite version, too. Then My 2015 diadem will work.
Right?
05-12-2016 02:51 AM
Hi tww1994
Of course you could also use the 32 bit version of DIAdem 2015 but in the next versions of DIAdem it will be available only as 64 bit version.
With Labview 64 bit you could create a 64 bit ActiveX (as well as 32 bit ActtiveX, with special settings).
Winfried
05-12-2016 04:03 AM
Thank you,Winfried.
Finally, is there a tool which can transformed 32-bite ActiveX to 64-bite version?
05-12-2016 04:48 AM
Hi tww1994
No it is not possible to convert the ActiveX. But as a workaround you could use the surrogate method described here:
http://www.codeproject.com/Tips/267554/Using-32-bit-COM-Object-from-64-bit-Application
Winfried
05-12-2016 05:00 AM
OK! Thank you!