I have a working code in dev-c++ where I'm transmitting from a host PC to a mobile robot using bluetooth. However, I'm getting errors when I try to integrate the working program into my Qt GUI. I'm getting this particular error:

In member function 'void Bluetooth::initialize()': error: cannot convert 'const char*' to 'const WCHAR*' for argument '1' to 'void* CreateFileW(const WCHAR*, DWORD, DWORD, _SECURITY_ATTRIBUTES*, DWORD, DWORD, void*)'

Here's my code:
bluetooth.h
Qt Code:
  1. #ifndef BLUETOOTH_H
  2. #define BLUETOOTH_H
  3.  
  4. #include <windows.h>
  5.  
  6. class Bluetooth {
  7. public:
  8. Bluetooth();
  9. ~Bluetooth();
  10.  
  11. void initialize();
  12. void transmit(int right, int left);
  13.  
  14. private:
  15. DWORD bytes_written;
  16. BOOL Status;
  17. HANDLE SerialHandle;
  18. DCB SerialConfigs;
  19. };
  20.  
  21. #endif
To copy to clipboard, switch view to plain text mode 

bluetooth.cpp
Qt Code:
  1. #include <QDebug>
  2. #include "bluetooth.h"
  3. #include "settings.h"
  4.  
  5. Bluetooth::Bluetooth() {}
  6.  
  7. Bluetooth::~Bluetooth() {}
  8.  
  9. void Bluetooth::initialize() {
  10. qDebug()<<"Initializing BlueTooth...";
  11. Status = 0;
  12. SerialHandle = CreateFile("COM5",
  13. GENERIC_WRITE,
  14. 0,
  15. NULL,
  16. OPEN_EXISTING,
  17. FILE_ATTRIBUTE_NORMAL,
  18. NULL);
  19.  
  20. if(SerialHandle==INVALID_HANDLE_VALUE) {
  21. if(GetLastError()==ERROR_FILE_NOT_FOUND) {
  22. qDebug()<<"E: Serial Port Does Not Exist!";
  23. }
  24. qDebug()<<"An Error Occured!";
  25. }
  26. ZeroMemory(&SerialConfigs, sizeof(SerialConfigs));
  27. SerialConfigs.DCBlength = sizeof(SerialConfigs);
  28. if (!GetCommState(SerialHandle, &SerialConfigs)) {
  29. qDebug()<< "Error Getting State!";
  30. }
  31. SerialConfigs.BaudRate = CBR_9600;
  32. SerialConfigs.ByteSize = 8;
  33. SerialConfigs.StopBits = ONESTOPBIT;
  34. SerialConfigs.Parity = NOPARITY;
  35.  
  36. if(!SetCommState(SerialHandle, &SerialConfigs)) {
  37. qDebug()<<"Error Setting Serial Port State!";
  38. }
  39. qDebug()<<"Initialization Done";
  40. }
  41.  
  42. void Bluetooth::transmit(int right, int left) {
  43. WriteFile(SerialHandle,
  44. &right, // Outgoing data
  45. 1, // Number of bytes to write
  46. &bytes_written, // Number of bytes written
  47. NULL);
  48. Status = WriteFile(SerialHandle,
  49. &left,
  50. 1,
  51. &bytes_written,
  52. NULL);
  53. if (Status == 0) {
  54. qDebug()<<"Error Writing";
  55. }
  56. }
To copy to clipboard, switch view to plain text mode