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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

QueryInterface for interface DrawingSrch._clsDrawingSrch failed Help!!

Status
Not open for further replies.

Transcend

Programmer
Sep 29, 2002
858
AU
Hi guys

i'm really stuck.
I'm trying to call a vb6 com object from my asp .net application. The object is fairly simple with just the one class call clsDrawingSrch. I am trying to return from it a filestream object. In this case i'm just returning a variant and assigning it to a filestream object in the .net app.

However this code generates the error in the subject, QueryInterface for interface DrawingSrch._clsDrawingSrch failed.

Dim fs As FileStream

fs = DrawingImage.GetStream(strFileLocation) <- this line

I'm not sure what i'm doing wrong!!

Any ideas?

Transcend
[gorgeous]
 
Exact error messages are usually very helpful in trying to figure out what the problem is, but I'm going to go out on a limb here and say that most likely, the two datatypes are completely incompatible.

ie. you're trying to return a variant to .NET. .NET has no clue what a variant is, and therefore errors out on that line.

I think you'll need to take a different approach altogether with some middleware or something. Most likely, you'll need to serialize the filestream to a text file, and then pick that file up with your .NET code.

-paul
penny1.gif
penny1.gif

The answer to getting answered -- faq855-2992
 
Hi there

i got around this problem, i had to set binary compatibility on the com component. Now the com component returns an adodb.stream object, and i have declared an adodb.stream object in the .net app.

Now the same line

fs = DrawingImage.GetImage(strFileLocation)

throws this error:
Arguments are of the wrong type, are out of acceptable range, or are in conflict with one another.

Transcend
[gorgeous]
 
Ah never mind i just had reference the wrong thing!

thanks anyway

Transcend
[gorgeous]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top