WFX-Plugin misunderstand wit TLogProc.

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
D1P
Senior Member
Senior Member
Posts: 233
Joined: 2005-02-28, 18:29 UTC
Location: Moscow
Contact:

WFX-Plugin misunderstand wit TLogProc.

Post by *D1P »

Hi all.
I can't understand one thing. I Write WFX-plugin in Borland Delphi, and it is necessary for me to show some information in TC FTP toolbar.
So, my problem is here. When i compile and run my plugin with this code (it is just sample):

Code: Select all

...
MyLogProc:TLogProc;
...
function FsInit(PluginNr:integer;pProgressProc:tProgressProc;pLogProc:tLogProc;pRequestProc:tRequestProc):integer; stdcall;
Begin
PluginNum:=PluginNr;
MyLogProc:=pLogProc;
MyLogProc (PluginNum,MSGTYPE_DETAILS,'Bla-bla-bla');
Result:=0;
end;
FTP toolbar doesn't appear. If i change this code to

Code: Select all

...
MyLogProc:TLogProc;
...
function FsInit(PluginNr:integer;pProgressProc:tProgressProc;pLogProc:tLogProc;pRequestProc:tRequestProc):integer; stdcall;
Begin
PluginNum:=PluginNr;
MyLogProc:=pLogProc;
MyLogProc (PluginNum,MSGTYPE_CONNECT,'Bla-bla-bla');
Result:=0;
end;
toolbar appears, and then all logging routine works fine. But WFX API help warns:
Do NOT call LogProc with MSGTYPE_CONNECT if your plugin does not require connect/disconnect! If you call it with MsgType==MSGTYPE_CONNECT, the function FsDisconnect will be called (if defined) when the user presses the Disconnect button.
Yeap, my plugin doesn't connect somewhere :) And i don't need to call TLogProc with MSGTYPE_CONNECT, i just want to show some info. MSGTYPE_DETAILS - it's all what i needed, but without MSGTYPE_CONNECT it doesn't work. :(
Help me to understand, where a mistake.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50475
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

The wording is a bit unclear, I agree. What I meant is the following: The connection toolbar with the log window and the disconnect button will only be shown when you call LogProc with parameter MSGTYPE_CONNECT.

This way you can still use Total Commander's logging functions, but without the log toolbar! The log will go to the log file if the user has enabled logging for ftp.

If you want to show the log, you need to send MSGTYPE_CONNECT and just ignore the Disconnect message.

You may want to make this configurable, e.g. let the user choose to get logging or not.
Author of Total Commander
https://www.ghisler.com
User avatar
D1P
Senior Member
Senior Member
Posts: 233
Joined: 2005-02-28, 18:29 UTC
Location: Moscow
Contact:

Post by *D1P »

The wording is a bit unclear, I agree. What I meant is the following: The connection toolbar with the log window and the disconnect button will only be shown when you call LogProc with parameter MSGTYPE_CONNECT.
...
If you want to show the log, you need to send MSGTYPE_CONNECT and just ignore the Disconnect message.
Well, it explains a problem, but would be nice, that the corresponding description has been added to the fwx help file.
Thanks.
Post Reply