473,758 Members | 2,401 Online
Bytes | Software Development & Data Engineering Community
+ 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\includ e\exception"
which shows up in my assembly as a global "public sealed struct exception :
System.ValueTyp e" in Object Browser. In VB.NET client applications this
conflicts with System.Exceptio n 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 1331
Please take a look at
http://support.microsoft.com/default...b;en-us;822330

Ronald Laeremans
Visual C++ team

"Stephen Walch" <sw****@proposi on.com> wrote in message
news:eJ******** ******@TK2MSFTN GP12.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\includ e\exception"
which shows up in my assembly as a global "public sealed struct exception : System.ValueTyp e" in Object Browser. In VB.NET client applications this
conflicts with System.Exceptio n 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******** ********@TK2MSF TNGP11.phx.gbl. ..
Please take a look at
http://support.microsoft.com/default...b;en-us;822330

Ronald Laeremans
Visual C++ team

"Stephen Walch" <sw****@proposi on.com> wrote in message
news:eJ******** ******@TK2MSFTN GP12.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\includ e\exception" which shows up in my assembly as a global "public sealed struct exception :
System.ValueTyp e" in Object Browser. In VB.NET client applications this
conflicts with System.Exceptio n 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
1495
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 bytes for my key and nit vector, but when I try the reflector tool to look at the assembly this sticks out clear as daylight. My first thought was to maybe embed a bitmap into the assembly as a resource that has the bytes set as what I need then...
0
1416
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 hiding some generic implementation base classes from the type library exporter. Here is a code sample: -------------------------------------------------------
8
5443
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
1338
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 classes, enumerations, etc... Is there any way to hide these details for one particular assembly, basically I want to hide some classes from the user. Thanks in advance,
3
1897
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 FileA.cs to access the structures FileA.cs - contains all structures
6
6663
by: Microsoft | last post by:
Base class: class AssetBase { string _clli; public string CLLI { get
1
1412
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 metadata for runtime but why to do it public? is code will run correctly if i make these types private for assembly? there is no way to do so from IDE or by some compiler option but i can
6
1594
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 the ability to specify which classes could access this method. I know this doesn't exist but a declaration like:
27
2781
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: ================ module.h ================ #ifndef __MODULE_HDR_INCLUDED__
0
9299
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10076
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9908
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9885
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8744
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5332
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3402
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2702
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.