bool TForm4::OpenCOMPort(String Port)
{
wchar_t DeviceName[80];
bool Result;
StrPCopy(DeviceName, (Port));
ComFile = (unsigned int)CreateFile(DeviceName, GENERIC_READ | GENERIC_WRITE, 0, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
if(ComFile == INVALID_HANDLE_VALUE ) // IF THE PORT CANNOT BE OPENED, BAIL OUT->
{
Result = false ; //if( ComFile == INVALID_HANDLE_VALUE) Application->Terminate();
}
else
{
Result = true;
}
Having errors like below
[bcc32 Warning] Unit4.cpp(397): W8012 Comparing signed and unsigned values
[bcc32 Error] Unit4.cpp(397): E2034 Cannot convert 'unsigned int' to 'void *'
[bcc32 Warning] Unit4.cpp(405): W8070 Function should return a value
[bcc32 Warning] Unit4.cpp(405): W8004 'Result' is assigned a value that is never used