Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

argv[0] For Winmain?

Posted on 1998-11-25
3
Medium Priority
?
746 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 200 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

Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

Question has a verified solution.

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

This article describes how to add a user-defined command button to the Windows 7 Explorer toolbar.  In the previous article (http://www.experts-exchange.com/A_2172.html), we saw how to put the Delete button back there where it belongs.  "Delete" is …
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
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…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…

609 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