Author Topic: vc any way to make macros similar to masm?  (Read 2658 times)

daydreamer

  • Member
  • *****
  • Posts: 2357
  • my kind of REAL10 Blonde
vc any way to make macros similar to masm?
« 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
my none asm creations
http://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding

LiaoMi

  • Member
  • *****
  • Posts: 1051
Re: vc any way to make macros similar to masm?
« Reply #1 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.

TimoVJL

  • Member
  • *****
  • Posts: 1291
Re: vc any way to make macros similar to masm?
« Reply #2 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)
May the source be with you

daydreamer

  • Member
  • *****
  • Posts: 2357
  • my kind of REAL10 Blonde
Re: vc any way to make macros similar to masm?
« Reply #3 on: August 31, 2021, 11:15:20 PM »
thanks LiaoMi :thumbsup:
thanks:thumbsup:TimoVJL :thumbsup:
my none asm creations
http://masm32.com/board/index.php?topic=6937.msg74303#msg74303
I am an Invoker
"An Invoker is a mage who specializes in the manipulation of raw and elemental energies."
Like SIMD coding