C # References all types of C + + DLLs

Source: Internet
Author: User

DLL functions in C + + are prototyped

       //extern "C" __declspec (dllexport) bool method name one (const char* change name 1, unsigned char* change name 2)   &NBS P    //extern "C" __declspec (dllexport) bool Method name two (const unsigned char* variable name 1, char* change name 2)      &NBSP ;  //c# the C + + DLL collects all of the types of conversion that may be repeated or multiple scenarios, self-test        //c++:handle (void   *)   & nbsp      ----   c#:System.IntPtr        //c++:byte (unsigned   char)    ----   c#:System.Byte        //c++:short (short)       &N Bsp      ----   c#:System.Int16        //c++:word (unsigned   short)    ----   c#:System.UInt16        //c++:int (INT)       &NBS P          ----   c#:System.Int16       //c++:int (INT)   &NBSP ;   &NBSp          ----   c#:System.Int32        //c++:uint (unsigned   int)      ----   c#:System.UInt16       //c++:uint (unsigned   i NT)      ----   c#:System.UInt32       //c++:long (LONG)     &NBSP ;          ----   c#:System.Int32        //c++:ulong ( unsigned   long)    ----   c#:System.UInt32        //c++:D Word ( unsigned   long)    ----   c#:System.UInt32        //c++:D ecimal &nbs P                ----   c#:System.Decimal       &NBS P C++:bool (long)                ----   c#:System.Boolean   & nbsp    //c++:char (Char)                ----   c#:System.Char       &N Bsp C++:LPSTR (Char   *)          ----   c#:System.String        //C++:LPWSTR (wchar_t   *)      ----   c#:System.String       & nbsp C++:LPCSTR (const   CHAR   *)  ----   c#:System.String        //c++: LPCWSTR (const   wchar_t   *)      ----   c#:System.String       &N Bsp C + +:P Cahr (char   *)  ----   c#:System.String        //C++:BSTR   &N Bsp          ----   c#:System.String        //c++:float (FLOAT)      ----   c#:System.Single        //c++:D ouble (DOUBLE)   & nbsp;----   c#:System.Double        //c++:variant          ----&NBSP ;  c#:System.Object        //c++:P byte (byte   *)  ----   c#: system.byte[]        //C++:BSTR      ----   c#:StringBuilder  & nbsp    //C++:LPCTSTR  ----   c#:StringBuilder       //C++:LPCTSTR  ----    c#:string       //C++:LPTSTR    ----   c#:[marshalas ( UNMANAGEDTYPE.LPTSTR)] string        //C++:LPTSTR input variable name    ----   c#: StringBuilder variable name        //C++:LPCWSTR  ----   c#:IntPtr        C++:bool      ----   c#:bool          //c++:hmodule  --- -   c#:intptr      &NBSp    //c++:hinstance----   c#:IntPtr        //c++: Structures    ----&NB Sp  c#:p ublic struct structure {};        //c++: Structure * * variable name  ----   C#:OUT variable name   C # in advance to declare a structure after the variable name        //c++: Structure & variable name    ----   C#:REF structure variable name   & nbsp            //c++:word      ----   c#:ushort      & nbsp C + +:D Word    ----   c#:uint       //c++:D word    ----  &NBSP ;c#:int        //c++:uchar    ----   c#:int       //C ++:uchar    ----   c#:byte       //c++:uchar*    ----   c# :string       //c++:uchar*    ----   c#:IntPtr         c++:guid      ----   c#:Guid       //c++:handle    ----  &NBS p;c#:intptr       //c++:hwnd      ----   c#:IntPtr      &NBS P C + +:D Word    ----   c#:int       //c++:colorref  ----   c#:ui nt        //c++:unsigned char    ----   c#:byte        c++:unsigned char *  ----   c#:ref byte       //c++:unsigned char *  ----& nbsp  c#:[marshalas (UnmanagedType.LPArray)] byte[]       //c++:unsigned char *  ----  &N Bsp;c#:[marshalas (UnmanagedType.LPArray)] intptr        //c++:unsigned Char &  ----    c#:ref byte       //c++:unsigned char variable name      ----   c#:byte Variable name     &nbsp  //c++:unsigned Short variable name    ----   c#:ushort variable name        //c++:unsigned in T variable name      ----   c#:uint variable name        //c++:unsigned long change name      ----   c#:ulong variable name         //c++:char   &NBS  ---- P;c#:byte variable name  //c++ a character in a word, C # a character in a two-word notation        //c++:char number of [number of]    ----& nbsp  c#:marshalas (unmanagedtype.byvaltstr, SizeConst = group size)]        public string name; ushort        //c++:char *            ----   c#:string      /import parameters        //c++:char *            ----  & nbsp;c#:stringbuilder//       //C++:CHAR * variable name      ----   c#:ref Strin G variable name       //c++:char * Input variable name  ----   c#:string input variable name        //c++:char * Output change name  ----& nbsp  c#:[marshalas (UNMANAGEDTYPE.LPSTR)] StringBuilder output variable name         //c++:char * *   & nbsp      ----   c#:string       //C++:CHAR * * Variable name    ----  &NB Sp;c#:ref string variable name        //c++:const char *      ----   c#:string  & nbsp    //c++:char[]            ----   c#:string        C++:char variable name [number of sizes]    ----   c#:[marshalas (unmanagedtype.byvaltstr,sizeconst= size)] public String variable name;        //C++:STRUCT structure name * variable name  ----   C#:REF structure name change name        //c++: Delegate variable name  ----   c#: Delegate change name         //c++:int     &NB Sp ----   c#:int       //c++:int      ----   c#:ref int      &NB Sp C++:int &    ----   c#:ref int       //c++:int *    ----&NBSP ;  c#:ref int      //c# pre-definition int variable name = 0;        //c++:* int     &NB SP,----   c#:IntPtr       //c++:int32 piptr *    ----   C#:INT32[]&N Bsp      //c++:float piptr *    ----   c#:float[]              //c++:d ouble** group name          ----   C#:REF double Group name        //c++:d ouble*[] Group name          ----   C#:REF double group name     &NBS P  //c++:long          ----   c#:int       //c++:ulong     &NBsp  ----   c#:int               //c++:uint8 *     &N Bsp ----   c#:ref byte      //c# before you need to define a byte variable name = new byte ();               //c++:handle    ----   c#:IntPtr  & nbsp    //c++:hwnd      ----   c#:IntPtr            &NB Sp          //c++:void *    ----   c#:intptr        & nbsp      //c++:void * user_obj_param    ----   C#:INTPTR user_obj_param    &nbs P  //c++:void * Image name    ----   c#:([MarshalAs (unmanagedtype.asany)]object image name                   //c++:char, INT8, SBYTE, char         &NB Sp           &nbsp        ----   c#:system.sbyte         //c++:short, short int, in T16, short                        ----   c#:system. Int16         //c++:int, long, long int, INT32, LONG32, BOOL, int        -- --   c#:system.int32         //c++:__int64, INT64, Longlong       &NBS P                      ----   c#:system.int64         //c++:unsigned Char, UINT8, UCHAR, BYTE                 &NB Sp  ----   c#:system.byte         //c++:unsigned short, UINT16, USHORT, WORD, ATOM, WCHAR, __wchar_t            ----   c#:system.uint16         //C++:unsigned, unsigned int, UINT32, ULONG32, DWORD32, ULONG, DWORD, UINT      ----   c#:system.ui Nt32         //c++:unsigned __int64, UINT64, Dwordlong, ulonglong         &N Bsp                  ----   c#:system.uint64      &NBSP ;  //c++:float, float                           &NBSP ;                                  ----    c#:system.single         //c++:d ouble, long double, double       &N Bsp                          ,         &NB Sp  ----   c#:System.Double        //win32 Types        ----& nbsp CLR Type                 //struct need to redefine a struct        in C # The callback callback must be enclosed in a delegate, delegate static extern int Funcallback (string str);        // Unsigned char** ppimage conversion IntPtr ppimage       //int& nwidth convert to ref int nwidth       //int*, Int&amp, or both ref int pairs        //Dual PIN reference types can be used with ref intptr       / /function Pin using C + +: TypeDef double (*FUN_TYPE1) (double); For C #:p ublic delegate Double  fun_type1 (double);       //char* operations C + +: char*; Apply c#:stringbuilder;       //c#: Add unsafe        //unsigned where you need to use the compass   Char to public   byte       /*         * typedef void (*CALLBACKF UN1W) (wchar_t*, void* parg);         * typedef void (*CALLBACKFUN1A) (char*, void* parg);  &N Bsp;      * bool Bioprint_sensor_api dllFun1 (CALLBACKFUN1 pCallbackFun1, void* parg);      &NBSP ;  * for          * [Unmanagedfunctionpointer (callingconvention.cdecl)]         * public delegate void CallbackFunc1 ([MarshalAs (UNMANAGEDTYPE.LPWSTR)] StringBuilder strName, IntPtr parg);         *          *          */

C # refers to all types of C + + DLLs in a conversion mode (GO)

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.