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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:15:07+00:00 2026-06-16T02:15:07+00:00

I have a new main function that I asked the linker to point to

  • 0

I have a new main function that I asked the linker to point to in the Visual Studio.

I can correctly execute this function. However the command line arguments that I am getting is not correct.

Currently this is my signature

int NewMain(int argc, const char* argv[])
    {
    cout << "New Main" << endl;
    for (int i = 0; i < argc; ++i)
        {
        cout << argv[i] << "\n";
        }
    return 0;
    }

However when I use the same function with the standard main, I am getting all the arguments.

  • 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-16T02:15:08+00:00Added an answer on June 16, 2026 at 2:15 am

    When you specify an entry point to the linker, the function that gets called is not passed any arguments. Its signature is int entrypoint(void);

    If you want the command line, you can retrieve it with GetCommandLine. If you want to parse that into arguments, you can either do so on your own, or use CommandLineToArgvW — but note that this is only available in a wide-character version, so if you want a standard command line (using chars, not wchar_ts) you have to do that on your own.

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

Sidebar

Related Questions

I have a main wpf form that opens a new form. However when that
I have this code : void Main() { System.Timers.Timer t = new System.Timers.Timer (1000);
This is the code I have: Sub Main() Dim dts As New DataSet Dim
I know that this question has been asked loads of times, but I have
I have already asked this, but didn't get an solution that works and I
I have a program written in C++ with a main function that calls a
Not quite sure if I asked correctly, but basically I have an array that
With the dawn of ARC came a new main function template in xcode that
I have this simple java function that is listening to one IP, using sockets:
I have new problem. My code: .method public static void Main() cil managed {

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.