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

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top