473,394 Members | 1,831 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Help on .NET Assemblies

hi all.
i try to compile c++ code into a .NET assembly that would be integrated into
C#.
all my c++ types and objects are not __gc, so in the assembly they all seem
to inherit from System.ValueType; in the object browser, the members of my
c++ classes do not show, hence when i instantiate an object of that
assembly, i cant access any of its members.
can this be done at all without having my types being __gc?

also, after adding the dll as a reference, i get this error:
(i obviously did add it as a reference, etc.)

The type or namespace name 'NonManagedAssembly' could not be found (are you
missing a using directive or an assembly reference?)

thanks very much.
Nov 16 '05 #1
2 1213
__gc is for .NET types and to be visible by .NET.
Without __gc you can't expose your classes. Wrap them in __gc classes

"Gideon" <gi****@dwl.co.uk.invalid> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
hi all.
i try to compile c++ code into a .NET assembly that would be integrated into C#.
all my c++ types and objects are not __gc, so in the assembly they all seem to inherit from System.ValueType; in the object browser, the members of my
c++ classes do not show, hence when i instantiate an object of that
assembly, i cant access any of its members.
can this be done at all without having my types being __gc?

also, after adding the dll as a reference, i get this error:
(i obviously did add it as a reference, etc.)

The type or namespace name 'NonManagedAssembly' could not be found (are you missing a using directive or an assembly reference?)

thanks very much.

Nov 16 '05 #2
why not compile ur c++ code into a native dll,and use them like
[DllImport("user32.dll", EntryPoint="MessageBoxA")]
public static extern int MsgBox(int hWnd, String text, String caption,
uint type);

"Pent" <pent> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
__gc is for .NET types and to be visible by .NET.
Without __gc you can't expose your classes. Wrap them in __gc classes

"Gideon" <gi****@dwl.co.uk.invalid> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
hi all.
i try to compile c++ code into a .NET assembly that would be integrated

into
C#.
all my c++ types and objects are not __gc, so in the assembly they all

seem
to inherit from System.ValueType; in the object browser, the members of my c++ classes do not show, hence when i instantiate an object of that
assembly, i cant access any of its members.
can this be done at all without having my types being __gc?

also, after adding the dll as a reference, i get this error:
(i obviously did add it as a reference, etc.)

The type or namespace name 'NonManagedAssembly' could not be found (are

you
missing a using directive or an assembly reference?)

thanks very much.


Nov 17 '05 #3

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

Similar topics

2
by: Vincenzo Davi | last post by:
I have created a dll with several classes in C#. One of the classes references image files in the subdirectories of the bin/Release folder (basically where the dll resides). Now, I want to use...
1
by: malcolm | last post by:
Hello, We have a small team building a project that involves some 30 or so c# assembly dlls. It is a client server application with 1 exe as the starting point. The dlls and exe are sharing an...
1
by: Peter Avalos | last post by:
I am trying to configure a set of access rules for a subfolder in my project. The folder is a subfolder in the application folder and cannot read the dll file in the application's bin folder. How...
3
by: Ray Mitchell | last post by:
Hello, I currently have a .dll assembly and 2 .exe assemblies that both use the ..dll assembly. I currently have the IDE set up as 3 separate projects. I must always first build the .dll...
3
by: dln | last post by:
I'm having a rather weird problem when attempting to build my project that maybe someone could help me out with. Basically, I have a workspace containing two C# projects. The first project is a...
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...
7
by: Vinay | last post by:
Hi, I am using Excel in my VB.Net project. While deploying my application on a separate machine, I am getting the following error: File or Assembly name Interop.Excel or one of its...
2
by: Mat | last post by:
I would like to show in ABOUT BOX of my application list of assemblies( not ..NETframework assemblies,but companies assemblies) including version and path of each of them which application is...
3
by: Richard Lewis Haggard | last post by:
We are having a lot of trouble with problems relating to failures relating to 'The located assembly's manifest definition with name 'xxx' does not match the assembly reference" but none of us here...
0
by: andydawson | last post by:
Hi there, hopefully someone will be able to help me out here. I have a Bill of Material listing in the following format (example): StockCode1, StockCode2 (Sub Assembly Item), StockCode1,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
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
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...

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.