What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » Plug-Ins » VB6 API Question

VB6 API Question
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: VB6 API Question
Whatever you send, you must send it as a string (since sResult is defined as a string in the plugin API in VB in the ParseCommand procedure)... So convert your integers to a string and use that as the sResult variable to send back...

You could use the poor-mans method:
your integers:
I1 = 1234
I2 = -4789
I3 = 45
the string you send: "1234,-4789,45"
eg: sResult = Chr$(nCCNotify) & "smvpg" & "1234,-4789,45"

Using the ReceiveNotify procedure, sText will contain "1234,-4789,45". Thus, you interpret it again by splitting it up, using the comma as delimeter.


Or the smart advanced method:
(allows you to send/recieve _a lot_ of integers! Per character, you normally could send, you have 1 integer. Because a character is actually always 2 bytes, the same as an integer...)

your integers are the same as above,

Since an integer (or whatever) is stored as sequences of bytes in memory and strings are stored just the same way, you can interpret each integer as a wide character of a string. Because an integer consist of two bytes and a wide string character also consist of two bytes. Thus the string, using the example integers above, would consist of only 3 wide characters (=6 bytes, this in contrast to the first method where your string consists of 26 bytes): ChrW$(1234) & ChrW$(-4789) & ChrW$(45).
eg: sResult = Chr$(nCCNotify) & "smvpg" & ChrW$(1234) & ChrW$(-4789) & ChrW$(45)

Using the ReceiveNotify procedure, sText will contain ChrW$(1234) & ChrW$(-4789) & ChrW$(45). Thus, you interpret it again by getting the wide characters one by one:
Dim I as Integer
For T=1 To Len(therecievedstring)
  I = AscW(Mid$(therecievedstring, T, 1))
Next T

This post was edited on 10-08-2005 at 07:04 PM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
10-08-2005 06:48 PM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
VB6 API Question - by Heffy on 10-08-2005 at 04:29 PM
RE: VB6 API Question - by CookieRevised on 10-08-2005 at 06:48 PM
RE: VB6 API Question - by Choli on 10-08-2005 at 07:36 PM
RE: VB6 API Question - by Heffy on 10-09-2005 at 08:36 AM
RE: VB6 API Question - by Choli on 10-09-2005 at 09:25 AM
RE: RE: VB6 API Question - by Heffy on 10-09-2005 at 01:00 PM
RE: VB6 API Question - by CookieRevised on 10-09-2005 at 01:05 PM
RE: VB6 API Question - by Choli on 10-09-2005 at 06:55 PM


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