cm_FtpConnect bug (Total Commander dialog problem)

Please report only one bug per message!

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Bluestar
Senior Member
Senior Member
Posts: 377
Joined: 2007-06-10, 15:26 UTC
Location: Hungary
Contact:

cm_FtpConnect bug (Total Commander dialog problem)

Post by *Bluestar »

Reproduce:
(its pretty easy, just call cm_FtpConnect more than once)

For example, here's a Delphi code:

Code: Select all

procedure TForm1.FormActivate(Sender: TObject);
begin
  PostMessage(FindWindow('TTOTAL_CMD', nil), 1075, 550, 0);
  PostMessage(FindWindow('TTOTAL_CMD', nil), 1075, 550, 0);
end;
and some alternatives: C# | Visual Basic

Result:
As many opened FTP Connection windows as the command has been posted to TC. And when you try to close them, the next thing happens:

Code: Select all

---------------------------
Total Commander 7.56a
---------------------------
Access violation at address 00446B2E. Read of address 000000C0.
Access violation at address 00446B2E. Read of address 000000C0
Windows 7 SP1 6.1 (Build 7601)

Please report this error to the Author, with a description
of what you were doing when this error occurred!

Windows exception: C0000005
Stack trace:
00446B2E
443E97  443F66  443FC9  443011  444F62  444523
422CC0  6C2394  6A7206  6A6027  68D5E4  5E9BBC
5E9EA4  557987  5479B3  444F62  >422CC0  444523
422CC0  42838C  428424  6C53C9  
Raw:
4343ED  4B0112  444491  422CC0  44543A  4452DB
443011  445231  444F62  444F85  4348C2  4445E5
444F62  444F85  422CC0  444523  422CC0  4023DB
4026A4  4036AD  5F9A09  6A00DF  444491  422CC0
443E58  443E97  443F66  443F82  443FC9  4458F7
434B2B  449D78  402E36  443011  445231  4348C2
4445E5  444F62  444F85  5E1473  444523  422CC0
6998B5  6C2394  6C2260  6C0158  690064  445231
443011  4348C2  4445E5  699DDA  5C0057  5C0057
5C0057  680071  6BBBA9  6BBBD1  6C2174  6C2228

Press Ctrl+C to copy this report!
Continue execution?
---------------------------
Igen   Nem   
---------------------------
My opinion is that Total Commander shouldn't have to open a new FTP Connection window if one is already visible, instead just make it foreground.

Edit: as you might expect, the same thing happens with cm_Config (490), cm_SysInfo (506), cm_MultiRenameFiles (2400), and so on (every command which is opening modal dialog windows).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48083
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately most TC functions are not reentrant, so please do not call them multiple times.
Author of Total Commander
https://www.ghisler.com
Post Reply