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++ / May 2004

Tip: Looking for answers? Try searching our database.

How to use unmanaged codes in managed ones.

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alper Akcayoz - 14 May 2004 11:51 GMT
Hello Esteemed Developers
I face problems using some managed codes in unmanaged ones and vice versa. For exampla I frequently took the following error message. That is
            C2440: 'type cast' : cannot convert from 'sockaddr_in __gc*' to 'sockaddr*
               O
            C2664: 'WSAStartup' : cannot convert parameter 2 from 'WSADATA __gc*' to 'LPWSADATA

I noticed that my problem is converting managed types/codes to unmanged types/codes. I found some web pages about conversion. But those examples or explanations seems to me complex. Marshal is a tecnique to do this conversion

If you kindly forward me to a site, which explains this subject, is also prefereable

I would like to thank you in advance foe your sincere considerations and guidances
Tomas Restrepo \(MVP\) - 14 May 2004 12:14 GMT
Alper,

> Hello Esteemed Developers,
> I face problems using some managed codes in unmanaged ones and vice versa. For exampla I frequently took the following error message. That is:
[quoted text clipped - 3 lines]
>
> I noticed that my problem is converting managed types/codes to unmanged types/codes. I found some web pages about conversion. But those examples or
explanations seems to me complex. Marshal is a tecnique to do this
conversion.

> If you kindly forward me to a site, which explains this subject, is also prefereable.
>
> I would like to thank you in advance foe your sincere considerations and guidances

No need to marshal. Your problem is that you need to pin the objects in
order to be able to pass them to unmanaged code. Look for __pin in the
documentation.,

Signature

Tomas Restrepo
tomasr@mvps.org

mccoyn - 14 May 2004 12:51 GMT
Managed pointer as a member to an unmanaged class, or a global
http://msdn.microsoft.com/library/en-us/vcmxspec/html/vcManagedExtensionsSpec_16_3.as

Managed pointer that can be converted to an unmanaged pointer
http://msdn.microsoft.com/library/en-us/vcmex/html/vclrf__pin.asp
Alper Akcayoz - 14 May 2004 13:51 GMT
Thank you MCCOYN

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.