CreateObject does not work consistently in X64 systems

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
 
G

GhostInAK

Hello Glenn,

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

Dim tInventor as Inventor.application = new Inventor.Application

-Boo
 
G

Glenn Palomar

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
 
G

GhostInAK

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top