> Greetings!
>
[quoted text clipped - 22 lines]
> thunking layers or anything like that that would make it's access
> slower.
Based on a very simply experiment, it doesn't appear to make any difference.
What matters is whether #pragma managed is in effect where the class
definition appears.
<code>
#pragma managed
//Forward declaration
class AnotherClass;
#pragma unmanaged
class MyClass
{
public:
void func1(AnotherClass* ptr) {}
};
#pragma unmanaged // 1
class AnotherClass
{
public:
void f() {}
};
</code>
If the line at //1 is #pragma unmanaged, the resulting .obj looks identical
to that produced if // 1 is deleted. It // 1 is #pragma managed,
AnotherClass::f() is emitted as managed code.
-cd
Gustavo L. Fabro - 01 Jul 2005 14:42 GMT
Hmmm
I took your idea and compiled these files
#1
#pragma managed
class AnotherClass;
#pragma unmanaged
class MyClass
{
public:
void func1(AnotherClass* ptr);
}
#2
#pragma unmanaged
class AnotherClass;
#pragma unmanaged
class MyClass
{
public:
void func1(AnotherClass* ptr);
}
The obj files have the same size but are different. But that doesn't tell
*me* much, because If I compile the same file twice, different (binary
speaking) obj files will be created too.
Fabro
Carl Daniel [VC++ MVP] - 01 Jul 2005 15:08 GMT
> Hmmm
>
[quoted text clipped - 28 lines]
> (binary
> speaking) obj files will be created too.
Use dumpbin /all on the .OBJ files to see the internals. I didn't do a very
thorough examination, but at the level I did look, it appeared that no
significant changes to the file were made. In your example, there's no code
being generated at all, so I think you need to embelish the test case just a
bit to make it meaningful.
-cd