Crash Report, opening a file from TC ButtonBar in Notepad2

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: Hacker, petermad, Stefan2, white

Post Reply
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Crash Report, opening a file from TC ButtonBar in Notepad2

Post by *Balderstrom »

After Notepad2 opened the file successfully, TC crashed.
Button
Command: %TCDATA%\GUI\TCMenu.exe
Parameters: %%TCDATA%%\GUI\ToolBars\†\EDIT.BAR
Command-line output of TC Variables:
F:\Program Files\TotalCMD>set tc
TC=F:\Program Files\TotalCMD
TCDATA=F:\Users\FOO\Application Data\_TC_
TCMC=F:\wuBIN\TCTools\TCMC.exe 50
TCmd=F:\Program Files\TotalCMD\TotalCMD.exe
TCTOOL=F:\wuBIN\TCTools
Button selected from from the "EDIT.BAR":
button1=%TCDATA%\GUI\icons\Editors.icl,6
cmd1=%AHK%\TC_QuoteSelectedArgs.ahk "MultiFileOpen2.cmd " "%AppEditText%\NotePad2\notepad2.exe"
Command-line output of AHK variables:
F:\Program Files\TotalCMD>set ahk
AHK="F:\Program Files\AutoHotKey\AutoHotkey.exe" "F:\Program Files\AutoHotKey\Scripts"
AHKDir=F:\Program Files\AutoHotKey
AHKICO=F:\Program Files\AutoHotKey\AutoHotkey_AHK1.icl
TC_QuoteSelectedArgs.ahk

Code: Select all

	#SingleInstance, Force 
	#NoEnv
SetBatchLInes, -1

ControlGetFocus, activeControl, A
if( (TC_GetCursorPosition( activeControl )) == 1 )
	fileList := ""
else
{
	ClipBoardBAK := ""
	WinWaitActive, ahk_class TTOTAL_CMD
	if( ClipBoard )
	{
		ClipBoardBAK := ClipBoard
		ClipBoard := ""
	}
	PostMessage, 0x433, 2017 ; cm_CopyFileNamesToClip
	ClipWait
	StringReplace, fileList, ClipBoard, `r`n, `"%A_Space%`", All
	fileList = "%fileList%"
	ClipBoard := ""
	if( ClipBoardBAK )
	{
		ClipBoard := ClipBoardBAK
		ClipWait
	}
	;MsgBox, 1: %1% :: 2: %2% :: fileList: %fileList%
}
Run, %comspec% /s /c ""%1%" "%2%" %fileList%",, Min
return
TCQuoteSelected.ahk is required because Total Commander doesn't quote FileNames that have ampersand "&" or brackets () or Carets ^ etc, unless the filename has a space. CMD prompt chokes on all of those characters. when the file isn't quoted.

MultiFileOpen2.cmd, Launched above:

Code: Select all

CLS
SET xProgram="%~1"
IF "%~2"=="" CALL:_OPEN_FROM_FOLDER "%CD%"&GOTO:END
:_MAIN_OLOOP
SHIFT
SET isDir=-%~a1-
SET isDir=%isDir:~1,1%
IF -%isDir%-==-d- CALL:_OPEN_FROM_FOLDER "%~1"&GOTO:_NEXT
START "" %xProgram% "%~1"
:_NEXT
IF "%~2" NEQ "" GOTO:_MAIN_OLOOP
GOTO:END

:_OPEN_FROM_FOLDER
PUSHD "%~1"
SET "EditorDefaultDIR=%CD%"
START "" %xProgram%
POPD
GOTO:EOF

:END
SET xProgram=
SET isDir=
Copy of Error:

Code: Select all

---------------------------
Total Commander 7.55a
---------------------------
Access violation at address 014DB493. Write of address 00000000.
Access violation at address 014DB493. Write of address 00000000
Windows 2000 SP4 5.0 (Build 2195)

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

Windows exception: C0000005
Stack trace:
014DB493
445874  4431E1  4447B5  445132  >414560  4446F3
414560  4431E1  445132  414560  4446F3  414560
419B7E  419CC4  6C0F31  
Raw:
4454AB  444661  414560  4454AB  445640  445543
445874  434C9B  4431E1  445401  434A3D  4447B5
445132  414560  4446F3  414560  5564A2  402E36
4431E1  445401  41623C  4447B5  445132  414560
4446F3  414560  419B7E  419CC4  419E7E  6C0F31

Press Ctrl+C to copy this report!
Continue execution?
---------------------------
Yes   No   
---------------------------
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Unfortunately the address isn't in Total Commander itself - it seems that TC receives a message for a control not belonging to it. Can you reproduce the error? Do you use any addons which add controls to TC?
Author of Total Commander
https://www.ghisler.com
User avatar
Balderstrom
Power Member
Power Member
Posts: 2148
Joined: 2005-10-11, 10:10 UTC

Post by *Balderstrom »

Twinkey possibly. Though my usage of it was more-so for the tab-color-highlights, and emphasize active file when the panel/TC isn't in foreground. I thought for the most part TwinKey modified existing GUI controls briefly as opposed to adding controls.

I imagine a lot of what it does (that I use) is possible with AHK -- but I haven't figured out the GUI aspect yet. My preliminary tests thus far have failed, so I'm missing something (or it needs underlying DLLCALL() and I'm not proficient with that yet).
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50532
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Yes, it may be TWinkey. If you can reproduce the error, please try to reproduce it also without TWinkey.
Author of Total Commander
https://www.ghisler.com
Post Reply