News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

converting a program from windows 7 to windows 10

Started by shankle, August 26, 2020, 01:54:27 AM

Previous topic - Next topic

shankle

            8-25-2020

stats: windows 10 pro 64-bit
       GoAsm, Going from windows 7 to windows 10
.code
start:
149   invoke [GetModuleHandleA], NULL ; this is the line giving the error
150                                     with or without the square brackets
160   mov    Q[hInstance],rax

   Line 149 of assembler source file shdc61.asm.  use square brackets to
   address memory, address or offset to get address.
        Thanks for any help.

wjr

It looks like the symbol NULL has not been defined, so perhaps missing an #include file.

shankle

#2
Thank you WJR for responding.
All my programs in windows 7 were written in GoAsm, none
of which had brackets around  NULL. I enclosed NULL in
brackets and the error is gone.
I don't understand and have never read anything about
enclosing NULL in brackets.

Evidently there are a lot of changes from windows 7 to windows 10.
Here is a problem, with "wndclassexa".
Would someone be so kind as to give some book of where to read
about this problem or some code examples  Please.

WinMain:
    FRAME hInst,hPrevInst,CmdLine,CmdShow,vInst
   LOCAL wc: WNDCLASSEXA ],msg,hWnd,HWND,RR:RECT

   mov   D[wc.cbSize],SIZEOF WNDCLASSEXA
   mov   D[wc.style],CS_BYTEALIGNWINDOW | CS_HREDRAW | CS_VREDRAW
   mov   rax,offset WndProc
   mov   Q[wc.lpfnWndProc],rax
   mov   D[wc.cbClsExtra],NULL
   mov   D[wc.cbWndExtra],NULL
   push  [hInst]
   pop   [wc.hInstance]
   invoke LoadIcon,NULL,IDI_APPLICATION
   mov   Q[wc.hIcon],rax
    invoke LoadCursor,NULL,IDC_ARROW
   mov   Q[wc.hCursor],rax
   invoke CreateSolidBrush,00ffffffh      ; white background
    mov   Q[hBrush],rax
   mov   Q[wc.hbrBackground],rax
   mov   Q[wc.lpszMenuName],NULL
   mov   Q[wc.lpszClassName],offset szDisplayName
   mov   Q[wc.hIconSm],0

    invoke RegisterClassEx, addr wc

wjr

If you had a 64-bit program that you could build and run on Windows 7, then most likely it should build and run on Windows 10.

NULL should not be in square brackets. The error has just been pushed off as an external symbol that the linker is not going to find. If you have used #include windows.h, and if needed setup your INCLUDE environment string properly, then GoAsm should find the definition for NULL.

As for the "wndclassexa" problem, you do not mention the error, but there shouldn't be a ] after LOCAL wc:WNDCLASSEXA.

TouEnMasm

hello,
sorry,i have not see that you want convert your source fron goasm to goasm
[content deleted]
Fa is a musical note to play with CL