Plugin Help Requested - 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: Plugin Help Requested (/showthread.php?tid=48515)
Plugin Help Requested by michael_m91 on 08-05-2005 at 05:45 AM
OK Im an ok programmer im pretty young for my age i guess to really know verymuch about programming. One of my worst areas is API and handling windows things like that.
I looked at the plugin creator thing that patchou released, i've made everything in my plugin except for one part.
How do you add code for an somthing such as:
The event that a certain contact signs in or changes status
RE: Plugin Help Requested by matty on 08-05-2005 at 06:03 AM
'This is just an example for calling the oMessenger object passed through the Initialize Function into a Variable.
'Make sure to set a reference to the MessengerAPI Type Library
Public WithEvents MessengerAPI As Object 'You can use MessengerAPI.Messenger but you must set a reference to the MessengerAPI Type Library
Public Function Initialize(ByVal nVersion As Long, ByVal sUserEmail As String, ByVal oMessenger As Object) As Boolean
Initialize = True
Set MessengerAPI = oMessenger
End Function
Private Sub MessengerAPI_OnContactStatusChange(ByVal pMContact As Object, ByVal mStatus As MessengerAPI.MISTATUS)
'Declare an Object variable to hold the IMContact
Dim IMContact As Object
'Set our variable to the the object passed through the function
Set IMContact = New pMContact
'Display a message box with the contact email and status (Note status is an integer not a string)
MsgBox "Email: " & IMContact.SigninName & vbNewLine & "Status: " & mStatus
End Sub
RE: Plugin Help Requested by RaceProUK on 08-05-2005 at 11:11 AM
However, if you're working in C++, check out my tutorial at http://www.rpsoftware.net/
RE: RE: Plugin Help Requested by michael_m91 on 08-05-2005 at 01:22 PM
quote: Originally posted by Matty
'This is just an example for calling the oMessenger object passed through the Initialize Function into a Variable.
'Make sure to set a reference to the MessengerAPI Type Library
Public WithEvents MessengerAPI As Object 'You can use MessengerAPI.Messenger but you must set a reference to the MessengerAPI Type Library
Public Function Initialize(ByVal nVersion As Long, ByVal sUserEmail As String, ByVal oMessenger As Object) As Boolean
Initialize = True
Set MessengerAPI = oMessenger
End Function
Private Sub MessengerAPI_OnContactStatusChange(ByVal pMContact As Object, ByVal mStatus As MessengerAPI.MISTATUS)
'Declare an Object variable to hold the IMContact
Dim IMContact As Object
'Set our variable to the the object passed through the function
Set IMContact = New pMContact
'Display a message box with the contact email and status (Note status is an integer not a string)
MsgBox "Email: " & IMContact.SigninName & vbNewLine & "Status: " & mStatus
End Sub
Thanks alot for all of that information, i esspecially appriciate all of those colors, wow. although i got a Compile Error, um it exspected an identifier on "Object"
Public WithEvents MessengerAPI As object
Object was highlighted as well.
RE: Plugin Help Requested by RaceProUK on 08-05-2005 at 02:11 PM
Don't use MessengerAPI as a variable name, use MSNAPI instead.
code: Public WithEvents MSNAPI As MessengerAPI.Messenger
RE: Plugin Help Requested by matty on 08-05-2005 at 08:28 PM
quote: Originally posted by raceprouk
Don't use MessengerAPI as a variable name, use MSNAPI instead.
code: Public WithEvents MSNAPI As MessengerAPI.Messenger
I forgot that when you declare the variable as Object you cannot use WithEvents. So just declare it as
code: Public MSNAPI As Object
RE: Plugin Help Requested by RaceProUK on 08-05-2005 at 08:46 PM
quote: Originally posted by michael_m91
The event that a certain contact signs in or changes status
Since he wants events, he wants quote: Originally posted by raceprouk
code: Public WithEvents MSNAPI As MessengerAPI.Messenger
RE: Plugin Help Requested by michael_m91 on 08-05-2005 at 11:31 PM
Thanks for all of the help you guys, but it just didnt work.
I included a zipped version of what i tried(minus my other work for this whole project, i kept it seperate while i was testing this)
Anyways you'll c it has all of the recources i could add to it but it loads fine it just doesnt do anything
RE: RE: Plugin Help Requested by matty on 08-06-2005 at 04:32 AM
quote: Originally posted by michael_m91
Thanks for all of the help you guys, but it just didnt work.
I included a zipped version of what i tried(minus my other work for this whole project, i kept it seperate while i was testing this)
Anyways you'll c it has all of the recources i could add to it but it loads fine it just doesnt do anything
I am not sure if what you posted was on purpose or not but the code we posted cannot go into a form it has to go into a Class Module. I attached an example of printing out the contacts status email and time their status was changed.
This should help you out.
Ignore my long variable name... I like to be descriptive lol.
RE: Plugin Help Requested by michael_m91 on 08-06-2005 at 04:58 AM
Lol anothe reason i have so many problems is because msn hates me. It will load every plugin except this on now, im trying some different ways to make it work though
RE: Plugin Help Requested by matty on 08-06-2005 at 05:07 AM
Check your PM I sent you my email so if you need further help we can do it there... no need to post usless info in the forums.
|