1. ошибка при попытке отправить сообщение программе - [28.06.2009 - 1:32:15] Error in plugin 'hЃЂЃёЃ' (code = 1005). Plugin is disactivated.
из-за чего может возникнуть такая ошибка?
2.
Код: Выделить всё
BYTE PluginProcess(DWORD dwMessageID, BYTE * bMessage, DWORD dwMessageLength)
{
//bMessage - указатель на данные
ну и сам код:
Код: Выделить всё
Procedure OpenDebugWindow()
If OpenWindow(0, 0, 0, 470, 140, "plugin_debug", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ListViewGadget(0, 10, 10, 450, 120)
SetGadgetState(0, 9)
EndIf
EndProcedure
Structure sPluginInfo
strPluginName.s
strPluginDescription.s
strPluginVersion.s
EndStructure
Global dwPluginID.l
Prototype.b ClCommFortProcess(dwPluginID.l, dwMessageID.l, bMessage.s, dwMessageLength.l)
Prototype.l ClGetData(dwDataID.l, *bBuffer.s, dwBufferSize.l)
Global CommFortProcess.ClCommFortProcess
Global CommFortGetData.ClGetData
ProcedureDLL PluginInit(dwThisPluginID, *plinfo.sPluginInfo, *func1, *func2)
dwPluginID = dwThisPluginID
*plinfo\strPluginName.s = "test"
*plinfo\strPluginDescription.s = "Test plugin for CommFort client 4.21a"
*plinfo\strPluginVersion.s = "0.1"
CommFortProcess = func1
CommGetData = func2
OpenDebugWindow()
AddGadgetItem (0, -1, "Plugin initiated. PluginID is "+Str(dwThisPluginID)+".")
ProcedureReturn 0
EndProcedure
ProcedureDLL PluginTerminate()
AddGadgetItem (0, -1, "Plugin terminated.")
CloseWindow(0)
ProcedureReturn 0
EndProcedure
ProcedureDLL PluginProcess(dwMessageID, *bMessage, dwMessageLength)
If dwMessageID = 5
;debug
AddGadgetItem (0, -1, "bMessage = "+PeekS(*bMessage)+", adress = "+Str(*bMessage)+", length = "+Str(dwMessageLength))
aMessageToSend.s = ""
CommFortProcess(dwPluginID, 50, aMessageToSend, Len(aMessageToSend))
EndIf
;If dwMessageID = 6
;nothing
;EndIf
ProcedureReturn 0
EndProcedure
;PureBasic