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

Tip: Looking for answers? Try searching our database.

simple question, *__gc

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
EP - 14 Jun 2004 22:41 GMT
I have a simple question but I can't find it on any newsgroups.

I have a MC++ class that contains a private field of native type
   private:
      HTTP_RESPONSE _httpResponse.

I need to get it's address
   HTTP_RESPONSE* pResponse = &(this->_httpResponse);

But I get this build error
       error C2440: 'initializing' : cannot convert from 'HTTP_RESPONSE
__gc *' to 'HTTP_RESPONSE *'

Can I store this structure as a member of my class and then work with it as
an unmanaged type?
Jesse McGrew - 15 Jun 2004 07:04 GMT
> I have a simple question but I can't find it on any newsgroups.
>
[quoted text clipped - 11 lines]
> Can I store this structure as a member of my class and then work with it as
> an unmanaged type?

Yes, but you need to make sure the garbage collector won't move it
around behind your back, by using a pinning pointer. Declare pResponse
as a HTTP_RESPONSE __pin * and it should work.

Jesse

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.