|
Giorgi Moniava wrote:
when the user clicks in the caption bar the 'x' button i want that my program did'nt exit
Handle OnCancel() Virtual Function
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
I had a default Cancel button with code :
void CRemindMEDlg::OnBnClickedCancel()
{
Shell_NotifyIcon(NIM_DELETE, &tnid);
OnCancel();
}
if i changed OnCancel(); simply with ShowWindow(SW_HIDE)
then 'x' button would work correctly , but Cancel button No.
So thanks to your Advice and Ravi Bhavnani -s , i ve done next
void CRemindMEDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if(nID==SC_CLOSE) bClose=false;
CDialog::OnSysCommand(nID, lParam);
}
and OnBnClickedCancel()changed to :
void CRemindMEDlg::OnBnClickedCancel()
{
if(bClose) { OnCancel();Shell_NotifyIcon(NIM_DELETE,&tnid);}
else {CDialog::ShowWindow(SW_HIDE);bClose=true;}
}
Now it works ,
Thanks to both of you for attention.
m0n0
|
|
|
|
|
Handle WM_SYSCOMMAND and check for the case SC_CLOSE .
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
thanks
m0n0
|
|
|
|
|
I would like to run the other program from my console program? What's that function? I know WinExec can use in MFC but it's not work for console. Please help me? Thank you very much.
|
|
|
|
|
system(...)
CreateProcess(...)
ShellExecute(...)
ShellExecuteEx(...)
Just a few examples. Which one to actually use depends on what you are trying to accomplish and how much control (or notification) you need over the launched application.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
Thank you very much. I'll try.
|
|
|
|
|
Hi,
I am having 3 years of experience in VC++ and looking to take certification in the same which would help my career. Has Microsoft discontinued its MCSD certifications in VC++? If so can any one please provide pointers to some other VC++ certifications?
|
|
|
|
|
|
They haven't discontinued it, there are now two types, MCSD and MCSD.Net. The regular MCSD covers C++, the others are VB.Net and C#. You can check out transcender.com for exam preparation software, it's expensive but well worth it, especially if you can get your company to pay for it.
-- Rocky Dean Pulley
|
|
|
|
|
Could you give me tutorials about drawing application by moving objects ?
Thank you
|
|
|
|
|
Hey,
I've a dialog with a toolbar. All worked perfect. Then I changed the style to "child" in order to move the dialog with the main window.
Now I have the problem that all my toolbar-button are disabled. Can you help me?
Thanx
|
|
|
|
|
I found out that when I create a handle for the Toolbar-Button in my View-Class the toolbar is OK.
|
|
|
|
|
Hi, I have two classes, say A and B
class A {
private:
...
int *p;
...
public:
...
~A() { delete [] p; }
int getData(int i) { return p[i]; }
}
class B {
private:
...
A *p;
...
public:
...
~B() { delete [] p; }
A getData(int i) { return p[i]; }
}
In my main code I create a class B with say A array of length 2 and each A has int array of length 5. The problem is if I loop through the objects trying to print out the values of the integer arrays, I get an error.
e.g. for(i=0;i<2;i++)
for(j=0;j<5;j++)
cout << bImpl.getData(i).getData(j);
This works for 'bImpl.p[0].p[0]' but gives an error for 'bImpl.p[0].p[1]', the reason being (i think !) that when 'bImpl.getData(i).getData(j)' returns it calls the destructor of class A and removes the pointer to the integer array. I think this is correct as if i remove the 'delete [] p' line from both the destructors, everything works fine. I know that this line of code is necessary and would appreciate any help.
|
|
|
|
|
Try changing the getData method of B to:
A* getData(int i) { return p+i; } and the printing line to
bImpl.getData(i)->getData(j);
It's just one of the possible solutions, the simplest.
"though nothing
will keep us together
we can beat them
for ever and ever"
rechi
|
|
|
|
|
Hi every body
I want to add crriage return and line feed with end of txt file when I made a txt file.
FILE *fp;
fp = fopen("MY.txt",w+);
fprintf(fp,...
fclose(fp);
|
|
|
|
|
try thiz.....
FILE *fp;
fp = fopen("MY.txt",w+);
fputc(13,fp);
fputc(10,fp);
fputc(26,fp);
fclose(fp);
hope thiz helpz......
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
FILE *fp;
fp = fopen("MY.txt",w+);
fseek(fp, 0, SEEK_END);
fprintf(fp, "\n");
fclose(fp);
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Hi!
I need to know how to get user information of every process running in windows. I already have a list with all the process id's, but I can't find the way to obtain the user names (or user id's) of the owners of that processes.
I'm using VC++ 6
Can you help me, please?
Thanks!!!
|
|
|
|
|
Have a look at the PSAPI and Tool Help Library in MSDN.
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Tip for new SUV drivers: Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
|
|
Hi, at first time I want to apologize for my English.
I need to change the language of my app and I like to do it changing the caption of the controls in the resource.rc file, or having one resource.rc file for each language, but then I need to use resource.rc file in the execution and not in the compile time, can I do it? How can I do it?.
Thank you.
kaworu@inicia.es
|
|
|
|
|
Kaworu2 wrote:
then I need to use resource.rc file in the execution and not in the compile time, can I do it?
Check this article it's deal with your problem
http://www.codeproject.com/cpp/mult_lang_support.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
|
|
|
|
|
I want to create an MFC application in it I want to use perl. Suppose there's a Dialog Box on it there r few buttons when we click on them the perl code associated with that button should be executed.
For eg. there's a button when we click on that button it asks for the name of the project to be created in Visual Source Safe Database.
Or simply u can tell me this eg. For eg. when we click on a button it asks for the ur name & then prints Hello ur name.
Then i'll try to embed this code myself in VC++.
Now, if we click on the create new project button the following code should get executed
chomp ($proj = <stdin>);
system ("ss Create $proj");
print("$proj Project has been Created Successfully.\n\n");
Above code first asks for the name of the project that has to be created. Then second line executes the system cmd & creates a project that the name u specified. ss Create is an system cmd for executing system cmd we use system keyword. And finally prints the msg Project_Name Project has been Created Successfully. This cmd creates a project in VSS.
This script I created for CLI I.e cmd prompt. Now I want the same application to be executed using VC++.
Plz. let me know as soon as possible.
|
|
|
|