What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » Altering incoming text

Altering incoming text
Author: Message:
Choli
Elite Member
*****

Avatar
Choli

Posts: 4714
Reputation: 42
43 / Male / Flag
Joined: Jan 2003
RE: Altering incoming text
quote:
Originally posted by optimism_
In both cases you will be getting a copy of the original. Presumable for c, patchou copies it into a new variable before passing it into the function or whatever. In VB it is defined as a copy
yes, plus makes a copy before calling the dll function. About VB, the ByVal in Strings is just a formalism... I bet you can change the decaration to ByVal bla as Long and you can cheat a bit with Windows APIs and modify the copy Plus makes.
quote:
Originally posted by optimism_
hence you CANNOT change the original text
(Y) not the original, of course, but yes the copy :P ;)
quote:
Originally posted by optimism_
ps, choli

Actually is a const char*
this means the compiler wont let you change it unless you cast it to (char*) and if you do a cast, it will cause a runtime error, so no, you cannot change it in c at all
(so it doent have to be copied at all actually, cos theres no write access to it)
the const keyword is only used by the compiler to not let you change it (ie make something like sText[0]=mychar; ) however the internal (read assembler) implementation of it it's the same as if you don't put const. That's why I said you can remove the const keyword and all will work the same, just that now you'd be able to modify it.

about the cast, i don't think it'll do a runtime error... Anyway, you can also make
int dummy_ptr; //assume sizeof(int)=4
dummy_ptr=(int)sText; /*that's dodgy, i know, if you don't like it you can use void* instead of int too (dodgy too)*/
and then use dummy_ptr in an API like CopyMemory (or what ever it's called)....

Sumarizing, you can modify the string plus passes as parameter to the function (and plus won't use it once your function finishes)
Messenger Plus! en espaņol:
<< http://www.msgpluslive.es/ >>
<< http://foro.msgpluslive.es/ >>
:plus4:
04-24-2004 01:55 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
Altering incoming text - by RooJ on 04-23-2004 at 02:41 PM
RE: Altering incoming text - by Choli on 04-23-2004 at 03:49 PM
RE: Altering incoming text - by eXXon on 04-23-2004 at 04:19 PM
RE: RE: Altering incoming text - by optimism_ on 04-23-2004 at 04:37 PM
RE: Altering incoming text - by Choli on 04-23-2004 at 04:44 PM
RE: Altering incoming text - by eXXon on 04-23-2004 at 04:49 PM
RE: Altering incoming text - by Choli on 04-23-2004 at 04:52 PM
RE: Altering incoming text - by optimism_ on 04-23-2004 at 04:59 PM
RE: Altering incoming text - by RooJ on 04-23-2004 at 05:14 PM
RE: Altering incoming text - by RooJ on 04-23-2004 at 11:46 PM
RE: Altering incoming text - by optimism_ on 04-23-2004 at 11:50 PM
RE: Altering incoming text - by RooJ on 04-24-2004 at 12:18 AM
RE: Altering incoming text - by optimism_ on 04-24-2004 at 12:23 AM
RE: Altering incoming text - by RooJ on 04-24-2004 at 12:38 AM
RE: Altering incoming text - by Mike on 04-24-2004 at 05:03 AM
RE: Altering incoming text - by RooJ on 04-24-2004 at 12:25 PM
RE: Altering incoming text - by optimism_ on 04-24-2004 at 12:31 PM
RE: Altering incoming text - by Choli on 04-24-2004 at 12:48 PM
RE: Altering incoming text - by optimism_ on 04-24-2004 at 12:54 PM
RE: Altering incoming text - by Mike on 04-24-2004 at 01:14 PM
RE: Altering incoming text - by RooJ on 04-24-2004 at 01:32 PM
RE: Altering incoming text - by Mike on 04-24-2004 at 01:34 PM
RE: Altering incoming text - by Choli on 04-24-2004 at 01:55 PM
RE: Altering incoming text - by RooJ on 04-24-2004 at 02:07 PM
RE: Altering incoming text - by Mike on 04-24-2004 at 02:09 PM
RE: Altering incoming text - by optimism_ on 04-24-2004 at 02:21 PM
RE: Altering incoming text - by RooJ on 04-24-2004 at 02:35 PM
RE: RE: Altering incoming text - by optimism_ on 04-24-2004 at 09:37 PM
RE: Altering incoming text - by Choli on 04-24-2004 at 02:47 PM
RE: Altering incoming text - by RooJ on 04-24-2004 at 03:04 PM
RE: Altering incoming text - by Choli on 04-24-2004 at 03:21 PM
RE: Altering incoming text - by RooJ on 04-24-2004 at 11:06 PM
RE: Altering incoming text - by optimism_ on 04-25-2004 at 03:51 PM
RE: Altering incoming text - by RooJ on 04-26-2004 at 01:09 AM


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