Link to home
Start Free TrialLog in
Avatar of makman111
makman111

asked on

c++ errors ( cannot convert parameter 2 from 'char [32]' to 'int')

I am getting the following errors in my code (from an override):

.\TotalControl.cpp(36) : error C2664: 'wsprintfW' : cannot convert parameter 1 from 'char [32]' to 'LPWSTR'
        Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast
.\TotalControl.cpp(37) : error C2664: 'HRESULT (char *,int)' : cannot convert parameter 2 from 'char [32]' to 'int'
        There is no context in which this conversion is possible

Code:

#define WIN32_LEAN_AND_MEAN

#include <windows.h>
#include <stdio.h>
#include "stdafx.h"
#include "KC0Mapper.h"
#include "VdjPlugin.h"
#include "vdjDevice.h"

// Mapper class
class KC0DefaultMapper : public IVdjPluginDevice
{
      public:
      KC0DefaultMapper();

      HRESULT __stdcall GetDeviceType(int *type);
      HRESULT __stdcall OnGetPluginInfo(TVdjPluginInfo *infos);
      HRESULT __stdcall OnSlider(int chan,int slider,int absvalue,int relvalue);

};

// Set device type
HRESULT KC0DefaultMapper::GetDeviceType(int *type)
{
      *type = PLUGINDEVICE_TOTALCONTROL;
      return(PLUGINDEVICE_TOTALCONTROL);
}

HRESULT KC0DefaultMapper::OnSlider(int chan,int slider,int absvalue,int relvalue)
{
      char cmd[32];

      switch(slider)
      {
            case KC0_SLID_CROSSFADER:
            wsprintf(cmd,"video_crossfade %d",absvalue);
            SendCommand(chan,cmd);
            break;
      }
}

// Return information about plugin
HRESULT KC0DefaultMapper::OnGetPluginInfo(TVdjPluginInfo *infos)
{
      static char st[128];

      infos->PluginName = ".";
      infos->Author = ".";
      infos->Description = ".";
      infos->Flag = 0;

      infos->Bitmap = LoadBitmap(hInstance,MAKEINTRESOURCE(100));

      return S_OK;
}
ASKER CERTIFIED SOLUTION
Avatar of jimstar
jimstar

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of makman111
makman111

ASKER

Use Multi-Byte Character Set?
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Can you look at (below) as well?  I think you are correct, but the errors below are preventing me from seeing to total solution.

https://www.experts-exchange.com/questions/22880391/DllGetClassObject-Errors-during-compile.html