|
Ok I solved it
And as I said it was a simple one:
I accessed the MainForm with the following code:
reinterpret_cast<CMainFrame*>(GetDocument())->UpdateFunction;
But I have to use this one:
((CMainFrame*)theApp.GetMainWnd())->UpdateFunction;
I'm not a MFC expert and can not describe really what the problem was but when you try to change a view use the SwitchToView Function and acess the MainFrame like the second code post.
Perhaps it could help someone.
|
|
|
|
|
Hi,
How can you set that your dialog box's size cannot be changed anymore upon load? (cannot be maximized). I've already removed the maximize and minimize buttons but it still maximizes. Can anyone help me? I'm using mfc.
Thanks a lot.
waxie
|
|
|
|
|
Intercept the WM_SHOWWINDOW message, and only allow SW_SHOW and SW_HIDE as parameter for a base class call.
~RaGE();
|
|
|
|
|
|
I want to run 2 different exes one by one when i start my VC++ application.(1 should run, after 1 min that has to be automatically closed and 2nd exe should be run automatically). I tried shellexecute, WinExec for starting the exes automatically. But i don't find any application for terminating automatically. Please help me
|
|
|
|
|
Precise if MFC or not. Here is the MFC a solution:
Use CreateProcess to fire up the first .exe. Save the handle returned by CreateProcess . Start a timer. When the timer expires, use TerminateProcess() with the handle as paramter to kill the first app. Then start the second app.
Reply back if you need help with timers.
~RaGE();
-- modified at 11:11 Tuesday 31st January, 2006
|
|
|
|
|
I'm just curious what your suggestion has to do with MFC. Those two functions are not MFC-specific.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
The timer solution that I wanted to explain, and decided finally not to.
~RaGE();
|
|
|
|
|
Thanks Rage,
As per your suggestion, i tried the code. CreateProcess and TerminateProcess do the things required for me. Thanks again for helping me in the right time.
|
|
|
|
|
Hi all
While using CreateProcess() for running an EXE from the VC++ application the application works fine when i directly use EXE. When i specify the path of the shortcut the CreateProcess is failed. please suggest me to run the exe from shortcut.
Thanks in advance
|
|
|
|
|
S.R.Sasi Kumar wrote: When i specify the path of the shortcut the CreateProcess is failed. please suggest me to run the exe from shortcut.
Try ShellExecute() .
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Another question: are you waiting with the timer to be sure that the first app is finished before running the second one ?
~RaGE();
|
|
|
|
|
Use CreateProcess to start your first app.
Monitor that app, and wait for it to terminate.
In your 1st app, set a timer to fire after one minute, and let the app close itself (send WM_CLOSE).
When you detect that the 1st app is terminated, run the 2nd app with CreateProcess().
ShellExecute and WinExec are brain-dead cousins of CreateProcess(). Avoid using them.
------- 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
|
|
|
|
|
John Simmons / outlaw programmer wrote: ShellExecute and WinExec are brain-dead cousins of CreateProcess(). Avoid using them.
I agree with your WinExec() sentiment, but how would you propose to use CreateProcess() when your task is to "run" or "print" an .html or a .doc file?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hi Friends,
I have local as well as network printers. I want to assign printing quota for each user and want to control the printing only is it is valid.Is there any way to do such things?
Vikram S
|
|
|
|
|
Could you call EnumJobs() with JOB_INFO_1 or JOB_INFO_2 ?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Yes I can do that....thanx...
Is there any way to terminate/remove that job from spooler?
|
|
|
|
|
vikrams wrote: Is there any way to terminate/remove that job from spooler?
How about EndDocPrinter() ?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Show me please how can I realise z=f(x,y) using sttaic libraries.Best regards
|
|
|
|
|
|
Hello,
Please define more clearly what you mean. To me it is not clear if you want to create your own library or you want to use some other...
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
|
I have used Windows Media Player 10 in my vc++ application...i can play mp3 and avi files but not vob files...when i rename the vob files to mpg, the application plays them...but it does not do the same with vob files...please help...
thanks
Sanjukta
-- modified at 6:51 Tuesday 31st January, 2006
|
|
|
|
|
How are you loading the files ? Please post a small code snippet.
~RaGE();
|
|
|
|
|
Hallo
I have written some class
<br />
#if !defined(_COMPLEX_H_)<br />
#define _COMPLEX_H_<br />
<br />
#include <stdio.h><br />
#include <iostream.h><br />
<br />
class Complex <br />
{<br />
public:<br />
Complex();<br />
Complex(const Complex&);<br />
Complex(double a, double b) : re(a), im(b) {}<br />
<br />
virtual ~Complex();<br />
<br />
const Complex& operator+= (const Complex&);<br />
const Complex& operator+= (const double);<br />
friend Complex operator+= (double&, Complex&);<br />
<br />
Complex operator+ (const Complex&) const;<br />
Complex operator+ (const double) const;<br />
friend Complex operator+ (double, const Complex&);<br />
<br />
const Complex& operator-= (const Complex&);<br />
const Complex& operator-= (const double);<br />
friend Complex operator-= (double, Complex&);<br />
<br />
Complex operator- (const Complex&) const;<br />
<br />
Complex operator- (const double) const;<br />
<br />
friend Complex operator- (double, const Complex&);<br />
<br />
Complex operator! (void);<br />
<br />
friend ostream& operator<< (ostream&,const Complex&);<br />
<br />
private:<br />
double re;<br />
double im;<br />
};<br />
<br />
#endif<br />
How to change this operator to global calling and then referencing in the class complex ???
THX T
|
|
|
|