mercredi 28 août 2019

Error C2664 'void IVerify::SetParams(void)': cannot convert argument 1 from 'std::wstring' to 'wchar_t *'

When I am calling SetParams function from the below function, it is throwing an error "cannot convert argument 1 from 'std::wstring' to 'wchar_t *'"

Can anyone please help me on this?

int main()
{

IVerify* pReader = new BCReader();
std::wstring oemPathKey;

pReader->SetParams(oemPathKey, L"read");

delete pReader;
return 0;
}


void BCReader::SetParams(wchar_t* wszParams, wchar_t* wszParamType)
{
    m_wszParamType = wszParamType;
    m_wszParams = wszParams;
}

The member variables are declared like as shown below:

class IVerify
{
private:

wchar_t* m_wszParams;
wchar_t* m_wszParamType;
};

Aucun commentaire:

Enregistrer un commentaire