473,322 Members | 1,781 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

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


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.
Nov 20 '05 #1
1 1678
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!

"Robin Tucker" <id*************************@reallyidont.com> wrote in
message news:bk*******************@news.demon.co.uk...

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.

Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Preston Crawford | last post by:
I'm looking to quickly get a photo album online. Very simple, thumbnails, a few pages, maybe a description, but hopefully a small script that's easy to edit and work into my existing site. I know...
1
by: EHuq | last post by:
Hi there I am facing a problem. When I include my unmanaged header file in my form1.h file, I am facing the compile error with the following messag C:\Program Files\Microsoft Visual Studio .NET...
0
by: Krunoslav Ostrouska | last post by:
ArrayList included in object is not saved at clippboard copy in Win98 (Clipboard.SetDataObject() and IDataObject.GetData()) ! In WinXP, framework calls GetObjectData() and...
27
by: Greg Smith | last post by:
Hello, I have been given a programming task that falls into the "impossible" category with my current skill set. I am hoping somebody out there knows how to do this and can save my b-t. I...
7
by: **Developer** | last post by:
Although the code is VB I believe the question is OOP I tried the VB NG but no answer. I suspect the c# programmer is more apt to be aware of these kinds of subtleties so I', trying here. I do...
3
by: nicolas.hilaire | last post by:
Hi group, when using unmanaged class with my managed app, I've seen errors when including (for example) <windows.h>. One of theses erros is : IDataObject : ambiguous symbol error I've seen...
3
by: dmeglio | last post by:
I have the following code: foreach (System.Type type in this.slideModules.Values) { IDataObject ido = Clipboard.GetDataObject(); if (ido.GetDataPresent(type)) { slide = ido.GetData(type) as...
6
by: r035198x | last post by:
I have put together this article to give people starting Swing an awareness of issues that need to be considered when creating a Swing application. Most of the Swing tutorials that I have seen just...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.