CreateObject does not work consistently in X64 systems

  • Thread starter Thread starter Glenn Palomar
  • Start date Start date
G

Glenn Palomar

Hi,

I have an application that creates an instance of a COM component. It works
consistently in XP x86 but not in XP x64 systems.

My code looks like the line below:
m_appInventor = CType(CreateObject("Inventor.Application"),
Inventor.Application)

I would appreciate any suggestion on how to make it work consistently in x64
systems.

Also, is there an equivalent VB.net class for this?

Thanks,
Glenn
 
Hello Glenn,

If you just create a project reference to the COM library you can:

Dim tInventor as Inventor.application = new Inventor.Application

-Boo
 
Hi Boo,

Thanks for your reply.

Unfortunately the COM library does not seem to allow creation in the context
below (unlike Excel). I get an error saying - 'New' cannot be used on an
interface.

Is there a workaround to this?

Thanks,
Glenn
 
Hello Glenn,

No.. no workaround.. you can not instantiate interfaces (which is what the
New keyword does.. instantiate things).. you can only instantiate classes
and structures.

So.. you need to create (New) whatever class implements the interface you
are trying to mess with. Poke around in the Object Browser.

-Boo
 
Back
Top