|
drag and drop a edit box - IDC_EDIT1
drag and drop a button - IDC_BUTTON1
Now Right click -> Class Wizard ->Choose "member variable" tab ->Select IDC_EDIT1->Click "Add variable" Now give a string m_String.
Now go to Message map tab->Choose IDC_BUTTON1->select BN_CLICKED -> Click "Add Function" . Give ok to OnButton1().
Now go to the proper .cpp file which ends eith *dlg.cpp . Change the function OnButton1() definetion as below
void CProjDlg::OnButton1()
{
// TODO: Add your control notification handler code here
AfxMessageBox(m_String);
}
redindian
|
|
|
|
|
Go to Workspace window->Click on Resource view -> Choose the project's main dialog . Go to menu "Layout" -> Click on Tab order -> Choose your button as 1 and Ok and Cancel buttons as 2 and 3 . Now Enter will work as L buton click
redindian
|
|
|
|
|
sureshu wrote: i hav done wat u hav asked to do so but as soon as i enter the value in to the textbox and press enter my application closes
See the FAQ[^]
|
|
|
|
|
hello
see my last reply
redindian
|
|
|
|
|
hav done wat u hav asked to do so but as soon as i enter the value in to the textbox and press enter my application closes.
what to do to display the value ntered in the enter key.
suresh.u
|
|
|
|
|
Choose 1 as tab order of edit box
2 as tab order of button
3 and 4 for Ok and cancel
redindian
|
|
|
|
|
no its not working!!!!!!!!!!!!!!
suresh.u
|
|
|
|
|
Did you read the link I posted ?
|
|
|
|
|
s nw the dialog doesnt close as per dharani replies i made the use of her code.
suresh.u
|
|
|
|
|
Hi suresh
I am a "he"
redindian
|
|
|
|
|
now presssing the enter key i get a mss box but the value entered in the edit box is not displayed in the message box only empty message box appears. thats 2 the concept given by u works only with the presence of default OK and CaANCEL button. And its not working for the button I dragged from the tool box.
suresh.u
|
|
|
|
|
Please show the code snippet that responds to the (clicking of the) OK button.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Add UpdateData(TRUE); just before the messagebox
redindian
|
|
|
|
|
Dear all
I write a dll in visual C++.
There exist one exception in it that make program unstable.
I want to find the place of exception.
I can use Dr watson or windbg or any other debugger tool but not Visual C++.
May you please help me.
Regards
Mahdi
|
|
|
|
|
|
What kind of exception? In general you can set a debuggers policy of each type of exception. In MSCV6 this in in the "Debug"->"Exceptions..." menu item (only accessible when you're actually debugging) and in WinDBG it's in the "Debug"->"Event Filters..." menu item. Set the debugger the break on the break on that exception before the exception handler is executed (first chance exception).
Steve
|
|
|
|
|
|
Errr, just call the function the standard way. What problem do you have exactly ?
|
|
|
|
|
What do you mean exactly ?
1) Do you want to create a thread and make it execute a function ?
If so
CreateThread(NULL, 0, ClientThread,(LPVOID)param, 0, NULL);
Here ClientThread() is the function which will be executed by the thread . Note : here the function is not "created" in the thread but just executed in the thread.
2)Do you mean to say you have a prototype of a function defined inside the thread 0 and want to call it from thread 1 outside ?
redindian
|
|
|
|
|
|
Hello,
I have a problem that I hope you can help me solve.
I have a server application that creates folders and files in Program Files. The folders and files created should be available to the Users group from NT based machines (2k, XP Pro and 2003). The application works great for English version of Windows but one user with XP in Spanish has reported that the application does not work as supposed. The problem is that the Users group in Spanish is named Usuarios.
If anyone knows a good article that I can review in order to be able to build a global (independent from the Windows language) please let me know.
Thank you,
Dan.
|
|
|
|
|
Hi,
I think one thing will be all time the same - I mean SID of Users group - S-1-5-32-545.
-----------
Mila
|
|
|
|
|
Thank you. This might work. I will give it a try.
Again thank you for your time.
Best Regards,
Dan.
|
|
|
|
|
Isn't localisation wonderful?
Do you mean the local machine Users group, or the domain level Users group?
If you mean the local machine users group, then for WindowsXP/2003 you can use something like CreateWellKnownSid with WinBuiltinUsersSid as the sid. For 2K you'd have to manually create the SID yourself, although this isn't too hard as it is a fixed value "S-1-5-32-545", so something like
SID_IDENTIFIER_AUTHORITY auth = SECURITY_NT_AUTHORITY;
AllocateAndInitializeSid(
&auth,
2,
SECURITY_BUILTIN_DOMAIN_RID,
DOMAIN_ALIAS_RID_USERS,
0,
0,
0,
0,
0,
0,
TheSID);
would do the trick. You can use LookupAccountSid() if you want to know the localised name, of course
Steve S
Developer for hire
|
|
|
|
|
Thank you,
I was reffering the local machine and I had tried this approach and it works as intended. Thenk you for your time.
Best Regards,
Dan.
|
|
|
|