From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Why the 2015 64-bite diadem can't "createobject",but the 2012 version can work?

Solved!
Go to solution

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?

0 Kudos
Message 1 of 7
(4,088 Views)

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

 

 

0 Kudos
Message 2 of 7
(4,081 Views)

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?

0 Kudos
Message 3 of 7
(4,074 Views)
Solution
Accepted by topic author tww1994

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

0 Kudos
Message 4 of 7
(4,068 Views)

Thank you,Winfried.

Finally, is there a tool which can transformed 32-bite ActiveX to 64-bite version? 

0 Kudos
Message 5 of 7
(4,055 Views)

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

0 Kudos
Message 6 of 7
(4,039 Views)

OK! Thank you!

0 Kudos
Message 7 of 7
(4,035 Views)