C Help!
Ok, I'm trying to write a tool for my company. I graduated from college a few years back, and unfortunately the job market for programmers in Oregon was almost nil, so I started getting some tech support jobs.
Well I'm currently working for a good company as tech support and I'm trying to show my programming skills by creating some tools I can submit and hopefully start edging over into the dev teams.
Anyway, sorry for the life story here.
I developed this quick and easy tool that was modifying registry entries in c# because of some functionality they took out of the software but was still pretty vital for our program. Unfortunately because of the .net framework requirements they aren't accepting the tool.
So I'm re-writting the tool in c++, and I'm going back over one of my old GUI programs I made in college (a very simple chess game), and I'm noticing that winmain is using the following items
HINSTANCE hInstance
HINSTANCE hPrevInstance,
PSTR lpszCmdParam,
int nCmdShow
not that the object names are a big deal, these are obviously the items required to do the message pump in c based windows, but one of the requirements my tools team wants is a command line arguments to not load the GUI interface
so if I call program.exe /?
it will return information without loading the GUI.
Now here is the conundrum. My programs that are command line driven all have the int argc's and char* argv[] of course this is directly the number of commands and their text portions.
So the problem I see here is that since I'm trying to make a GUI and a command line program (so it can be ran silently on servers remotely) I was under the impression you couldn't overload main, so I'm just wondering if there is a way I can create something that can do both of those?
Any ideas, suggestions would be greatly appreciated
|