Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
t.__m_onclick (Cannot make exe. Error 4, failed to compile.)
#1
im not sure why im getting this i put the whole system folder in my exe's folder and i still get this error


qm out:
Code:
Copy      Help
Warning in TrayWndProc: What is used with mac (t.__m_onclick)? Make sure that the function is added to exe. To add explicitly, use #exe.
Warning in TrayWndProc: What is used with mac (t.__m_onrclick)? Make sure that the function is added to exe. To add explicitly, use #exe.
Error in TEST_TTY:  must be function.
Cannot make exe. Error 4, failed to compile.
#2
Don't move System anywhere. Also don't move functions from System.

When AddTrayIcon is used in exe, onclick and onrclick must be functions.

The warning should not be displayed. In QM 2.2.0 it is not displayed. If it is, use #exe to add these functions to exe.

Example
Code:
Copy      Help
;/exe
#exe addfunction "Function44"
#exe addfunction "Function49"

AddTrayIcon "" "" "Function44" "Function49"
10
#3
im not sure how to make onclick and onrclick functions.

how do i make mac (t.__m_onrclick) into a function ?

TrayWndProc:
Code:
Copy      Help
;/
function# hWnd message wParam lParam

Tray& t

sel message
,case WM_USER+101
,&t=+wParam
,int mod=GetMod
,if(t.__m_func) call t.__m_func wParam lParam
,else if(lParam=WM_LBUTTONUP and mod=2) shutdown -7
,sel lParam
,,case WM_LBUTTONUP if(t.__m_onclick.len and !mod) mac t.__m_onclick; err
,,case WM_RBUTTONUP if(t.__m_onrclick.len and !mod) mac t.__m_onrclick; err
,ret
,
,case else
,if(message=__newtaskbar)
,,&t=+GetWindowLong(hWnd GWL_USERDATA)
,,if(&t) t.AddIcon("" "" 8)

ret DefWindowProc(hWnd message wParam lParam)






code im compiling
----------------------------------------------------------------------------------
Code:
Copy      Help
Tray t.AddIcon("" "tray icon" 0 &TEST_TTRY)

TEST_TTRY:
Code:
Copy      Help
;/
function Tray&tray msg

sel msg
,case WM_LBUTTONUP
,sel GetMod
,,case 0
,,,mac "TEST_2" ;;THIS RUNS A "shutdown -1"
,;;
,case WM_RBUTTONUP
,sel GetMod
,,case 0
,,mac "TEST_1" ;; THIS IS A MENU
----------------------------------------------------------------------------------
#4
For me the code works well. What is your QM version?

For testing, I created TEST_TTRY function, TEST_1 function, and TEST_2 function, and this macro:
Code:
Copy      Help
;/exe
Tray t.AddIcon("" "tray icon" 0 &TEST_TTRY)
10

;BEGIN PROJECT
;main_function  Macro518
;exe_file  $my qm$\Macro518.exe
;icon  $qm$\macro.ico
;manifest  $qm$\default.exe.manifest
;res  
;on_before  
;on_after  
;on_run  
;flags  6
;end_hotkey  0
;guid  {0BF25657-F4EC-4A39-9758-06C8160D1998}
;END PROJECT

onclick and onrclicks functions don't have any special requirements. With AddIcon, use their names in quotes.
#5
Version 2.2.0.11
#6
THIS IS MY FUNCTION

Code:
Copy      Help
;/exe

Tray t.AddIcon("" "Desktop Slideshow" 0 &TEST_TRAY)
mac "TEST_23"
rep 99999999
,999999999999999999

;BEGIN PROJECT
;main_function  test_try
;exe_file  $desktop$\tester.exe
;icon  $qm$\macro.ico
;manifest  $qm$\default.exe.manifest
;res  
;on_before  
;on_after  
;on_run  
;flags  6
;end_hotkey  0
;guid  {C5BE35B6-2C40-4CA3-8EB5-72A2E0A27151}
;END PROJECT
#7
Something wrong with your System folder, because in QM 2.2.0 TrayWndProc code is different.

If your System folder is without S in the folder icon, delete it, check 'Always Add System' in Options/Files, and restart QM. Also, try the 'Check extensions' button in Options/General.


Forum Jump:


Users browsing this thread: 1 Guest(s)