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

daydreamer

  • Member
  • *****
  • Posts: 1721
  • building nextdoor
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
SIMD fan and macro fan
why assembly is fastest is because its switch has no (brakes) breaks
:P
only in 16bit assembly you can get away with "Only words" :P

LiaoMi

  • Member
  • ****
  • Posts: 922
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: 725
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: 1721
  • building nextdoor
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:
SIMD fan and macro fan
why assembly is fastest is because its switch has no (brakes) breaks
:P
only in 16bit assembly you can get away with "Only words" :P