|
Yanshof wrote: ...the application i fail.
Someone can help me find out what is the problem ?
How can we do that when you've failed to describe the problem, or what you've already tried? Have you bothered to use the debugger?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
As David said, you're providing very little information.
I'm guessing that your main window is being destroyed, so it's disappearing from the taskbar, and the applications list in task manager. But your process has not finished, so it won;t disappear from the processes list.
You may have some large I/O waiting to finish, or a bug in your code.
Try debugging into your InitInstance member function, follow it out, and then into CWinApp::Run, and see if it exits the message loop.
You may also have some significant code in your OnDestroy method.
That's all the guessing I'm doing - over to you to dig into your application.
Also - I suspect the strange bug is in your code, not MFC.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
hello every one,
i am programing my first program in usinng MFC. i want a simple addition fuction where i have two variables box where i enter two numbers. and third varible which shows the results of the two variables after pressing a button which is also place on the dialog box.
my question is i am able to create the complete form but how i can assign the varibles as variable and how take the values in the program and how i can show the value out. i know that some seeting shave to change but which one. i am using Visual studio 5
cheers
harry
|
|
|
|
|
harjeemann wrote: shave to change
harjeemann wrote: i am using Visual studio 5
Besides that, you could write a handler for the button and add member variables for the edit controls (CEdit type) and call SetWindowText to set the text.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
It's better you to start with some books or articles to know more about MFC. it's difficult to whole process in a QA thread.
There are many methods, to get things done for your case in MFC.
You can add a control variable for All your edit boxes and can GetWindowText routine to get text of each items.
atoi(); routine will help you to convert string to integer data
itoa(); routine will help you to convert integer to string data
SetWindowText() routine will help you to set a control variable.
There are other routines called "GetDlgItemInt" etc.. to get the text in integer format.
I suggest you to better start with "Programming Windows using MFC" by Jeff Prosise. or with articles in MSDN or Codeproject
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
harjeemann wrote: i am using Visual studio 5
cheers
For learning, what's wrong with the Express compilers[^]?
E.g. Visual Studio Express 2008[^]
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Probably because MFC's are not included in the express editions. I now that was the case for VC2005 Express, I don't know if they changed it but I don't suppose so.
|
|
|
|
|
Oh - you are right.
I used them for learning C# and liked them.
*moves into to a hermits cave and takes a vow of silence*
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Hi,
I need to develop a packaging and deployment tool which will work like "Install Shield".
Any tips.
Thanks in advance
Regards,
Sachin
|
|
|
|
|
Perhaps this is a repost or perhaps you just have the same assignment as someone who posted a few weeks ago?
Either way you're not in for a fun time. Probably the best way for you to understand how large and complex a task this could be is for you to spend some time studying MSI ( Microsoft Installer ) which is part of Windows and has an API and database style tables and masses and masses and masses of rules and datasets and caveats and no doubt ultra-fat books written about it. If you still think this project is agood idea once you've got a grip on MSI then you'll know more about the subject than me and will be able to ask very specific and pertinent questions of the experts who lurk hereabouts. Good luck
Nothing is exactly what it seems but everything with seems can be unpicked.
|
|
|
|
|
Why do you need to reinvent the wheel ? Can't you use something that already exists ? There are tons of windows installer on the market (some even free, like InnoSetup).
|
|
|
|
|
Cedric Moonen wrote: There are tons of windows installer on the market (some even free, like InnoSetup).
Or NSIS[^]!
*plug*
Let's think the unthinkable, let's do the undoable, let's prepare to grapple with the ineffable itself, and see if we may not eff it after all. Douglas Adams, "Dirk Gently's Holistic Detective Agency"
|
|
|
|
|
Visual Studio Installer
or
orca.exe
|
|
|
|
|
Did you search on the codeproject?
|
|
|
|
|
Hello to all,
In my project I am using modal dialog box usin "AfxMessageBox".After clickin on one button that modal dialog box appears in front of user but my problem is such that after clicking on the button modal dialog box appears on that button only and i want that modal dialog box should appear in the center of my window,so can we reposition modal dialog box?
can any one suggest plz how we can display modal dialog box in our given location?
Thanks and Regards,
Anay
|
|
|
|
|
If you are have the handle for the Window, (CWnd or HWND), you can use SetWindowPos or CWnd::MoveWindow function to do the same.
Please rephrase your question. it's not really clear. It will be difficult to get an answer, if your question is not concise.
-Sarath.
"Great hopes make everything great possible" - Benjamin Franklin
|
|
|
|
|
Do you need to CenterWindow?
|
|
|
|
|
hi all,
i want to create a dialog box same like as we click on Start button of Windows Explorer.
i want to set a focus on one button like (Start Button) at bottom,
from that button i want to call a dialog box on which my child window controls are present.
i am using a dialog box for that bottom button, after click on that button i want to set focus on the another dialog box
plz help me out from dis..
Pankaj
|
|
|
|
|
Same way as we create a dialog box from any other place.
MFC:
void CMyFirstDialog::OnAButtonPressed ()
{
CMySecondDialog dlg2 (this);
if (dlg2.DoModal () == IDOK)
{
}
}
Not quite sure how the windows start button comes into it, other than doing something when a button is pressed.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
hey thanx for reply
but i want to do dis in sdk
Pankaj
|
|
|
|
|
Same answer... Just written a bit differently.
Instead of "OnMyButton", you'll have a Dlg/Wndproc, with a
case WM_COMMAND:
...
case IDC_MYBUTTON:
DialogBox (hDlg, ... etc);
MFC is just nicely packaged SDK. Anyhinh it can do, you can do for yourself. The book keeping gets harder, but not the ideas.
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
For make a dialog you can use of CreateWindow or CDialog class.
|
|
|
|
|
Hello
I need help on how to convert an array which its datatype is unsigned char to a string. The scenario is like this. I detect the mac address of a computer using GetAdaptersInfo API. So the return result of the call is the current MAC address which is available and the return Mac address is an unsigned char. So I can print the MAC address by using this code below :-
<br />
<br />
static void showMACArray(unsigned char MACData[])<br />
{<br />
<br />
printf("%02X-%02X-%02X-%02X-%02X-%02X\n", <br />
MACData[0], MACData[1], MACData[2], MACData[3], MACData[4], MACData[5]);<br />
}<br />
I want to print out as such that the Mac Data is in a string just like the code below :-
<br />
<br />
printf("The Mac address would be %s\n", MACData);<br />
<br />
I understand that i must concatenate each of the MACData[] array so that it combines together using strcat(). However, before using strcat(), i must convert each of the MACData unsigned char array to a string so that it can support the strcat() function. How can I solve this? Thank you and your help is really appreciated.
|
|
|
|
|
Alternatives:
- sprintf [^].
- CString::Format [^]
- Write you own converter: it is a simple programming exercise.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
char buf[20];
snprintf(buf, 20, "%02X-%02X-%02X-%02X-%02X-%02X\n",
MACData[0], MACData[1], MACData[2], MACData[3], MACData[4], MACData[5]);
printf("MACAddr = %s\n", buf);
|
|
|
|