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

  • Home
  • SEARCH
  • 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 7194503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:23:07+00:00 2026-05-28T20:23:07+00:00

-getcwd does not return it at least when debugging with VS 2010. -i have

  • 0

-getcwd does not return it at least when debugging with VS 2010.

-i have no access to main’s arguments because of the user interface kit i’m using

so is there anything to do?

PS. please note the restrictions before tagging this as duplicate

  • 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-05-28T20:23:08+00:00Added an answer on May 28, 2026 at 8:23 pm

    Use GetModuleFileName() and pass NULL as the first argument:

    DWORD last_error;
    DWORD result;
    DWORD path_size = 1024;
    char* path      = malloc(1024);
    
    for (;;)
    {
        memset(path, 0, path_size);
        result     = GetModuleFileName(0, path, path_size - 1);
        last_error = GetLastError();
    
        if (0 == result)
        {
            free(path);
            path = 0;
            break;
        }
        else if (result == path_size - 1)
        {
            free(path);
            /* May need to also check for ERROR_SUCCESS here if XP/2K */
            if (ERROR_INSUFFICIENT_BUFFER != last_error)
            {
                path = 0;
                break;
            }
            path_size = path_size * 2;
            path = malloc(path_size);
        }
        else
        {
            break;
        }
    }
    
    if (!path)
    {
        fprintf(stderr, "Failure: %d\n", last_error);
    }
    else
    {
        printf("path=%s\n", path);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm not familiar with this programming language,in PHP it's getcwd() .
for this, import os.path def f(data_file_path=os.path.join(os.getcwd(),'temp'),type): ... return data I get this, SyntaxError: non-default
imagemagick convert does not work through php shell_exec but does through a shell. In
I need a cross-platform way to get the current working directory (yes, getcwd does
I have a function that resembles the one below. I'm not sure how to
In PHP what is the difference between getcwd() dirname(__FILE__) They both return the same
I have a python-based daemon that provides a REST-like interface over HTTP to some
I have the following script: import os import stat curDir = os.getcwd()+'/test' for (paths,
Hello! I have the following script: import os import stat curDir = os.getcwd() autorun_signature
I have the following: my @path = split( /, getcwd ); my $grandParent =

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.