Thanks for the reply Arnaud.
You're right. I didn't actually think about the "re-use" aspects of exposing
a public native class. The types of methods I'm referring to would be
categorized as "internal to assembly group" if there were in fact such a way
to express that concept in .NET. In other words, they are a base-class
assembly package that is not necessarily for general consumption by
end-users, but will have multiple "higher-level" assemblies depending on
it. They used to be part of one assembly, and I'm now breaking this assembly
in two, so some methods have had to become public rather than internal as a
result.
For the moment, however, I've just put a wrapper around the object in
question which solves the problem.
Thanks for the pragma option - I'll keep it in mind.
Kevin
"Arnaud Debaene" <ad******@club-internet.frwrote in message
news:O5**************@TK2MSFTNGP05.phx.gbl...
>
"Kevin Frey" <ke**********@hotmail.coma écrit dans le message de news:
eF**************@TK2MSFTNGP05.phx.gbl...
>>
Okay, after a little investigation:
It would appear that, from looking at the assembly with Reflector, all
native types are compiled as internal.
Hence there would appear to be an explicit firewalling between using the
same native type across an assembly boundary, on account of the native
type being internal to the assembly.
The practical effect is that class A in assembly 1 is considered distinct
from class A in
assembly 2, even though logically they are the same definition.
Fortunately I only have exactly one case where I am passing a native type
across assembly boundaries, and I intend to solve it by wrapping the
native type.
Nonetheless I'd still be interested if others have found alternative
solutions.
Mark the native type as public (see
http://msdn2.microsoft.com/en-us/lib...bw(VS.80).aspx) or use
#pragma make_public (see
http://msdn2.microsoft.com/en-us/lib...07(VS.80).aspx)
However, you should be aware that using a native parameter for a public
function is a very bad idea if you want your assembly to be compatible
with other .NET languages.
Arnaud
MVP - VC