In C and C++, you have to dynamically load the DLL file, find the function(s) you want to use, and call them. A sample function to do this in Visual C++ is shown below:
typedef bool (__stdcall *CreatePairFn)(char *Port1, char *Port2);
typedef bool (__stdcall *DeletePairFn)(char *Port1);
typedef bool (__stdcall *DeleteAllFn)(void);
typedef bool (__stdcall *SetStrictBaudrateName) (char *Port, bool StrictBaudrate);
typedef bool (__stdcall *SetStrictBaudrateHandle) (HANDLE hPort, bool StrictBaudrate);
typedef bool (__stdcall *CreatePairFn)(char *Port1, char *Port2);
typedef bool (__stdcall *DeletePairFn)(char *Port1);
typedef bool (__stdcall *DeleteAllFn)(void);
typedef bool (__stdcall *SetStrictBaudrateFn)(char *Port, bool StrictBaudrate);
typedef bool (__stdcall *SetBreakFn)(char *Port, bool bBreak);
typedef bool (__stdcall *QueryBusFn)(void* InBuffer, long sizeInBuffer, void* OutBuffer, long sizeOutBuffer);
typedef bool (__stdcall *SetWiringFn)(char *Port, void *Buffer, long sizeBuffer);
Code example:
|
bool CreateVSPair(char *Port1, char *Port2) { |