Re: Mixing Mananged and Unmanaged in an Unmanaged class
From: Russell Hind (rhind_at_mac.com)
Date: 06/04/04
- Next message: Russell Hind: "Re: General design question relating to FSM."
- Previous message: Klueless: "Re: General design question relating to FSM."
- In reply to: Yan-Hong Huang[MSFT]: "Re: Mixing Mananged and Unmanaged in an Unmanaged class"
- Next in thread: Yan-Hong Huang[MSFT]: "Re: Mixing Mananged and Unmanaged in an Unmanaged class"
- Reply: Yan-Hong Huang[MSFT]: "Re: Mixing Mananged and Unmanaged in an Unmanaged class"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 04 Jun 2004 08:21:24 +0100
Yan-Hong Huang[MSFT] wrote:
>
> We decided to make it an error, not a warning. The workaround is to define the function outside the class.
>
So the compiler decides whether the function is managed or unmanaged at
the point it is defined (implemented) not declared?
I have a problem in that if I have #pragma unmanaged before a class (non
gc class), and the class contains a gcroot<T*> as a private memeber,
then I get compiler errors. Inserting a #pragma managed and unmanaged
around the declaration solve this. e.g.
__gc class GCTest_c;
#pragma unmanaged
class Test_c
{
public:
Test_c(void)
{
}
private:
gcroot<GCTest_c*> m_Test;
};
This doesn't compile, but can be fixed by putting #pragam
managed/unmanged around the m_Test declaration. e.g.
#pragma unmanaged
class Test_c
{
public:
Test_c(void)
{
}
private:
#pragma managed
gcroot<GCTest_c*> m_Test;
#pragma unmanaged
};
But according to your replies, this shouldn't be done. So is this a bug?
Thanks
Russell
- Next message: Russell Hind: "Re: General design question relating to FSM."
- Previous message: Klueless: "Re: General design question relating to FSM."
- In reply to: Yan-Hong Huang[MSFT]: "Re: Mixing Mananged and Unmanaged in an Unmanaged class"
- Next in thread: Yan-Hong Huang[MSFT]: "Re: Mixing Mananged and Unmanaged in an Unmanaged class"
- Reply: Yan-Hong Huang[MSFT]: "Re: Mixing Mananged and Unmanaged in an Unmanaged class"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|