Ok thanks. Now I'm having a different issue.
In debug mode the DLL program compiles without any problems, but when I try to compile in release mode it gives me errors:
Code:
1>uni_1-Wire_Programmer.cpp(2828): error C2664: 'CreateFileW' : cannot convert parameter 1 from 'char *' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>uni_1-Wire_Programmer.cpp(2837): error C2664: 'CreateEventW' : cannot convert parameter 4 from 'char [80]' to 'LPCWSTR'
1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
1>uni_1-Wire_Programmer.cpp(2839): error C2664: 'CreateEventW' : cannot convert parameter 4 from 'char [80]' to 'LPCWSTR'
The error is somewhere in here:
Code:
int OpenCOM(char *port_zstr)
{
char tempstr[80];
short fRetVal;
COMMTIMEOUTS CommTimeOuts;
DCB dcb;
// open COMM device
if ((ComID =
CreateFile( port_zstr, GENERIC_READ | GENERIC_WRITE,
0,
NULL, // no security attrs
OPEN_EXISTING,
FILE_FLAG_OVERLAPPED, // overlapped I/O
NULL )) == (HANDLE) -1 )
{
ComID = 0;
return FALSE;
}
else
{
// create events for detection of reading and write to com port
sprintf(tempstr,"COMM_READ_OVERLAPPED_EVENT_FOR_%s",port_zstr);
osRead.hEvent = CreateEvent(NULL,TRUE,FALSE,tempstr);
printf(tempstr,"COMM_WRITE_OVERLAPPED_EVENT_FOR_%s",port_zstr);
osWrite.hEvent = CreateEvent(NULL,TRUE,FALSE,tempstr);