Shoutbox

C++ noob...lol - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Forum: Plug-Ins (/forumdisplay.php?fid=28)
+------ Thread: C++ noob...lol (/showthread.php?tid=45811)

C++ noob...lol by Nukez on 06-05-2005 at 01:56 PM

Hi,
Im new in C++ and i've tried to translate a plug-in that i made in VB.
i think that i have well translated my thing but i have a mistake remaining...
when i do this :

strcat(sTextToSend,Dir);
strcat(sTextToSend,File->FileL->Items->Strings[int(sText)]);

(FileL is and FileListBox that i'm tring to get one file name)
(I have already affected a value to sTextToSend by strcpy() )

The first strcat() don't show an error
But, the second one show me this error :
[C++ Error] MPPPluginC.cpp(202) : E2034 Cannot convert 'AnsiString' to 'const char *'

i have to do type casting... but the question is How... lol. Or may be an alternative to to the same job !

thanks in advance ,
Nukez.

(PS: i don't know if it can help you but i'm using Borland C++builder 6)


RE: C++ noob...lol by RaceProUK on 06-05-2005 at 02:56 PM

You know the difference between objects and primitive types yes?
You may want to look at a few intro books on C++.
As for your problem, look at the documentation for the FileListBox object, and see if there's a method that returns a C-style string.

Objects usually aren't C-strings ;)


RE: C++ noob...lol by Yousef on 06-05-2005 at 03:23 PM

Although I can't read it, this chinese page shows me you'll probably need to do:

code:
strcat(sTextToSend,File->FileL->Items->Strings[int(sText)])->c_str();

btw: 250th post :banana:
RE: C++ noob...lol by RaceProUK on 06-05-2005 at 03:42 PM

Which page? You haven't linked to one.


RE: C++ noob...lol by Yousef on 06-05-2005 at 04:28 PM

quote:
Originally posted by raceprouk
Which page? You haven't linked to one.
Lol, that was dumb, it's just the first result on google for 'AnsiString'