Message 1 of 2
CreateObject Error - Inventor and VB6

Not applicable
10-17-2003
03:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have created a class that uses CreateObject /GetObject to open an
application. Every time the class creates a new instance of the application,
when the class exits it returns an Application Error The error states the
memory location and " "The memory could not be "read".
When I place a break point in the code the error does not occur. So I placed
an OK Only message box in the Terminate event this also prevented the error.
I also used a loop and this worked but not a good solution.
I am trying to find a solution that does not require operator intervention
has anyone any ideas.
'GetObject("", "Inventor.Application") always creates a new Instance
The basic code:
Set oApp = GetObject("", "Inventor.Application")
Set oDoc = oApp.Documents.Open("C:\BradTest.ipt")
oApp.Visible = True
Dim oPartDef As PartComponentDefinition
Set oPartDef = oDoc.ComponentDefinition
Code to make changes
oDoc.Save
oDoc.Close
oApp.Visible = False
Thanks
I have created a class that uses CreateObject /GetObject to open an
application. Every time the class creates a new instance of the application,
when the class exits it returns an Application Error The error states the
memory location and " "The memory could not be "read".
When I place a break point in the code the error does not occur. So I placed
an OK Only message box in the Terminate event this also prevented the error.
I also used a loop and this worked but not a good solution.
I am trying to find a solution that does not require operator intervention
has anyone any ideas.
'GetObject("", "Inventor.Application") always creates a new Instance
The basic code:
Set oApp = GetObject("", "Inventor.Application")
Set oDoc = oApp.Documents.Open("C:\BradTest.ipt")
oApp.Visible = True
Dim oPartDef As PartComponentDefinition
Set oPartDef = oDoc.ComponentDefinition
Code to make changes
oDoc.Save
oDoc.Close
oApp.Visible = False
Thanks