Home All Groups Group Topic Archive Search About

CreateObject does not work consistently in X64 systems

Author
8 Aug 2006 6:05 PM
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

Author
8 Aug 2006 6:54 PM
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

Show quoteHide quote
> 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
Author
8 Aug 2006 9:48 PM
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

Show quoteHide quote
"GhostInAK" <ghosti***@gmail.com> wrote in message
news:c71747b42b9308c888f03313296c@news.microsoft.com...
> 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,
>>
>> 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
>
>
Author
9 Aug 2006 2:32 AM
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

Show quoteHide quote
> 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
> "GhostInAK" <ghosti***@gmail.com> wrote in message
> news:c71747b42b9308c888f03313296c@news.microsoft.com...
>
>> 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,
>>>
>>> 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