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 1 3817
actually this doesn't work ;(
"SteveK" <as***@asdfasdfsd.com> wrote in message
news:ui**************@TK2MSFTNGP10.phx.gbl... 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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Herman |
last post by:
Hi everyone, I recently installed the Sun J2SE SDK on my machine, and
I am having trouble running the java.exe interpreter for my Java
compiled code. I remember that I had to set my environment...
|
by: Terry chan |
last post by:
Hi,
How to convert String object to MFC CString? and from CString to String?
Thanks!
chan
|
by: YinTat |
last post by:
Hi,
I learned C++ recently and I made a string class.
A code example is this:
class CString
{
public:
inline CString(const char *rhs)
{
m_size = strlen(rhs);
|
by: mirek |
last post by:
Hi,
I'm trying to import my old code to the .NET using managed wrappers.
I've read "Managed Extensions for C++ Migration Guide" document and was
trying to do what it stated in it. For example if...
|
by: Morten Overgaard |
last post by:
Hi
How do I convert a managed System::String to a CString. I need to handle
unicode characters ( Japan and Chinese ) as well as "normal" ANSI
characters.
I have tried the following
char* p...
|
by: Yifan |
last post by:
Hi
Does anybody know how to convert System::String* to char*? I searched the System::String class members and did not find any. Thanks
Yifan
|
by: Klynt |
last post by:
Project built using /CLR, but code is old and has not been converted
specifically to "managed" (__gc or __value).
Everything seemed to work great, until I got the following error.
I have a...
|
by: Tony H |
last post by:
Is there a way to read an MFC serialized class containing CStrings, ints, and
doubles using a CLR-based class? Specifically, to get CString into
System::String?
Bye the Bye, is System:: String...
|
by: Herby |
last post by:
I seem to be having a problem with System namespace.
There seem to two System namepaces when viewing through Object browser
within .NET 2005.
One global System::
Then one under <mscorlib>
Each...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: Vimpel783 |
last post by:
Hello!
Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
| | |