What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Messenger Plus! for Live Messenger » Scripting » JScript To VB6

JScript To VB6
Author: Message:
CookieRevised
Elite Member
*****

Avatar

Posts: 15517
Reputation: 173
– / Male / Flag
Joined: Jul 2003
Status: Away
RE: JScript To VB6
quote:
Originally posted by ecion
but its both a function and a property? As I said, I was going by the example given in the thread Matty Linked to. So my DLL has the following:

Public Function ContactID() As String
ContactID = "Hello"
End Function

So i should be able to assign values to contactID right? :S
No.

ContactID(), in your VB example, is just a function without any input parameters. It can only output a string, nothing more; it isn't a property either. So all you can do in JScript with it is calling the function, you can't pass anything to it.



What you probably want is making a function which also accepts a parameter:

VB (in the public class)
code:
Public Function ContactID(inputstring As String) As String
        ContactID = "Hello " & inputstring
End Function
JScript
code:
var MyActiveXObject = new ActiveXObject('Project1.Class1');
Debug.Trace(MyActiveXObject.ContactID(Messenger.MyName));

This post was edited on 08-15-2006 at 10:58 AM by CookieRevised.
.-= A 'frrrrrrrituurrr' for Wacky =-.
08-15-2006 10:51 AM
Profile PM Find Quote Report
« Next Oldest Return to Top Next Newest »

Messages In This Thread
JScript To VB6 - by ecion on 08-14-2006 at 07:34 PM
RE: JScript To VB6 - by RaceProUK on 08-14-2006 at 08:20 PM
RE: JScript To VB6 - by matty on 08-14-2006 at 08:50 PM
RE: JScript To VB6 - by ecion on 08-15-2006 at 10:14 AM
RE: JScript To VB6 - by RaceProUK on 08-15-2006 at 10:30 AM
RE: JScript To VB6 - by ecion on 08-15-2006 at 10:40 AM
RE: JScript To VB6 - by CookieRevised on 08-15-2006 at 10:51 AM
RE: JScript To VB6 - by ecion on 08-15-2006 at 12:07 PM
RE: JScript To VB6 - by ShawnZ on 08-15-2006 at 05:35 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