News:

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

Main Menu

Build information on resource control

Started by ragdog, January 11, 2014, 07:38:09 AM

Previous topic - Next topic

ragdog

Hi

I playing a little with Visual studio and have found an example it build infos  date and time at compile the project

this is define in the source
SetDlgItemText(hDlg, IDC_BUILD, "Built on "__DATE__ " at " __TIME__"");

is this possible for Masm?

dedndave

i think there is a masm32 macro that allows inline text ("inv", maybe or "rv")
or - you can define the string in the .DATA section and pass a pointer

jj2007

Plain Masm32:
   tmp$ CATSTR <chr$("Built on >, @Date, < at >, @Time, <")>
   invoke SendMessage, hEdit, WM_SETTEXT, 0, tmp$

MasmBasic:
   SetWin$ hEdit="Built on "+CrtDate$+" at "+CrtTime$
Slightly more ambitious:
   SetWin$ hEdit="Launched on "+Date$+" at "+Time$

Magnum

Quote from: ragdog on January 11, 2014, 07:38:09 AM
Hi

I playing a little with Visual studio and have found an example it build infos  date and time at compile the project

this is define in the source
SetDlgItemText(hDlg, IDC_BUILD, "Built on "__DATE__ " at " __TIME__"");

is this possible for Masm?

This works.

Andy

.data

%Date       db  " &@Date " ; Compile date
%time       db  " &@Time"
Take care,
                   Andy

Ubuntu-mate-18.04-desktop-amd64

http://www.goodnewsnetwork.org

ragdog

Thank you it works

Quotetmp$ CATSTR <chr$("Built on >, @Date, < at >, @Time, <")>
   invoke SendMessage, hEdit, WM_SETTEXT, 0, tmp$

@Date or @Time is this a macro or define in the linker oder ml?

jj2007

Quote from: ragdog on January 12, 2014, 03:35:13 AM
@Date or @Time is this a macro or define in the linker oder ml?

They are Masm/JWasm "built-in" macros (@CatStr, @code, @CodeSize, @Cpu, @CurSeg, @data, @DataSize, @Date, @Environ, @fardata, @fardata?, @FileCur, @FileName, @InStr, @Interface, @Line, @Model, @SizeStr, @stack, @SubStr, @Time, @Version, @WordSize).