|
m_edit1=answer1;
m_edit2=answer2;
m_edit3=answer3;
UpdateData(false);
Nish
Chris,
Can I have a Johnny Bravo icon please?
Please, please, please........
|
|
|
|
|
Thanks for the help but where in the source file do I put the code? the compiled keeps telling me that m_edit1,2,3 are all undeclared identifiers
|
|
|
|
|
I'm trying to create a file dialog box with 2 filter extensions. How can i update the filename field everytime i select a different extension from the save as type.
|
|
|
|
|
Look at
CFileDialog::OnTypeChange
But u would need to create a new class to recive the notifications.
U could use spy to get the pointer to the edit box id,
and get a handle to it and change the text in it.
|
|
|
|
|
I want to be able to select one item in the the list box and remove it from the list with the push of a button but leaving all the other items in it.
|
|
|
|
|
That's exactly what DeleteString does. It deletes the string from the list box whose index you specified. It leaves all other items intact.
Call index=GetCurSel() to get the index of the selected item.
Then in the button's click handler call DeleteString(index)
Nish
Chris,
Can I have a Johnny Bravo icon please?
Please, please, please........
|
|
|
|
|
Johnny5 wrote:
Re: Nish {BusterBoy] Deleting strings
What does this means?Nish {Buster Boy]...
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Mazdak wrote:
What does this means?Nish {Buster Boy]...
Well spotted Mazy.
Thanks too.
Yes The first [ has been mis-spelt as {
I have corrected it in my reply...
Nish
Chris,
Can I have a Johnny Bravo icon please?
Please, please, please........
|
|
|
|
|
where do i call the index from?
would i do this?
//m_lsFile is the control CString variable to that list box
void CMainDlg::OnBdelete()
{
m_lsFile.GetCurSel();
m_lsFile.DeleteString();
}
|
|
|
|
|
Johnny5 wrote:
m_lsFile.GetCurSel();
m_lsFile.DeleteString();
int index=m_lsFile.GetCurSel();
m_lsFile.DeleteString(index);
Nish
Chris,
Can I have a Johnny Bravo icon please?
Please, please, please........
|
|
|
|
|
Hey, i have a listbox that contains various items inside of it. can someone tell me how i can make only one of those items selected in the listbox, be deleted by pressing a button?
|
|
|
|
|
You want to have exactly one string in listbox? Or one selected string in listbox?
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
I want to be able to select one item in the the list box and remove it from the list with the push of a button.
|
|
|
|
|
CListBox::SetCurSel selects item (assuming that you have single-selection listbox). CListBox::DeleteString deletes item with specified index.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Hi Tomasz
This thread is now dead. The question has been reposted and using my nick in the subject. The nick was spelt wrong and I had to replace a { with a [ in the reply. But I think the subject of the re-post might actually confuse some people and they might think I am deleting strings for whatever reasons I might have
Nish
Chris,
Can I have a Johnny Bravo icon please?
Please, please, please........
|
|
|
|
|
CListBox::DeleteString
Nish
Chris,
Can I have a Johnny Bravo icon please?
Please, please, please........
|
|
|
|
|
I am learning multithreading for the first time. I tried to create a thread using CreateThread() in MS Visual C++:
sThread = CreateThread(NULL, 0, StreamHandler, NULL, 0, &sThreadID);
Tracing through debugger, the thread seems to be created because I receive a handle.
I placed a cout statement at the beginning of my StreamHandler function, but it was not printed. So it seems as if the thread was created, but did not execute my function.
Does anyone know how I can jump into my function to see if the thread is running?
|
|
|
|
|
cout uses C++ runtime features, which are not initialized when you create thread by calling Win32 API (CreateThread). If you want to use streams or anything which is provided by runtime, you need to create your thread with _beginthread or _beginthreadex.
Tomasz Sowinski -- http://www.shooltz.com ** If you're going to rape, pillage and burn, be sure to do things in that order. **
|
|
|
|
|
Use _beginthreadex instead. The CreateThread function don't initialize the CRT (C-RunTime, not Cathodic Ray Tube correctly, so this might be your problem.
Michel
If I am wrong or said something stupid, I apologize in advance
|
|
|
|
|
** OK, let's assume I don't use cout, but printf instead **
How do I use the Visual Studios so I can trace into my thread function?
|
|
|
|
|
Just set a break point in your thread routine.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I did that. It didn't go into the thread function.
|
|
|
|
|
Strange, very strange...
Maybe someone else has seen this before. Like you, since it created the handle, the thread was at least started. I would have expected some type of dialog box if it tossed an exception.
When you call CreateThread, are you having to do any type casting to get the routine to accept your routine?
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
This is my code:
DWORD WINAPI StreamHandler(LPVOID lpParam)
{
//Thread function code
printf("I am in the thread\n");
}
//Create TCP/IP Thread
sThread = CreateThread(NULL,0,StreamHandler,NULL,0,&sThreadID);
if (sThread == NULL)
cout << "Create Stream Thread Failed\n";
else
CloseHandle(sThread);
It's pretty simple, I don't know why it doesn't execute.
|
|
|
|
|
Something else is going on. I just tried that code and it worked just fine.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|