Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8072431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T14:01:05+00:00 2026-06-05T14:01:05+00:00

I have a DoDragDrop where I set the data to a Point .when I

  • 0

I have a DoDragDrop where I set the data to a Point.when I drag within one instance – everything’s OK. But when I drag between two instances of the program Visual Studio gives me this error:

The specified record cannot be mapped to a managed value class.

Why?

EDIT: here’s the code:

DataObject d = new DataObject();
d.SetData("ThePoint", MyPoint);
DragDropEffects e = DoDragDrop(d, DragDropEffects.Move);

And:

Point e2 = (Point)e.Data.GetData("ThePoint");
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T14:01:06+00:00Added an answer on June 5, 2026 at 2:01 pm

    The specified record cannot be mapped

    Note the oddity of the word “record”. It is a COM-centric word for “struct”. What you are trying to do almost works, but not quite. The DoDragDrop() method properly marshals the Point structure to a COM object, possible because Point has the [ComVisible(true)] attribute. The missing ingredient is the info required by IRecordInfo, a COM interface that describes the layout of the structure. Required because structures have a very compiler dependent layout.

    This interface is normally implemented by reading the structure definition from a type library. Which is in fact available, the Point struct is described in c:\windows\microsoft.net\framework\v2.0.50727\system.drawing.tlb. You can look at it with the OleView.exe tool, File + View Typelib.

    Everything good, except for the part where the receiver of the COM object has to translate it back to a managed object, a Point. That requires finding out what type library contains the object definition so IRecordInfo can do its job. Which is recorded in the registry, HKCR\Record key. Which does not contain an entry for Point. Kaboom.

    Create your own class (not struct) to store the data, give it the [Serializable] attribute so it can trivially be marshaled.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to implement drag and drop between two listboxes. I have a
I have a drag-and-drop functionality in my application using DragDrop event and DoDragDrop method
I have a WinForms application where I'm doing drag and drop between 2 TreeViews.
have not tested on windows. but in ubuntu when u disconnect from the network,
I have, what should be, a simple question on drag'n'drop. I have a fresh
I have a user control that has 2 controls A and B within it.
I have some hierarchical data that I need display as a table, can I
I have a Flex panel, in InDesign, from which I drag an URL. If
I have a custom app which needs to support Drag and Drop. On Dragging
I have implemented my custom drag&drop by deriving from COleDataSource and COleDropTarget. Everythings work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.