C(※)C++Dllのすべてのタイプの変換の方式を引用します。
http://www.it165.net/pro/html/201207/3221.html
//
C++ DLL
002.
//extern "C" __declspec(dllexport) bool (const char* 1, unsigned char* 2)
003.
//extern "C" __declspec(dllexport) bool (const unsigned char* 1, char* 2)
004.
005.
//C# C++ DLL , ,
006.
//c++:HANDLE(void *) ---- c#:System.IntPtr
007.
//c++:Byte(unsigned char) ---- c#:System.Byte
008.
//c++:SHORT(short) ---- c#:System.Int16
009.
//c++:WORD(unsigned short) ---- c#:System.UInt16
010.
//c++:INT(int) ---- c#:System.Int16
011.
//c++:INT(int) ---- c#:System.Int32
012.
//c++:UINT(unsigned int) ---- c#:System.UInt16
013.
//c++:UINT(unsigned int) ---- c#:System.UInt32
014.
//c++:LONG(long) ---- c#:System.Int32
015.
//c++:ULONG(unsigned long) ---- c#:System.UInt32
016.
//c++:DWORD(unsigned long) ---- c#:System.UInt32
017.
//c++:DECIMAL ---- c#:System.Decimal
018.
//c++:BOOL(long) ---- c#:System.Boolean
019.
//c++:CHAR(char) ---- c#:System.Char
020.
//c++:LPSTR(char *) ---- c#:System.String
021.
//c++:LPWSTR(wchar_t *) ---- c#:System.String
022.
//c++:LPCSTR(const char *) ---- c#:System.String
023.
//c++:LPCWSTR(const wchar_t *) ---- c#:System.String
024.
//c++:PCAHR(char *) ---- c#:System.String
025.
//c++:BSTR ---- c#:System.String
026.
//c++:FLOAT(float) ---- c#:System.Single
027.
//c++:DOUBLE(double) ---- c#:System.Double
028.
//c++:VARIANT ---- c#:System.Object
029.
//c++:PBYTE(byte *) ---- c#:System.Byte[]
030.
031.
//c++:BSTR ---- c#:StringBuilder
032.
//c++:LPCTSTR ---- c#:StringBuilder
033.
//c++:LPCTSTR ---- c#:string
034.
//c++:LPTSTR ---- c#:[MarshalAs(UnmanagedType.LPTStr)] string
035.
//c++:LPTSTR ---- c#:StringBuilder
036.
//c++:LPCWSTR ---- c#:IntPtr
037.
//c++:BOOL ---- c#:bool
038.
//c++:HMODULE ---- c#:IntPtr
039.
//c++:HINSTANCE ---- c#:IntPtr
040.
//c++: ---- c#:public struct {};
041.
//c++: ** ---- c#:out //C#
042.
//c++: & ---- c#:ref
043.
//c++:WORD ---- c#:ushort
044.
//c++:DWORD ---- c#:uint
045.
//c++:DWORD ---- c#:int
046.
047.
//c++:UCHAR ---- c#:int
048.
//c++:UCHAR ---- c#:byte
049.
//c++:UCHAR* ---- c#:string
050.
//c++:UCHAR* ---- c#:IntPtr
051.
052.
//c++:GUID ---- c#:Guid
053.
//c++:Handle ---- c#:IntPtr
054.
//c++:HWND ---- c#:IntPtr
055.
//c++:DWORD ---- c#:int
056.
//c++:COLORREF ---- c#:uint
057.
058.
//c++:unsigned char ---- c#:byte
059.
//c++:unsigned char * ---- c#:ref byte
060.
//c++:unsigned char * ---- c#:[MarshalAs(UnmanagedType.LPArray)] byte[]
061.
//c++:unsigned char * ---- c#:[MarshalAs(UnmanagedType.LPArray)] Intptr
062.
063.
//c++:unsigned char & ---- c#:ref byte
064.
//c++:unsigned char ---- c#:byte
065.
//c++:unsigned short ---- c#:ushort
066.
//c++:unsigned int ---- c#:uint
067.
//c++:unsigned long ---- c#:ulong
068.
069.
//c++:char ---- c#:byte //C++ ,C#
070.
//c++:char [ ] ---- c#:MarshalAs(UnmanagedType.ByValTStr, SizeConst = )] public string ; ushort
071.
072.
//c++:char * ---- c#:string //
073.
//c++:char * ---- c#:StringBuilder//
074.
//c++:char * ---- c#:ref string
075.
//c++:char * ---- c#:string
076.
//c++:char * ---- c#:[MarshalAs(UnmanagedType.LPStr)] StringBuilder
077.
078.
//c++:char ** ---- c#:string
079.
//c++:char ** ---- c#:ref string
080.
//c++:const char * ---- c#:string
081.
//c++:char[] ---- c#:string
082.
//c++:char [ ] ---- c#:[MarshalAs(UnmanagedType.ByValTStr,SizeConst= )] public string ;
083.
084.
//c++:struct * ---- c#:ref
085.
//c++: ---- c#:
086.
087.
//c++:int ---- c#:int
088.
//c++:int ---- c#:ref int
089.
//c++:int & ---- c#:ref int
090.
//c++:int * ---- c#:ref int //C# int = 0;
091.
www.it165.net"DISPLAY: none"
>
092.
//c++:*int ---- c#:IntPtr
093.
//c++:int32 PIPTR * ---- c#:int32[]
094.
//c++:float PIPTR * ---- c#:float[]
095.
096.
097.
//c++:double** ---- c#:ref double
098.
//c++:double*[] ---- c#:ref double
099.
//c++:long ---- c#:int
100.
//c++:ulong ---- c#:int
101.
102.
//c++:UINT8 * ---- c#:ref byte //C# byte = new byte();
103.
104.
105.
//c++:handle ---- c#:IntPtr
106.
//c++:hwnd ---- c#:IntPtr
107.
108.
109.
//c++:void * ---- c#:IntPtr
110.
//c++:void * user_obj_param ---- c#:IntPtr user_obj_param
111.
//c++:void * ---- c#:([MarshalAs(UnmanagedType.AsAny)]Object
112.
113.
114.
115.
//c++:char, INT8, SBYTE, CHAR ---- c#:System.SByte
116.
//c++:short, short int, INT16, SHORT ---- c#:System.Int16
117.
//c++:int, long, long int, INT32, LONG32, BOOL , INT ---- c#:System.Int32
118.
//c++:__int64, INT64, LONGLONG ---- c#:System.Int64
119.
//c++:unsigned char, UINT8, UCHAR , BYTE ---- c#:System.Byte
120.
//c++:unsigned short, UINT16, USHORT, WORD, ATOM, WCHAR , __wchar_t ---- c#:System.UInt16
121.
//c++:unsigned, unsigned int, UINT32, ULONG32, DWORD32, ULONG, DWORD, UINT ---- c#:System.UInt32
122.
//c++:unsigned __int64, UINT64, DWORDLONG, ULONGLONG ---- c#:System.UInt64
123.
//c++:float, FLOAT ---- c#:System.Single
124.
//c++:double, long double, DOUBLE ---- c#:System.Double
125.
126.
//Win 32 Types ---- CLR Type
127.
//Struct C# Struct
128.
//CallBack ,delegate static extern int FunCallBack(string str);
129.
130.
//unsigned char** ppImage IntPtr ppImage
131.
//int& nWidth ref int nWidth
132.
//int*, int&, ref int
133.
// , ref IntPtr
134.
// c++: typedef double (*fun_type1)(double); c#:public delegate double fun_type1(double);
135.
//char* c++: char*; c#:StringBuilder;
136.
//c# : unsafe
137.
138.
//unsigned char public byte
139.
/*
140.
* typedef void (*CALLBACKFUN1W)(wchar_t*, void* pArg);
141.
* typedef void (*CALLBACKFUN1A)(char*, void* pArg);
142.
* bool BIOPRINT_SENSOR_API dllFun1(CALLBACKFUN1 pCallbackFun1, void* pArg);
143.
*
144.
* [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
145.
* public delegate void CallbackFunc1([MarshalAs(UnmanagedType.LPWStr)] StringBuilder strName, IntPtr pArg);
146.
*
147.
*
148.
*/