• Welcome to Valhalla Legends Archive.
 

BCP hooks

Started by UserLoser., November 05, 2003, 05:15 PM

Previous topic - Next topic

UserLoser.

QuoteIn addition, if you wish to install one of the provided hooks, you should set the corresponding function pointer (and, optionally, the 32-bit parameter associated with it) in the structure to the address of your hook function.

Bleh, well it's getting me mad >:(

I've tried a lot of times, and can't get this to work.  currently, i want to implement message and command hooks to my client. (DisableAwayIdle & WildcardSquelch, one uses command, other uses messagehook)

I've tried:

       .CommandHook = 1
       .CommandHookParam = AddrFunction(AddressOf PCommandHook)


No worky,

       .CommandHook = AddrFunction(AddressOf PCommandHook) ' "set the corresponding function pointer " - ?
       .CommandHookParam = 1 ' let it know it's enabled?


No work either, also tried whatever other combonations there are, even leaving one of them out.  I believe my function for it is OK:


Public Function PCommandHook&(ByVal Message&, ByVal SendingUser&, ByVal FromTelnet As Boolean, ByVal lParam&)
   rtbAdd vbRed, "CommandHook is doing something~"
   PCommandHook& = 1
End Function


Yes, this is under PluginInterface1. Any help is appreciated

Also, if i'm wrong on anything, please tell me...

Skywing

CommandHook is something registered by a plugin.  You should use BCEL!CallPluginCommandNotifications to notify plugins of a command event.

UserLoser.

Well then i misunderstood.  But what would be causing this to happen when doing /xw Hmm*?

Quote
[17:59:07] Warning: Exception caught in plugin "...\WildcardSquelch.bcp" command hook, unloading plugin!
(Changed real path to ...)

All messages in my send textbox are processed through
CallPluginCommandNotifications(Message, vbNullString, 0)

In this case, the message would be "xw Hmm*", vbNullString is "", and 0 because it's not from Telnet