473,472 Members | 2,174 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Hiding structs, etc. from my .NET assembly

I have a Managed C++ library that uses a number of unmanaged libraries and
my implementation necessarily includes a number of external C and C++ header
files (for example STL includes and third party .h files). The resulting
assembly works, but when I look at it under VS.NET's Object Browser (and
other tools) I see tons of contants and structs from the include files that
I never intended to be part of the public interface.

One particularly glaring example is the "exception" class defined in
"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\exception"
which shows up in my assembly as a global "public sealed struct exception :
System.ValueType" in Object Browser. In VB.NET client applications this
conflicts with System.Exception and breaks existing code.

Any ideas on how to prevent this (assuming that I can not edit the header
files)?

Thanks!!!! -Steve
Nov 16 '05 #1
2 1317
Please take a look at
http://support.microsoft.com/default...b;en-us;822330

Ronald Laeremans
Visual C++ team

"Stephen Walch" <sw****@proposion.com> wrote in message
news:eJ**************@TK2MSFTNGP12.phx.gbl...
I have a Managed C++ library that uses a number of unmanaged libraries and
my implementation necessarily includes a number of external C and C++ header files (for example STL includes and third party .h files). The resulting
assembly works, but when I look at it under VS.NET's Object Browser (and
other tools) I see tons of contants and structs from the include files that I never intended to be part of the public interface.

One particularly glaring example is the "exception" class defined in
"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\exception"
which shows up in my assembly as a global "public sealed struct exception : System.ValueType" in Object Browser. In VB.NET client applications this
conflicts with System.Exception and breaks existing code.

Any ideas on how to prevent this (assuming that I can not edit the header
files)?

Thanks!!!! -Steve

Nov 16 '05 #2
That worked! Thanks.

"Ronald Laeremans [MSFT]" <ro*****@online.microsoft.com> wrote in message
news:%2****************@TK2MSFTNGP11.phx.gbl...
Please take a look at
http://support.microsoft.com/default...b;en-us;822330

Ronald Laeremans
Visual C++ team

"Stephen Walch" <sw****@proposion.com> wrote in message
news:eJ**************@TK2MSFTNGP12.phx.gbl...
I have a Managed C++ library that uses a number of unmanaged libraries and my implementation necessarily includes a number of external C and C++ header
files (for example STL includes and third party .h files). The resulting assembly works, but when I look at it under VS.NET's Object Browser (and
other tools) I see tons of contants and structs from the include files

that
I never intended to be part of the public interface.

One particularly glaring example is the "exception" class defined in
"C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\exception" which shows up in my assembly as a global "public sealed struct exception :
System.ValueType" in Object Browser. In VB.NET client applications this
conflicts with System.Exception and breaks existing code.

Any ideas on how to prevent this (assuming that I can not edit the

header files)?

Thanks!!!! -Steve


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Ray Cassick \(Home\) | last post by:
Does anyone have any good ideas for hiding a DES key (byte array) from prying eyes inside of an assembly or is obfuscation the only way? Right now in my test code I am using a simple array of...
0
by: Tom Z. | last post by:
Hi All, I'm trying to make an assembly in C# to use as a COM server. I'm building as normal and ruinning regasm at the end. Everything is generally working, except that I'm having a problem...
8
by: subnet | last post by:
Excuse me for the perhaps silly question, but is the following permitted: struct mystruct { int f1; int f2; char f3; float f4; };
2
by: Sujith Manuel | last post by:
Hi all, I have one .Net assembly (*.dll) written in C#. .Net framework provides one intermediate language disassembler (ildasm.exe) through which you can see all the internal details like...
3
by: Chua Wen Ching | last post by:
Hi there, I had seen examples for classes, but i had no idea how to implement the same thing in struct. I am quite mix up! Which one is correct? Scenario: WForm.cs - the one that calls...
6
by: Microsoft | last post by:
Base class: class AssetBase { string _clli; public string CLLI { get
1
by: Fedor Buyakov | last post by:
hello all i have a specific question according hiding unmanaged (native) types in metadata for assemblies generated by c++ with managed extensions. i understand what these types are nedeed in...
6
by: Dan Holmes | last post by:
I have assembly a, b and c. Assembly b has a static method in one of its classes that i would like classes in a and c to access but no other assembly. It would be similar to internal but with...
27
by: matt | last post by:
Hello group, I'm trying to become familiar with the information hiding design rules, and I have a lot (3) of questions for all you experts. AFAIK, a generic module has 2 files: ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.