OS/2, eCS & ArcaOS - Technical > Programming
Compiling a PM sample with GCC (2023)
Martin Iturbide:
Hi Dave
Thanks for the feedback. This is strange, I did the changes, and it compiled fine. Now it does not want to compile, I'm not sure what I screwed up.
Also, when it runs, the exe does not shows on the "taskbar", it shows on TOP, was there some other trick to make it show there?
I found inside MOUSPLAY.DLG a reference to "DLGINCLUDE 1 "RAFAEL.H"" but not sure if it is related to some issue.
Regards
Dave Yeo:
Hi Martin, somehow in MOUSPLAY_B2 mousedll.c is 0 bytes. Once I restored it, it compiled fine, still crashed.
Dave Yeo:
Seems you changed WinQueryDlgItemShort() to WinQueryDlgItemText(), changing it back gets rid of the crash but the program still doesn't seem to work and leaves the DLL loaded. Possibly the DEF needs adjusting to use INITGLOBAL TERMGLOBAL like how it was? I'll test later.
--- Code: ------ mousplay.c.orig 2023-07-30 09:48:22.000000000 -0700
+++ mousplay.c 2023-07-30 13:19:58.000000000 -0700
@@ -7,9 +7,9 @@
/*************************************************************************/
/* Move and play related variables */
/*************************************************************************/
-extern LONG sXCoordinate; /* Make coordinates extern to share */
-extern LONG sYCoordinate; /* with the hook DLL */
-extern CHAR PlayString[]; /* DLL definition of character string */
+extern PSHORT sXCoordinate; /* Make coordinates extern to share */
+extern PSHORT sYCoordinate; /* with the hook DLL */
+extern PSZ PlayString[]; /* DLL definition of character string */
ULONG EXPENTRY MousePlayHookProc(HAB habSpy,BOOL fSkip, PQMSG pQmsg); /* 4 */
ULONG EXPENTRY KeyPlayHookProc(HAB habSpy,BOOL fSkip, PQMSG pQmsg); /* 4 */
ULONG TextLen;
@@ -70,9 +70,9 @@
/* hook */
/***********************************************************/
- if( !WinQueryDlgItemText( hwndDlg, EF_X, (LONG) &sXCoordinate, FALSE ))
+ if( !WinQueryDlgItemShort( hwndDlg, EF_X, (PSHORT)&sXCoordinate, FALSE ))
sXCoordinate=0;
- if( !WinQueryDlgItemText( hwndDlg, EF_Y, (LONG) &sYCoordinate, FALSE ))
+ if( !WinQueryDlgItemShort( hwndDlg, EF_Y, (PSHORT)&sYCoordinate, FALSE ))
sYCoordinate=0;
TextLen=WinQueryDlgItemText( hwndDlg,ID_CHARPLAY, 79, (PSZ) PlayString);
TstTID=_beginthread(PlayThread,0,STACKSIZE,0);
--- End code ---
Martin Iturbide:
Thanks Dave. I don't know how I lost mousedll.c. Now it compiles without error and warnings, but , yes, still does not work.
I changed the INITGLOBAL TERMGLOBAL on mousedll, but no improvement.
Regards
Martin Iturbide:
Hello.
I just get back to compile an extra little thing. It compiles and works.
Can you please give me a hand with this warning?
--- Quote ---gcc -Wall -Zomf -c -O2 pmstars.c -o pmstars.obj
pmstars.c: In function 'ClientWndProc':
pmstars.c:60:16: warning: variable 'my_timer' set but not used [-Wunused-but-set-variable]
60 | static ULONG my_timer; /* System (PM) number indicating unique (system) timer number
| ^~~~~~~~
--- End quote ---
Regards
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version