I have problem then I Init the struct.
typedef struct _COMMTIMEOUTS {
DWORD ReadIntervalTimeout;
DWORD ReadTotalTimeoutMultiplier;
DWORD ReadTotalTimeoutConstant;
DWORD WriteTotalTimeoutMultiplier;
DWORD WriteTotalTimeoutConstant;
} COMMTIMEOUTS,*LPCOMMTIMEOUTS;
Need to init the parameters because I use them in SetCommTimeouts:
BOOL SetCommTimeouts(
HANDLE hFile, // handle to comm device
LPCOMMTIMEOUTS lpCommTimeouts // pointer to comm time-out structure
);
lpCommTimeouts = Pointer to a COMMTIMEOUTS structure that contains the new time-out values
I create a pointer to the struct like this in my Dlg.h file:
LPCOMMTIMEOUTS LpCommTimeouts;
In my Dlg.cpp file I try to INIT the different variabels in the struct like this:
LpCommTimeouts->ReadTotalTimeoutMultiplier = 100;
Tried different numbers!
My program fails(abort) then it does this. It don't complane then I compile the program.
Then I write to test timeout:
if (SetCommTimeouts(hCom,LpCommtimeouts) != 0)
ReadFile(hCom, cBuffer, val, &dwBytesRead, NULL);
Can anybody explane this to me??
Thanks!!
typedef struct _COMMTIMEOUTS {
DWORD ReadIntervalTimeout;
DWORD ReadTotalTimeoutMultiplier;
DWORD ReadTotalTimeoutConstant;
DWORD WriteTotalTimeoutMultiplier;
DWORD WriteTotalTimeoutConstant;
} COMMTIMEOUTS,*LPCOMMTIMEOUTS;
Need to init the parameters because I use them in SetCommTimeouts:
BOOL SetCommTimeouts(
HANDLE hFile, // handle to comm device
LPCOMMTIMEOUTS lpCommTimeouts // pointer to comm time-out structure
);
lpCommTimeouts = Pointer to a COMMTIMEOUTS structure that contains the new time-out values
I create a pointer to the struct like this in my Dlg.h file:
LPCOMMTIMEOUTS LpCommTimeouts;
In my Dlg.cpp file I try to INIT the different variabels in the struct like this:
LpCommTimeouts->ReadTotalTimeoutMultiplier = 100;
Tried different numbers!
My program fails(abort) then it does this. It don't complane then I compile the program.
Then I write to test timeout:
if (SetCommTimeouts(hCom,LpCommtimeouts) != 0)
ReadFile(hCom, cBuffer, val, &dwBytesRead, NULL);
Can anybody explane this to me??
Thanks!!