Solved

argv[0] For Winmain?

Posted on 1998-11-25
3
741 Views
Last Modified: 2013-12-03
Is it possible to obtain argv[0] information (program full path and name) using a win32 compiler such as Borland c++ 5?
Winmain's lpCmdParam argument does not contain this info.

Thanks.
0
Comment
Question by:1agallen
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
papirus earned 50 total points
ID: 1416344
Use Win32API Function :

GetModuleFileName()
//if you have problem getting HMODULE - use GetModuleHandle() with NULL as the first parameter
0
 
LVL 3

Expert Comment

by:BudVVeezer
ID: 1416345
If you want to get all of the arguments, you can use GetCommandLine()  This returns a string, which is the full command line, path, file and args included.

~Aaron
0
 
LVL 15

Expert Comment

by:NickRepin
ID: 1416346
The easiest way for Borland compiler is to use _argc and _argv global variables. They are fully identical main(int argc,char* argv[]). They are work for GUI and console.
0

Featured Post

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
MSDN Subscription - Azure and NFP's 3 85
How can my static class become undefined?? 8 94
What namespace do I need to import? 2 52
Visual Studio hangs on running project 6 84
This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question