|
It's all those smiley faces. I put those in my code, and it won't even start to compile.
------- sig starts
"I've heard some drivers saying, 'We're going too fast here...'. If you're not here to race, go the hell home - don't come here and grumble about going too fast. Why don't you tie a kerosene rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Is the lab assistant/monitor no help in this endeavor?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Why did you post all this repetitive code ?
VC6 is a very poor implimentation of C++. If you knew what you were doing, you could write code that would work in a standards compliant compiler, but otherwise, it was easy to write code that is not C++. I personally had no trouble moving from VC6, but it sounds like your own code was not standards compliant. Do you have a using namespace std, or a using std::ofstream anywhere ? Without it, ofstream is hidden within a namespace, assuming you used the standard headers.
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Is there a relatively easy way to build tooltip functionality into a CTreeCtrl?? This has got to be the most archaic of all MFC controls (including CListCtrl)!!!
Thanks!!
~Nitron.
ññòòïðïðB A start
-- modified at 15:50 Tuesday 13th December, 2005
|
|
|
|
|
|
cool, thx!
~Nitron.
ññòòïðïðB A start
|
|
|
|
|
Nitron wrote: including CListCtrl
I know how you like CListCtrl
"Success is the ability to go from one failure to another with no loss of enthusiasm." - W.Churchill
|
|
|
|
|
I have a windows program I'm developing in Visual C++ 6, and I need to be able to pass a command-line argument to the program. I'm familiar with doing this in console programs, and I've found instructions dealing with arguments in the main() or wmain() functions, but I've noticed that my program does not seem to have a main function. How is this possible? I thought all programs, visual or not, required a main function.
Kevin
|
|
|
|
|
ktaustin wrote: I'm familiar with doing this in console programs...
There is no difference between this and a GUI program. All command-line arguments follow the name of the program itself (e.g., myprogram.exe arg1 arg2 ...).
ktaustin wrote: I've noticed that my program does not seem to have a main function. How is this possible?
It's not. All programs have an "entry point" be it main() or WinMain() . The fact that you aren't seeing it does not mean it doesn't exist. Is this an MFC-based program?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Yes, this is an MFC-based program. I understand how to send arguments to the program, it's gaining access to the arguments within an MFC program that I don't understand. And by the way, you people are quick!
|
|
|
|
|
ktaustin wrote: Yes, this is an MFC-based program.
Then use CWinApp::m_lpCmdLine .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
the main may be in a library you're linking to, as in the case with MFC.
Are you using MFC?
If so you can override InitInstance in your CWinApp derived class.
CWinApp::m_lpCmdLine has the command line
the WIN32 API GetCommandLine() will also give you the command line and you can use CommandLineToArgvW() to parse it into argv stile array of strings. However, if you call that, you will need to use GetCommandLineW()
Hope this helps
-- modified at 15:27 Tuesday 13th December, 2005
|
|
|
|
|
Thank you. I had difficulty reading m_lpCmdLine, but the GetCommandLine() function is working great. Thanks for the quick help.
Kevin
|
|
|
|
|
ktaustin wrote: I have a windows program I'm developing in Visual C++ 6,
Here is Wrapper class which deal with same :-
http://www.codeproject.com/cpp/cmdlineparser.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Hello,
I'm looking for an api that will give the the path to the registered .txt editor. I want my program to display a .txt file, but i don't want to make assumptions about what text editors may or may not be on the machine my code is running on.
I'm hoping i can pass ".txt" to a function, and get the default application associated with the ".txt" extension.
Thanks!
-Ian
|
|
|
|
|
ShellExecute or ShellExecuteEx will automagically map the extension to the proper registered program
|
|
|
|
|
Thank you very much for taking the time to help me solve my problem. I really appreciate it!
-Ian
|
|
|
|
|
What you want is either FindExecutable() or AssocQueryString() .
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Thank you very much for taking the time to help me solve my problem. FindExecutable looks like it will work for my purposes. Thanks much!
-Ian
|
|
|
|
|
Ian Bowler wrote: I'm hoping i can pass ".txt" to a function, and get the default application associated with the ".txt" extension.
In Continuation with Mr. Crow.. Here is Code demonstrating use of AssocQueryString :-
Using AssocQueryString to find Executable associated with the Ext.[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Thank you very much for taking the time to help me solve my problem. I really appreciate it! I'll take a look at that example.
Thanks!
-Ian
|
|
|
|
|
I need some advice, as I am obviously missing something.
I am trying to add a desk band to my project, and all seems to be going well as far as the coding part is concerned. But how do you guys handle multiple builds and testing? You know the routine, you write some code, compile and build the dll, register it and try it out, unregister the dll, repeat. But I am having problems with the repeat part. The dll stays in use by windows, so it can not be deleted and rewritten when I do a rebuild. The only way I seem to be able to do this is by rebooting the computer.
Is there some trick that I can use to force windows to unload my dll?
I am using VC6 on W2K if that makes a difference.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
unregister the dll
start a command shell
taskkill /f /im "explorer.exe"
start explorer.exe
|
|
|
|
|
'taskkill' is not recognized...
But thanks anyway, I am able to kill explorer via task manager, and restart it via the command shell. All works great now
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" - mYkel - 21 Jun '04
"There's not enough blatant self-congratulatory backslapping in the world today..." - HumblePie - 21 Jun '05
Within you lies the power for good - Use it!
|
|
|
|
|
ah taskkill is a XP command.
|
|
|
|