|  Plugin Help Requested | 
| Author: | 
Message: | 
michael_m91 
Full Member 
   
  
 
Posts: 371 Reputation: 1 
34 /   / – 
Joined: Jan 2004 
 | 
| 
O.P.  Plugin Help Requested
 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 
 This post was edited on 08-05-2005 at 05:49 AM by michael_m91.
 |   
 | 
| 08-05-2005 05:45 AM | 
 | 
  | 
matty 
Scripting Guru 
     
  
 
Posts: 8327 Reputation: 109 
40 /   /   
Joined: Dec 2002
 
Status: Away
 
 | 
| 
 RE: Plugin Help Requested
 '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 
 |   
 | 
| 08-05-2005 06:03 AM | 
 | 
  | 
RaceProUK 
Elite Member 
     
  
  
 
Posts: 6070 Reputation: 57 
40 /   /   
Joined: Oct 2003 
 | 
 | 
| 08-05-2005 11:11 AM | 
 | 
  | 
michael_m91 
Full Member 
   
  
 
Posts: 371 Reputation: 1 
34 /   / – 
Joined: Jan 2004 
 | 
O.P.  RE: RE: Plugin Help Requested
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.  
 This post was edited on 08-05-2005 at 01:28 PM by michael_m91.
 |   
 | 
| 08-05-2005 01:22 PM | 
 | 
  | 
RaceProUK 
Elite Member 
     
  
  
 
Posts: 6070 Reputation: 57 
40 /   /   
Joined: Oct 2003 
 | 
 RE: Plugin Help Requested
Don't use MessengerAPI as a variable name, use MSNAPI instead. 
code: Public WithEvents MSNAPI As MessengerAPI.Messenger
   
 |   
 | 
| 08-05-2005 02:11 PM | 
 | 
  | 
matty 
Scripting Guru 
     
  
 
Posts: 8327 Reputation: 109 
40 /   /   
Joined: Dec 2002
 
Status: Away
 
 | 
 RE: Plugin Help Requested
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
   
 |   
 | 
| 08-05-2005 08:28 PM | 
 | 
  | 
RaceProUK 
Elite Member 
     
  
  
 
Posts: 6070 Reputation: 57 
40 /   /   
Joined: Oct 2003 
 | 
 RE: Plugin Help Requested
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
  
   
 This post was edited on 08-05-2005 at 08:47 PM by RaceProUK.
 |   
 | 
| 08-05-2005 08:46 PM | 
 | 
  | 
michael_m91 
Full Member 
   
  
 
Posts: 371 Reputation: 1 
34 /   / – 
Joined: Jan 2004 
 | 
O.P.  RE: Plugin Help Requested
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  
 
  Attachment: Stuff.zip (1.55 KB) 
This file has been downloaded 192 time(s). 
 |   
 | 
| 08-05-2005 11:31 PM | 
 | 
  | 
matty 
Scripting Guru 
     
  
 
Posts: 8327 Reputation: 109 
40 /   /   
Joined: Dec 2002
 
Status: Away
 
 | 
 RE: RE: Plugin Help Requested
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.  
 
  Attachment: MPPluginVB.zip (11.88 KB) 
This file has been downloaded 194 time(s). 
 |   
 | 
| 08-06-2005 04:32 AM | 
 | 
  | 
michael_m91 
Full Member 
   
  
 
Posts: 371 Reputation: 1 
34 /   / – 
Joined: Jan 2004 
 | 
| 
O.P.  RE: Plugin Help Requested
 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 
 |   
 | 
| 08-06-2005 04:58 AM | 
 | 
  | 
| 
Pages: (2): 
« First
  
 [ 1 ]
 2
 
»
 
Last »
 | 
| 
 |