Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8257279
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T02:08:43+00:00 2026-06-08T02:08:43+00:00

I recently found some interesting macro while browsing random sources around the internet: #define

  • 0

I recently found some interesting macro while browsing random sources around the internet:

#define CWA(dll, api)                 ::api

Someone can explain me what is that macro and what else it needs to make it works ?
Here is example where its used:

CWA(user32, MessageBoxW)(NULL, L"Hello world!", NULL, MB_OK);

I think its used to tell to compiler/linker to use some specific import type for APIs or something….

Thanks in advance.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T02:08:45+00:00Added an answer on June 8, 2026 at 2:08 am

    Preprocessor language is quite easy to read. You have macro:

    #define CWA(dll, api) ::api
    

    It is used by code:

    CWA(user32, MessageBoxW)(NULL, L"Hello world!", NULL, MB_OK);
    

    So the result of preprocessing is:

    ::MessageBoxW(NULL, L"Hello world!", NULL, MB_OK);
    

    Notice that “api” is just second argument of macro, so basically macro has two arguments: first is ignored, second is name of global function (:: is prefix for calling global function, e.g. ::MyGlobalFunc).

    First argument “dll” is ignored, so it serves just as comment, in what dll the function is.

    Edit: possible reason behind it – somebody wants to clearly document calls to global functions to other DLLs. It nicely reads: “I am calling function MessageBoxW from user32.dll”.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I began studying Java Regular Expression recently and I found some really intersting task.For
I've found recently that for some types of financial calculations that the following pattern
A coworker recently showed me some code that he found online. It appears to
I recently found a interesting behaviour of g++ when compared with MSVC++ 2008. Consider
Recently, I has been working with Drools component. I found a very interesting thing.
This question is based off some really odd code I recently found in a
I recently ran across a website that had some interesting styling on a select
I recently found some problems when I tried to rename a package in a
I recently found that a query would not work on some of my records
I recently found a problem in my Compile Sources Build Phase, it was compiling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.