Administrator

Administrator

  • Tech Writer
  • 2.2k
  • 1.5m

Conversion Variable/Structure API Win32 in C#

Mar 18 2003 9:01 AM
I would like to use functions of APIen C #. It is necessary for that to redefinir the functions and the structures of API out of C #. Unfortunately, I cannot always which types use out of C #... For example, how to translate a DWORD or a LPVOID into C #? Did Visual Studio 6.0 offer a viewer of API to convert the functions of API into VB but there does not exist nothing like it out of C #... Somebody could you there make me a table of conversion of the types of API into C #? Thank you in advance.... Merlin Tintin To fix the idees, I put two examples: - Importation of a function the API one: [ DllImport("winmm.dll ", CharSet=CharSet.Ansi) ] private static extern int mixerClose(int hmx); - Importation of a structure: The structure of the API one: typedef struct tagMIXERLINECONTROLSA { DWORD cbStruct; size in bytes of MIXERLINECONTROLS */ DWORD dwLineID; line id (from MIXERLINE.dwLineID) */ union { DWORD dwControlID; MIXER_GETLINECONTROLSF_ONEBYID */ DWORD dwControlType; MIXER_GETLINECONTROLSF_ONEBYTYPE */}; DWORD CONTROLS; count of controls pmxctrl points to */ DWORD cbmxctrl; size in bytes of _ one _ MIXERCONTROL */LPMIXERCONTROLA pamxctrl; to point to first MIXERCONTROL array */ } MIXERLINECONTROLSA, * PMIXERLINECONTROLSA, * LPMIXERLINECONTROLSA; becomes out of C #: public public struct MIXERLINECONTROLS { int cbStruct; public int dwLineID; public int dwControl; public int CONTROLS; public int cbmxctrl; public MIXERCONTROL pamxctrl; } if you could give me the list of conversion, Ca would really arrange me (by ex: DWORD - >???, UINT - >???, ...) thank's & bye Merlin Tintin