News:

Download Pelles C here: http://www.smorgasbordet.com/pellesc/

Main Menu

Recent posts

#71
Expert questions / Re: Adding version rc to Libra...
Last post by Vortex - November 30, 2025, 11:44:24 AM
Hi Timo,

Thanks, you are right. John's idea is nice :

QuoteI think instead I'll just add a function in the lib which will return the version # on request. int or maybe float = Get_Version(); something like that

One can even can modify the static library to update the version number, a find and replace binary data utility can do the job.
#72
Expert questions / Re: Adding version rc to Libra...
Last post by TimoVJL - November 29, 2025, 09:50:09 PM
Wasn't what wanted.
Windows file manager was a basic problem.
#73
Expert questions / Re: Adding version rc to Libra...
Last post by Vortex - November 29, 2025, 09:35:24 PM
Microsoft's Windows Resource To Object Converter cvtres.exe can convert a .res file to an .obj file.
#74
Expert questions / Re: Adding version rc to Libra...
Last post by TimoVJL - November 29, 2025, 06:35:05 PM
Use unique symbol name for getting version.
#75
Expert questions / Re: Adding version rc to Libra...
Last post by John Z - November 29, 2025, 06:04:20 PM
Thanks Timo,

Not quite what I was looking for. I was hoping to be able to right click on the .lib file and the select properties which would show a version number like it does with an .exe file.

I think instead I'll just add a function in the lib which will return the version # on request. int or maybe float = Get_Version(); something like that -

John Z


#77
Expert questions / Adding version rc to Library
Last post by John Z - November 29, 2025, 02:45:35 PM
Is it possible to add a version resource to a library?
I get an error when I try to add it to the ResizerZ.lib build.
Building Add_version.res.
*** Error:   "C:\Program Files\PellesC\Files\ResizerZ\Add_version.rc" -Fo"C:\Program Files\PellesC\Files\ResizerZ\output\Add_version.res"
*** Error: The parameter is incorrect. 
Done

I tried with the Pelle Control dialog, default version resource without any changes, also with just a rc script.

Or is there any other way to incorporate a viewable version number in a .lib?

Any help is appreciated!

John Z
#78
Assembly discussions / Re: Rich Edit sample
Last post by Vortex - November 28, 2025, 01:23:04 PM
Hi Timo,

Thanks for your version.
#79
Assembly discussions / Re: Rich Edit sample
Last post by TimoVJL - November 28, 2025, 05:18:37 AM
A dialog without any resource section in one source.
Just a one test material for poasm
;.model flat,fastcall
INCLUDELIB kernel32.lib
INCLUDELIB user32.lib

WM_DESTROY    equ 2
WM_CLOSE      equ 10h
WM_INITDIALOG equ 110h

GetModuleHandleW PROTO :QWORD
ExitProcess PROTO :QWORD
DialogBoxIndirectParamW PROTO :QWORD,:QWORD,:QWORD,:QWORD,:QWORD
EndDialog PROTO :QWORD,:QWORD
PostQuitMessage PROTO :QWORD
MessageBoxW PROTO :QWORD,:QWORD,:QWORD,:QWORD
;----------------------
DlgProc PROTO :QWORD,:DWORD,:QWORD,:QWORD
WMInitdialog PROTO :QWORD
WMDestroy    PROTO
WMClose      PROTO :QWORD

ifdef __POASM__
.drectve segment
db '/subsystem:windows '
.drectve ends
endif

.data
;align 4
DlgBox  dw  1   ; dlgVer
    dw  0FFFF   ; signature
    dd  0       ; helpID
    dd  0       ; exStyle
    dd  10CA0800h   ; style
    dw  0       ; cDlgItems
    dw  0       ; x
    dw  0       ; y
    dw  200     ; cx
    dw  100     ; cy
    dw  0       ; empty menu
    dw  0       ; empty windowClass
    ;dw "Test",0    ; title POAsm
    dw  'T','e','s','t',0   ; title

;sMsg dw  "OK to close",0
sMsg dw  'O','K',' ','t','o',' ','c','l','o','s','e',0

.code
; parameters RCX, RDX, R8 and R9
start PROC  PARMAREA=5*sizeof QWORD
    INVOKE  GetModuleHandleW,0
    mov rcx,rax
    INVOKE  DialogBoxIndirectParamW,rcx,ADDR DlgBox,0,ADDR DlgProc,0
    INVOKE  ExitProcess, rax
start ENDP

DlgProc PROC hWnd:QWORD,uMsg:DWORD,wParam:QWORD,lParam:QWORD PARMAREA=4*sizeof QWORD
    ;mov hWnd, rcx  ; ?
    mov QWORD PTR [rsp+30h],rcx
    ;mov uMsg, rdx
    mov DWORD PTR [rsp+38h],edx
    ;mov wParam, r8
    mov QWORD PTR [rsp+40h],r8
    ;mov lParam, r9
    mov QWORD PTR [rsp+48h],r9
    mov     eax,uMsg
    .if uMsg==WM_INITDIALOG
        INVOKE  WMInitdialog, hWnd
    .elseif uMsg==WM_CLOSE
        INVOKE  WMClose, hWnd
    .elseif uMsg==WM_DESTROY
        INVOKE  WMDestroy 
    .else
@@:     xor     rax,rax
    .endif
    ret
DlgProc ENDP

WMInitdialog PROC hWnd:QWORD PARMAREA=4*sizeof QWORD
    ;mov    hWnd,rcx
    ;mov     qword ptr [rsp+30h],rcx
    mov     rax,1
    ret
WMInitdialog ENDP

WMDestroy PROC
    INVOKE  PostQuitMessage,0
    mov     rax,1
    ret
WMDestroy ENDP

WMClose PROC hWnd:QWORD PARMAREA=4*sizeof QWORD
    ;mov    hWnd,rcx
    mov QWORD PTR [rsp+30h],rcx
    INVOKE  MessageBoxW,hWnd,ADDR sMsg, 0, 21h
    .if rax == 1
        ;mov rcx,hWnd
        mov rcx,QWORD PTR [rsp+30h]
        INVOKE  EndDialog,rcx,0
    .endif
    ret
WMClose ENDP

END start
#80
Assembly discussions / Re: Rich Edit sample
Last post by Vortex - November 25, 2025, 09:09:05 PM
Binary resource template version, 64-bit.