Valhalla Legends Forums Archive | Visual Basic Programming | BCP hooks

AuthorMessageTime
UserLoser.
[quote]In 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. [/quote]

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:
[code]
.CommandHook = 1
.CommandHookParam = AddrFunction(AddressOf PCommandHook)
[/code]

No worky,
[code]
.CommandHook = AddrFunction(AddressOf PCommandHook) ' "set the corresponding function pointer " - ?
.CommandHookParam = 1 ' let it know it's enabled?
[/code]

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

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

Yes, this is under PluginInterface1. Any help is appreciated

Also, if i'm wrong on anything, please tell me...
November 5, 2003, 11:15 PM
Skywing
CommandHook is something registered by a plugin. You should use BCEL!CallPluginCommandNotifications to notify plugins of a command event.
November 5, 2003, 11:34 PM
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![/quote]
(Changed real path to ...)

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

In this case, the message would be "xw Hmm*", vbNullString is "", and 0 because it's not from Telnet
November 6, 2003, 12:03 AM

Search