Ciao Ragazzi, allora ho implementato in Visual C++ la seguente libreria:
Code PlayerDll.h
using namespace System;
namespace PlayerDll {
public ref class CPlayerDll
{
public:
void Login(LPCTSTR lpUserName, LPCTSTR lpPassword);
};
}
nel file .cpp ho questo codice:
void PlayerDll::CPlayerDll::Login(LPCTSTR lpUserName, LPCTSTR lpPassword)
{
int returnValue = 0;
returnValue = ReturnValue(user,pwd);
if( returnValue )
{
//login OK
}
else
{
//ERRORE
}
}
}
Nella form dove la devo utilizzare devo mandare lo user e la pwd. Ma il problema sorge nel momento in cui provo a fare:
PlayerDll.CPlayerDll play = new PlayerDll.CPlayerDll();
play.Login(.................); //qui lui vuole 2 char*
Come faccio a passare questi due valori? io ho provato con String e StringBuilder ma non funziona,in compilazione mi dice:
"impossibile convertire da 'System.Text.StringBuilder' a 'char*' "
Come posso risolvere?
Grazie