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 8789957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:32:08+00:00 2026-06-13T22:32:08+00:00

I’m writing an application hat will use the same form defaults on most of

  • 0

I’m writing an application hat will use the same form defaults on most of the forms, so i decided to macro the WNDClASSEX and call it when needed:

#pragma once

#ifndef WNDCLASSEX_H
#define WNDCLASSEX_H

#include <windows.h>

//MAIN FORM / LOADER WNDCLASSEX
#define MainLoaderWnd(Size, WindowsProcess, hInstance, Title)\
{\
    return new WNDCLASSEX{\
    size,\
    CS_DBLCLKS,\
    WindowsProcess,\
    0,\
    0,\
    hInstance,\
    LoadIcon(NULL, IDI_APPLICATION),\
    LoadCursor(NULL, IDC_ARROW),\
    (HBRUSH)(COLOR_WINDOW),\
    NULL,\
    L(Title),\
    LoadIcon(NULL, IDI_APPLICATION)\
};\
}

#endif

however, when i add this into the file “loader.cpp”, i get the following:

WNDCLASSEX wcex = MainLoaderWnd(sizeof(WNDCLASSEX), WndProc, hInstance, L"Your Text Here");
//Intellisense error: Expression Expected

Ideas/ can’t see why his error occurs. :/

  • 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-13T22:32:09+00:00Added an answer on June 13, 2026 at 10:32 pm

    A preprocessor macro is not a function. What the preprocessor does when it sees MainLoaderWnd being “called” in your code is to replace the “call” with the text in the macro body. This means you assignment will look like this:

    WNDCLASSEX wcex = { return new WNDCLASSEX{ ... }; }
    

    This is not a valid assignment.

    Instead you could create an inline function, which is like a proper function but the compiler (not the preprocessor) may put the generated code inline at the place of the call:

    //MAIN FORM / LOADER WNDCLASSEX
    inline PWNDCLASSEX MainLoaderWnd(size_t Size, WNDPROC WindowsProcess,
                                     HINSTANCE hInstance, LPTSTR Title)
    {
        PWNDCLASSEX cls = new WNDCLASSEX;
    
        // Set the fields
    
        return cls;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a text area in my form which accepts all possible characters from
I need a function that will clean a strings' special characters. I do NOT
I am writing an app with both english and french support. The app requests
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka

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.