I've not tried this, so forgive me if it's wrong... (presumably Bitmap will
serialize OK, if not, the following doesn't directly apply)

You're using different format specifiers for the GetData and SetData. In one
you're using a string, in the other you're using a type.

Try using either:
        SetData(bitmap)
        GetData(typeof(Bitmap))
or:
        SetData(DataFormats.Bitmap, bitmap)
        GetData(DataFormats.Bitmap)

You'll have to investigate what data formats Word will accept. There's a
little .NET utility on one of the samples sites somewhere which can help you
do this, but I forget where it was and what it was called. Still, it's easy
enough to create your own DataObject class and see what GetDataPresent()
gets called with.

HTH,
G.
--
Graeme Foster ([EMAIL PROTECTED])
Principal Software Engineer
Aston Broadcast Systems Ltd. (http://www.aston.tv)
Disclaimer: I really don't have a clue what I'm on about.

-----Original Message-----
From: dotnet discussion [mailto:[EMAIL PROTECTED]]On Behalf Of
Christopher Gruener
Sent: 12 April 2002 14:43
To: [EMAIL PROTECTED]
Subject: Getting _TransparentProxy instead of Bitmap while doing
Drag&Drop


Hello!

When I start my app two times and try to drag a bitmap from one to the
other I have a problem. The object I get is type of TransparentProxy. Well,
I can cast to Bitmap but when reading a property from that object I get
following message:

"This remoting proxy has no channel sink which means either the server has
no registered server channels that are listening, or this application has
no suitable client channel to talk to the server."

My code when starting Drag&Drop:

     Bitmap bitmap = new Bitmap(200, 200);
     ...
     DataObject dataObject2 = new DataObject();
     dataObject2.SetData(DataFormats.Bitmap, true, bitmap);
     this.DoDragDrop(dataObject2, DragDropEffects.Copy);

My code in MyApp_DragEnter():

     Bitmap obj = e.Data.GetData(typeof(Bitmap)) as Bitmap;
     if (obj != null)
     {
         int height = obj.Height;  // -> Error
     }

What I really want is to drop and show a bitmap.
When dragging into Word (Ver.9) it's not working too. So I think I must do
something before calling the method DoDragDrop().

You can read messages from the DOTNET archive, unsubscribe from DOTNET, or
subscribe to other DevelopMentor lists at http://discuss.develop.com.

Reply via email to