Take the 2-minute tour ×

I am getting the following error:

error C2664: 'CSchemaString::CSchemaString(LPCTSTR)' : cannot convert parameter 1 from 'int' to 'LPCTSTR'

for the following code:

    CSchemaString temp(i); // LINE AT WHICH ERROR OCCURS
    XComponent = ((Component *)tComponent.GetAt(i))->GetXMLCode(FOR_SAVING);               //AddName(*/temp +":"+*/ ((Component *)tComponent.GetAt(i))->GetName());



share|improve this question
What is the type of XComponent? On which line do you get the error? What's the prototype of XSave::AddPlant_Item? –  Andrea Bergia Aug 20 '12 at 14:26
Just a guess, but does the CSchemaString ctor expect a char* or some other kind of string? You give it i, which I'm guessing is some kind of int. –  BoBTFish Aug 20 '12 at 14:28
add comment

closed as too localized by Robert Harvey Aug 20 '12 at 18:29


1 Answer

You seem to be trying to create temp as a CSchemaString passing i (which appears to be an int) as the parameter. If I've got it correct, possible constructors for this class are:

CSchemaString ()
CSchemaString (const tstring sValue)
CSchemaString (const TCHAR *szValue)
CSchemaString (const double nValue)
CSchemaString (const CSchemaType &rOther)

Depending on what you're doing, maybe you need to convert i to a string or double to meet with the CSchemaString constructor signature?

share|improve this answer
add comment
