I have reqirements of defining prototypes for C++ dll function in C# so that
I can use p/invoke method to access the dll's functions.
Can anyone please suggest how to write prototypes in C# for C++ functions
like the ones given below:
1. __declspec(dllexport) char * __stdcall GetString(int maxChars, int
waitTime, int delay = 50);
2. __declspec(dllexport) BOOL __stdcall GetControlData(DWORD commandType,
BYTE* pInBuf, DWORD inSize, BYTE *pOutBuf, DWORD outSize, LPDWORD
bytesReturned, LPOVERLAPPED pOverlapped);
3. __declspec(dllexport) DWORD * __stdcall GetStats(BOOL clear);
4. __declspec(dllexport) UNIT_TYPES* __stdcall GetUnitsInfo(void);
where UNIT_TYPES is a structure:
typedef struct
{
char *name;
int num_units;
int unit_list[10];
}UNIT_TYPES;
5. __declspec(dllexport) int __stdcall HandleCommand(CHANDLE han, int Id,
const BYTE cmd, DWORD const responseType, const int txCount=0, BYTE const *
pTxData=NULL, BYTE *pRxData=NULL, BYTE *pRxCount=NULL, DWORD retries=4, DWORD
wait_ms=0);
6. __declspec(dllexport) void __stdcall HandleGetTimeouts(CHANDLE han, DWORD
*normal, DWORD *download, DWORD *retries);
7. __declspec(dllexport) int __stdcall SendCommand(int Id, const BYTE cmd,
DWORD const responseType, const int txCount=0, BYTE const * pTxData=NULL,
BYTE *pRxData=NULL, BYTE *pRxCount=NULL, DWORD retries=4, DWORD wait_ms=0);
Regards,
Nataraj.
--
Regards,
Nataraj S. Narayana
Senior Engineer - Windows
Message posted via DotNetMonster.com
http://www.dotnetmonster.com/Uwe/For...sharp/200602/1