adding .h files to c# project 
Author Message
 adding .h files to c# project

Is it possible to include a .h file containing a struct I want to use intoa
C# project?
We need to try and use this struct as it is also used in an underlying c++
object and will be passed to our new c# object


Sat, 23 Oct 2004 16:49:05 GMT  
 adding .h files to c# project
Hello.

--
Regards

Thomas Tomiczek
THONA Consulting Ltd.
(Microsft MVP C#/.NET)


Quote:
> Is it possible to include a .h file containing a struct I want to use
intoa
> c# project?

No. Surely not. The C# compiler is not a C++ compiler.

You have to redefine the struct using C#.

Quote:
> We need to try and use this struct as it is also used in an underlying c++
> object and will be passed to our new c# object

(a) define the struct in bothe places.
or
(b) make is a managed C++ project and write the C++ struct as a __struct. As
a result you can then reference the managed C++ DLL and directly use the
struct.

I strongly recommend (b) - this way you also can directly use all the .NET
runtime from C++ which might come in handy later on  - no marshalling and a
lot of possibilities.

Regards

Thomas



Sat, 23 Oct 2004 17:12:06 GMT  
 adding .h files to c# project
No. C3 doesn't use .h files. You need redefine structs
in .cs file.


Sat, 23 Oct 2004 17:21:17 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. adding .h files to c# project

2. Adding multiple files to a project

3. Cannot add a file to my project

4. How to programatically add a file to a project

5. Q:How to add .c file to my project

6. Help: Adding a file to a project programatically

7. How can I add html file to my project?

8. .hpp files in Add Files To Project dialog

9. Adding files and folders to a project in the File View

10. Adding files and folders to a project in the file View of a Workspace

11. Adding a c# source file to a managed c++ project

12. Adding Library's to project files?

 

 
Powered by phpBB® Forum Software