The MASM Forum

Specialised Projects => Compiler Based Assembler => Assembler With Microsoft Visual C => Topic started by: daydreamer on August 29, 2021, 01:58:42 AM

Title: vc any way to make macros similar to masm?
Post by: daydreamer on August 29, 2021, 01:58:42 AM
well its easy to make macros in masm,because I am experienced
but I am less experienced in VC++ way of making macros
which I wish for,to shorten often used almost same api calls?
SendMessage several things becomes very long to write
Title: Re: vc any way to make macros similar to masm?
Post by: LiaoMi on August 31, 2021, 07:59:04 AM
well its easy to make macros in masm,because I am experienced
but I am less experienced in VC++ way of making macros
which I wish for,to shorten often used almost same api calls?
SendMessage several things becomes very long to write

Hi daydreamer,

C++ macro operations are not popular, all the rest is replaced by the templates. There is one interesting meta add-on over the C preprocessor:

https://github.com/Hirrolot/metalang99
Metalang99 is a functional language aimed at full-blown C99 preprocessor metaprogramming.
It features a wide range of concepts, including algebraic data types, control flow operators, collections, recursion, and auto-currying -- to develop both small and complex metaprograms painlessly.
Title: Re: vc any way to make macros similar to masm?
Post by: TimoVJL on August 31, 2021, 03:34:27 PM
SendMessage several things becomes very long to write
commctrl.h
Code: [Select]
#define TreeView_GetItemPartRect(hwnd,hitem,prc,partid) do { TVGETITEMPARTRECTINFO info; info.hti = (hitem); info.prc = (prc); info.partID = (partid); (BOOL)SNDMSG((hwnd),TVM_GETITEMPARTRECT,0,(LPARAM)&info); } while (0)
Title: Re: vc any way to make macros similar to masm?
Post by: daydreamer on August 31, 2021, 11:15:20 PM
thanks LiaoMi :thumbsup:
thanks:thumbsup:TimoVJL :thumbsup: