4
$\begingroup$

I can call an application named "PinPoint.Plate" with Visual Basic, Python and Mathematica version 8 but not with version 9. I can still call Excel though. How can I fix this? This is what I did:

Needs["NETLink`"]
InstallNET[];
NETLink[];
p = CreateCOMObject["PinPoint.Plate"]

gives the error:

 (* CreateCOMObject::netexcptn: A .NET exception occurred: System.Runtime.InteropServices.COMException (0x80040154): Retrieving the COM class factory for component with CLSID {9B7024E3-BD35-11D2-8EE4-0080C70A9C3D} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipVisibilityChecks, Boolean skipCheckThis, Boolean fillCache)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at Wolfram.NETLink.Internal.CallPacketHandler.createCOM(KernelLinkImpl ml). >> *)
$\endgroup$
2
  • 1
    $\begingroup$ for starters, put a semi between the Needs and the InstallNET. $\endgroup$ Mar 29, 2013 at 20:40
  • $\begingroup$ I guess it could have to do with the .NET version that is used. Version 9 uses .NET 4.0 while Version 8 seems to use 2.x according to ShowNETConsole. I guess that somehow you need to ensure that PinPoint.Plate is registered in such a way that the .NET version used by mathematica sees it. I'm no .NET expert and don't know PinPoint.Plate, so I don't have an idea how to achieve that... $\endgroup$ Mar 30, 2013 at 10:33

1 Answer 1

7
$\begingroup$

This is apparently a 32-bit COM object, so you need to force .NET/Link to run in 32-bit mode:

Needs["NETLink`"];
ReinstallNET["Force32Bit" -> True];
p = CreateCOMObject["PinPoint.Plate"]

Generally, the only time you need to worry about bit-ness issues is when you are calling non-.NET code, such as a 32-bit DLL via DefineDLLFunction or, as here, a 32-bit COM object.

$\endgroup$
1
  • $\begingroup$ WOW That was great it now works. THANKS!!! But it still doesnt call the methods quite right. I explore it a bit more $\endgroup$
    – PaulB
    Apr 16, 2013 at 20:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.