Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / Managed C++ / October 2004

Tip: Looking for answers? Try searching our database.

Conversion from C++ to /clr yields 'LNK4248 unresolved typeref tok

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
softwarerocks - 26 Oct 2004 18:43 GMT
My first attempt to convert a fairly complex C++ project to MC++ using the
/clr switch has several problems.  The source compiles fine (with deprecated
warnings of course).  The linker emits several LNK4248 messages all related
to _IMAGELIST and _TREEITEM.  When I try to execute the application, a dialog
popups saying, "An unhandled exception of type 'System.MissingFieldExcepton'
occured in Unknow Module."

So,

1) How do I fix the LNK4248 messages (I would have thought the compiler
would have known about MS structures).
2) How do I even begin to unravel the fatal runtime error?
3) Does the usage of 3rd party COM objects of itself yield problems using
the /clr switch?

Thanks for any help
Ronald Laeremans [MSFT] - 31 Oct 2004 21:14 GMT
Add empty definitions of both structures. The linker will do that
automatically for you in VC 2005 (and give a warning).

This is because the CLR internally does not support using a pointer to an
undefined class. These 2 structures are never defined in the Windows
headers. In native C++ this is not an error as long as you don't try to
deference anything of it, in the CLR just creating the pointer is illegal.

Ronald Laeremans
Visual C++ team

> My first attempt to convert a fairly complex C++ project to MC++ using the
> /clr switch has several problems.  The source compiles fine (with
[quoted text clipped - 16 lines]
>
> Thanks for any help

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.