flat assembler
Message board for the users of flat assembler.

Index > Windows > Openfilename problem

Author
Thread Post new topic Reply to topic
frankobach26



Joined: 10 Apr 2026
Posts: 11
Location: Kassel
frankobach26 27 Apr 2026, 16:28
Hello. I am building a little Editor. Have included yet a Menu too. But the openfilename causes Errors. I have No Idea whats correct Setup. Perhaps anybody has more experience. Thanks

Code:
IDM_FILE_OPEN  equ 40001
IDM_FILE_SAVE  equ 40002
IDM_FILE_EXIT  equ 40003

EM_SETSEL        = 0B1h
EM_REPLACESEL    = 0C2h
EM_SETBKGNDCOLOR = 0443h

; ============================================================
; OPENFILENAME Struktur (64‑bit)
; ============================================================

struct OPENFILENAME
{
  .lStructSize      dq ?
  .hwndOwner        dq ?
  .hInstance        dq ?
  .lpstrFilter      dq ?
  .lpstrCustomFilter dq ?
  .nMaxCustFilter   dq ?
  .nFilterIndex     dq ?
  .lpstrFile        dq ?
  .nMaxFile         dq ?
  .lpstrFileTitle   dq ?
  .nMaxFileTitle    dq ?
  .lpstrInitialDir  dq ?
  .lpstrTitle       dq ?
  .Flags            dq ?
  .nFileOffset      dw ?
  .nFileExtension   dw ?
  .lpstrDefExt      dq ?
  .lCustData        dq ?
  .lpfnHook         dq ?
  .lpTemplateName   dq ?
  .pvReserved       dq ?
  .dwReserved       dq ?
  .FlagsEx          dq ?
}    
Post 27 Apr 2026, 16:28
View user's profile Send private message Reply with quote
macomics



Joined: 26 Jan 2021
Posts: 1216
Location: Russia
macomics 27 Apr 2026, 16:52
If you are using the macro struct, you do not need to use curly braces, but rather close the structure using the macro ends. If you want to leave curly braces, then use the struc keyword.

ADD: To use the struct/ends macros, you need to include the INCLUDE/MACRO/STRUCT.INC file.
Post 27 Apr 2026, 16:52
View user's profile Send private message Reply with quote
Core i7



Joined: 14 Nov 2024
Posts: 160
Location: Socket on motherboard
Core i7 27 Apr 2026, 16:59
Your structure is incorrect. Look in the include comdlg64.inc:
Code:
struct OPENFILENAME
  lStructSize       dd ?,?
  hwndOwner         dq ?
  hInstance         dq ?
  lpstrFilter       dq ?
  lpstrCustomFilter dq ?
  nMaxCustFilter    dd ?     ;<------
  nFilterIndex      dd ?     ;<------
  lpstrFile         dq ?
  nMaxFile          dd ?,?
  lpstrFileTitle    dq ?
  nMaxFileTitle     dd ?,?
  lpstrInitialDir   dq ?
  lpstrTitle        dq ?
  Flags             dd ?     ;<------
  nFileOffset       dw ?
  nFileExtension    dw ?
  lpstrDefExt       dq ?
  lCustData         dd ?,?
  lpfnHook          dq ?
  lpTemplateName    dq ?
ends
    
Post 27 Apr 2026, 16:59
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2026, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.