General information
Category:
COM/DCOM and OLE Automation
Title:
Queryinterface failed
I created the following in vfp7 ..
Created a new project called comobj.
Added a classlib called classone.
Added a class based on custom called comobjone.
Marked class as olepublic.
Build multithreaded dll called comobj.dll
In Visual Studio.net ...
Created an asp web application.
Added label1, textbox1, and button1 to webform1.
Right clicked on reference and added comobj type library from the com tab.
In the button1.click sub routine (VB) I added the following.
Dim otestobj As New comobj.comobjone()
Dim mystring As String
mystring = otestobj.getstring()
When I run this form and click on button1, I get the error:
QueryInterface for interface comobj.Icomobjone failed.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.InvalidCastException: QueryInterface for interface comobj.Icomobjone failed.
Anybody see what I'm doing wrong? This is my first attempt to call a com object from a .net form, so it's probably something simple.
Thanks.
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only