Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automation Error

Status
Not open for further replies.

Erioly

Programmer
Sep 4, 2008
10
US

Hi!

I am running the following code:

1) sImageID = oDocInstance.ElementInBoxID(i, DssDocumentReportModeGraph)
2) vData = oDocInstance.GraphImageData(i)

, and getting error

-2147467261, "Automation error
Invalid pointer "

from line 2

Can any one tell me what Automation error Invalid pointer error actually means?
 
There is absolutely no clue here as to what you are automating. Perhaps to start us off you could help us to help you by providing that information.
 
Besides of the context, what does "Automation error Invalid pointer" mean? I know it is a very general error, but not sure what it means, conceptually.
 
Conceptually it means that an invalid pointer has been passed. SO I'm going to have to assume that you are not entirely clear what a pointer might be.

In simple terms, all VB variables are actually pointers (i.e. the actual memory address) to where the actual data is (whether that data be a Long, a Double, a User Defined Type, an Object, or whatever). This is all hidden away from you in VB, and when you try an examine a variable you actually get given the contents of the memory location that the variable points to. VB does provide some hidden methods for showing the actual pointers; try looking up ObjPtr, StrPtr and VarPtr in VB's help files

So the error message means that, for some unspecified reason, a variable that has been passed (i.e. a pointer) is invalid (it may be, for example, that it is pointing to data of the wrong type, or that the memory it is pointing to has been freed and contains garbage or because a null pointer - one that doesn't point at anything - has been passed or ... well, many reasons) The reason the error message conytins little information is that whilst it is realtively easy to check whether the data pointed to is correct or not, it is difficult to detetmine at that point why it is wrong.

(having said all that, one of the main reasons that it crops up in VB programs is when VB tries to pass an Object whose value is Nothing to methods and properties that are are expecting it to be set to something ...)

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top