|
-
April 24th, 2006, 11:52 AM
#1
wrapping a c++ header file for use in c#
The following struct is currently implemented inside of a C++ .h (header) file. As far as I know most of the members of the struct are not C# defined types. I would like to make this struct user friendly for C#. How would I got about wrapping this struct in a dll or something and making the definition more C#-friendly?
Code:
typedef struct
{
FILETIME date;
DWORD dwRefId;
BYTE btParam[512];
CHAR szImageFileName[1];
UCHAR szSerialNum[17]; //Unit serial number.
RGBQUAD pixels[1];
RGBTRIPLE foreground;
} CMD_DATAA, *PCMD_DATAA;
-
April 25th, 2006, 07:41 AM
#2
Re: wrapping a c++ header file for use in c#
Why don't you "smash" it into pieces rather than wraping it up?
-
April 25th, 2006, 09:57 AM
#3
Re: wrapping a c++ header file for use in c#
Not sure what you are implying, but redesign is not an option. The header file is what it is. The question is how to wrap a dll around the header.
-
April 25th, 2006, 05:26 PM
#4
Re: wrapping a c++ header file for use in c#
 Originally Posted by Mollet
Why don't you "smash" it into pieces rather than wraping it up?
You may have some misunderstandings about methodologies applied. I think the OP simply wanted to use a pure wrapping method to integrate his C++ struct into C# language. Smashing or dividing objects as what you may be thinking of would hit badly application performance and memory allocation in general.
 Originally Posted by sambo
The following struct is currently implemented inside of a C++ .h (header) file. As far as I know most of the members of the struct are not C# defined types. I would like to make this struct user friendly for C#. How would I got about wrapping this struct in a dll or something and making the definition more C#-friendly?
........
Not sure what you are implying, but redesign is not an option. The header file is what it is. The question is how to wrap a dll around the header.
There is surely no need in actuality to redesigning anything. I have no idea of how to help what you are trying to accomplish. Thereotically, an interface and a generator should be what wrapping needs to be activated...
Emiene Vous
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|