C++ Managed Wrapper DLL exposes unmanaged names too - help



Have a huge c++ class library of more then 7000 classes wrapped with managed
classes using specific namespace but same class names as unmanaged.
unfortunately since .NET 2003 all unmanaged classes are visible as exported
from the wrapping dll, thus hiding names of the wrapping namespace. The
consequence is, that the C# client using the wrapping dll cant access
wrapping classes without prefixing each with the namespace - regardless if
"using wrappingNamespace" is there or not.

Have broken down testing until the simplest example provided by MS on
wrapping unmanaged classes - even that code can't overcome this with .NET
2003 - they wrap a class "sampleClass" with "sampleClass_w". Both appear to
be visible then (the unmanaged one as struct value type). If both named
"smpleClass" instead, the unmanaged one hides the managed one, the managed
one can only be accessed via "managedWrapper.sampleClass" from client
requiring (impossible) rewrite - "using managedWrapper" does not have any
influence, unmanaged being in default namespace wins!

This seams to be changed behavior from older CLR ( < 1.1) versions, which
did only export namespaces implemented in the wrapper linked. Now it seems
to export everything which it sees declared - regardless if managed or
unmanaged.

What is the hint to overcome that - renaming all the wrapper of 7000 classes
is impossible to me as it is to all the client C# apps using the wrapper? I
only want to update the wrapping DLL without touching all the clients.
Is there any method to tell the C++ compiler or linker not to export
unmanaged classes in managed DLL wrapper?

Thank you
Tomasz


.



Relevant Pages

  • Re: [PATCH] private mounts
    ... >>I suppose it will be called by the login process or by wrappers like ... shell were actually modified to implement setnamespace, ... The wrapper I mentioned will usurally not be needed for normal operation, ... The mount would be a part of the current namespace, ...
    (Linux-Kernel)
  • problem with calling C++/CLI wrapper to C++ code from C# applicati
    ... only to the wrapper and the wrapper has a reference to unmanaged dll. ... reference only to the wrapper namespace. ... _CppLib = new CCppLib; ...
    (microsoft.public.dotnet.languages.vc)
  • Re: C runtime library for Unix
    ... and what I need to use to avoid polluting the user's namespace ... to route them through "wrapper" functions instead. ... namespace with CreateFile. ... You bought our system, ...
    (comp.lang.c)
  • Re: Wrapper objects
    ... methods that needed wrapping, and wrapping them uppon creation of the ... wrapper object. ... This means my code is literally filled with calls to getValue(), ... I would like to be able to remove by making the comment-value pair more ...
    (comp.lang.python)
  • Re: Override existing class name with custom assembly?
    ... > They suggest sandboxing which wraps the OLE DB access code, give the wrapper ... > full trust so OLE DB works, but the wrapper doesn't require callers to have ... I was thinking about "sandboxing" the whole OleDb Namespace. ...
    (microsoft.public.dotnet.general)

Loading