What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » C++ noob...lol

C++ noob...lol
Author: Message:
Nukez
New Member
*


Posts: 1
Joined: Jun 2005
O.P. C++ noob...lol
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)
06-05-2005 01:56 PM
Profile E-Mail PM Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: C++ noob...lol
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 ;)
[Image: spartaafk.png]
06-05-2005 02:56 PM
Profile PM Web Find Quote Report
Yousef
Full Member
***

Avatar
(previously known as Juzzi)

Posts: 487
Reputation: 19
35 / Male / Flag
Joined: Jul 2004
RE: C++ noob...lol
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:
Developer of BuddyFuse: Google Talk, Twitter and Hyves in Windows Live Messenger
Ex-Microsoft intern and Windows Live Developer MVP in 2007 & 2008
06-05-2005 03:23 PM
Profile E-Mail PM Web Find Quote Report
RaceProUK
Elite Member
*****

Avatar

Posts: 6073
Reputation: 57
39 / Male / Flag
Joined: Oct 2003
RE: C++ noob...lol
Which page? You haven't linked to one.
[Image: spartaafk.png]
06-05-2005 03:42 PM
Profile PM Web Find Quote Report
Yousef
Full Member
***

Avatar
(previously known as Juzzi)

Posts: 487
Reputation: 19
35 / Male / Flag
Joined: Jul 2004
RE: C++ noob...lol
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'

This post was edited on 06-05-2005 at 04:29 PM by Yousef.
Developer of BuddyFuse: Google Talk, Twitter and Hyves in Windows Live Messenger
Ex-Microsoft intern and Windows Live Developer MVP in 2007 & 2008
06-05-2005 04:28 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On