|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
CreateObject does not work consistently in X64 systemsHi,
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 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 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 > > 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
Must call RemoveHandler after AddHandler?
VS 2005 freezes during code editing (HotFix 917452) How to raise an event when a transaction is rollbacked .Net combo box - what is "opposite" of DropDown event? add row ro gridview Configuration file Simple SQL question Software process question problem to read binary file Create a file hash |
|||||||||||||||||||||||