.NET is doing my head in, I just want an IDataObject interface from my Object!

R

Robin Tucker

I have an existing COM object that supports IDataObject (written in C++). I
want to use GetFormats and GetData on this object in VB.NET, but I blooming
well can't.

If I write:

Dim theObject As IDataObject

theObject = GetObject ( "C:\GAS.TGW" )

(its an image file type), I can load the object no problem with:

Dim theObject As Object

theObject = GetObject ( "C:\GAS.TGW" )

Everything is fine then but of course I cannot cast to the IDataObject
interface.

I get a nice specified cast is not valid exception, even though I know it
is, because I'm damned well using it in an unmanaged C++ program.

So, can I do basic things like this with .NET or did Microsoft deliberately
screw all of our existing technologies with these latest tools.
 
R

Robin Tucker

Also, just out of interest, I'm not using a type library. Apparently, an
MSDN article states that RCW honours the results of
QueryInterface(), in which case, why the hell doesn't it find my IDataObject
interface!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top