|
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);
|
|
|
|
|
Hi,
We have written a ATL COM addin for MS word. We have found that events are called for 1st instance of word document. When we open another document then no event is called. If we close all word docs and open a new word document again, event is generated. We futher digging we found that,for first instance OnConnection() is called, for 2nd , 3rd instance it is not called.
Please help me out.
regards
RYK
|
|
|
|
|
VC_RYK wrote: Please help me out.
With what? You think we can make word fire the events when documents are opened? This is Code Project not the Magic Shop.
led mike
|
|
|
|
|
Hi
From This link u can get the code
http://support.microsoft.com/kb/230689
and this works only for a single document which open first but i want to work for every document.
With regards
RYK
|
|
|
|
|
I find that edit box has a caret but button doesn't.
What's the main differenct of them?
|
|
|
|
|
|
|
Thats easy,
the CBugsBunnyWnd
codito ergo sum
|
|
|
|
|
Isn't this kind of obvious? You'll have a caret only where there is a text-area (where you could possibly type and the letters appear). What possibly made you ask such a question?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
I bet he can almost smell your angry gas...
|
|
|
|
|
Probably yes.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
You can use the caret in any window you want to.
Since a caret is generally used to mark an insertion point, it only really makes sense to use
it where the user can insert something.
Carets[^]
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Caret is for text and editbox is for enter the textes but I guess your intent is focus,right?
|
|
|
|
|
Hello,
Can anyone point me a smaple that shows me how to hook the WM_PRINTCLIENT event.
Thank you!
|
|
|
|
|
|
Thank you!
Can you tell me (I am not sure) if this event WM_PRINTCLIENT is related with the user pressing Print button?
I want to make sure that I get this event when the user want to print a page.
|
|
|
|
|
Hi,
Follwoing code is not working for shutting down a system.
if(ExitWindowsEx(EWX_REBOOT|EWX_FORCE,0))
AfxMessageBox(_T("Restart"));
else
{
if(InitiateSystemShutdownEx(NULL,NULL,NULL,FALSE,TRUE,NULL))
AfxMessageBox(_T("Restart1"));
}
|
|
|
|
|
Did you check the return value of ExitWindowsEx()?
See this secret link: How to shut down the system[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
pther wrote: Follwoing code is not working for shutting down a system.
Ok. So what's it doing?
"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
|
|
|
|