question about System.String, CString, PCSTR, etc, etc

  • Thread starter Thread starter SteveK
  • Start date Start date
S

SteveK

Trying to wrap an unmanaged class.
Here is the function I'm trying to wrap:
bool Init(PCSTR filename, PCSTR username, PCSTR password, PCSTR working);


In my managed C++ class, I have a method like this:
bool CSUSSWrapper::Init(String* filename, String* username, String*
password, String* working)

{

CString _filename(filename);

CString _username(username);

CString _password(password);

CString _working(working);

return m_objSourceSafe.Init((PCSTR)_filename, (PCSTR)_username,
(PCSTR)_password, (PCSTR)_working);

}



Now that seems really ugly and probably not necessary. It compiles and it
works, but it's UGLY. Is there a cleaner way?

THanks,
Steve
 
Back
Top