i have Problem to use SkiButton() with this HB_FUNC()
- Code: Select all Expand view RUN
- #include "FiveWin.ch"
PROCEDURE Main()
LOCAL oMain, oButton
LOCAL cSource := GetAppName()
LOCAL cPath, cFile
IF PCOUNT() > 0
SkinButtons()
ENDIF
cPath := Pathonly( cSource )
cFile := Fileonly( cSource )
DEFINE WINDOW oMain TITLE "FiveWin Skin Demo"
@ 10, 10 BUTTON oButton PROMPT "Property" SIZE 74, 42 PIXEL ;
ACTION SHOWFILEPROPERTIES( oMain:Hwnd, cPath, cFile )
ACTIVATE WINDOW oMain CENTER
RETURN
FUNCTION GetAppName()
RETURN GetModuleFileName( GetInstance() )
FUNCTION Pathonly( cFull )
LOCAL cRet := ´´
LOCAL nPosi
nPosi := RAT( ´\´, cFull )
IF nPosi > 0
cRet := SUBSTR( cFull, 1, nPosi - 1 )
ENDIF
RETURN cRet
FUNCTION Fileonly( cFull )
LOCAL cRet := ´´
LOCAL nPosi
nPosi := RAT( ´\´, cFull )
IF nPosi > 0
cRet := SUBSTR( cFull, nPosi + 1 )
ENDIF
RETURN cRet
*****************************************************************************
#pragma BEGINDUMP
#include <windows.h>
#include <commctrl.h>
#include <dbt.h>
#include <hbapi.h>
#include <hbapiitm.h>
HB_FUNC( SHOWFILEPROPERTIES )
{
#ifndef _WIN64
HWND hWnd = ( HWND ) hb_parnl( 1 );
#else
HWND hWnd = ( HWND ) hb_parnll( 1 );
#endif
SHELLEXECUTEINFO SHExecInfo;
ZeroMemory(&SHExecInfo, sizeof(SHExecInfo));
SHExecInfo.cbSize = sizeof(SHExecInfo);
SHExecInfo.fMask = SEE_MASK_INVOKEIDLIST;
SHExecInfo.lpVerb = "Properties";
SHExecInfo.lpDirectory = hb_parc(2);
SHExecInfo.lpFile = hb_parc(3);
SHExecInfo.nShow = SW_SHOW;
SHExecInfo.hwnd = hWnd;
ShellExecuteEx(&SHExecInfo);
}
#pragma ENDDUMP
run Sample and it will show you "Property" of File
run Sample again but with "any" Parameter and click Button and it will crash
Application Internal Error - C:\fwh\0\BUG\BUGSKIN.exe
Terminated at: 2023-04-15 21:10:53
Unrecoverable error 9015: Symbol item expected from hb_vmDo()
Called from REGQUERYVALUEEX(0)
Called from GETCPU(546) in .\source\function\ERRSYSW.PRG
Called from GETCPU(546) in .\source\function\ERRSYSW.PRG
Called from ERRORDIALOG(218) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(24) in .\source\function\ERRSYSW.PRG
Called from (b)ERRORSYS(24) in .\source\function\ERRSYSW.PRG
Called from FWSKINBTNPAINT(87) in .\source\internal\SKINS.PRG
Called from DBUFFERSTART(0)
Called from FWSKINBTNFOCUSED(336) in .\source\internal\SKINS.PRG
Called from WINRUN(0)
Called from TWINDOW:ACTIVATE(1114) in .\source\classes\WINDOW.PRG
Called from TWINDOW:ACTIVATE(1114) in .\source\classes\WINDOW.PRG
p.s. how are FUNCTION Pathonly() and Fileonly() called under Fivewin