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