|
The dialog needs to be modeless, end of story. Someone said that to you yesterday and it's all you need. Once you have a modeless dialog, then you can still press the second button while the dialog is up, and you can create a method on the modeless dialog which takes your string and enters it into your combo box. Call that method when button two is pressed, and you're done.
People suggested you need *threads* to do this ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
thanks for reply.
Christian Graus wrote:
The dialog needs to be modeless
i have modeless dialogs!!!
Christian Graus wrote:
you can create a method on the modeless dialog which takes your string and enters it into your combo box
that is, what i mean! how can i do this? how should the method look like?
thanks
sunny
|
|
|
|
|
public:
void PassText(CString s);
void MyModelessDialog::PassText(CString s)
{
MyComboBox.SetWindowText(s);
}
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
i´m sorry, i do not understand this code example! can i use it in mfc???
thank you very much
sunny
|
|
|
|
|
I'm sorry, but I think you probably need to go back to C++ without MFC, or Windows of any kind, if you do not understand this. That is a friendly suggestion, not an insult.
To put text into the edit area of a combobox, you call it's SetWindowText method. That is an MFC method, and it requires that you've created a variable of type CComboBox in your modeless dialog box. The rest of the function is basic C++, I showed the declaration ( the bit in the .h file ) to show it needs to not be private ( that is not actually true, but it's the simplest way ), and the definition, where all we do is take the string and shove it into the combo box. You then call that method on the combo box in the method the class wizard defines for you for when you push button 2.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Christian Graus wrote:
I'm sorry, but I think you probably need to go back to C++ without MFC, or Windows of any kind, if you do not understand this. That is a friendly suggestion, not an insult.
that or i should go to bed earlier. i believes my brain is still sleeping.
first, i will try to go to bed more earlier. ;);)
thanks for your reply! i think your idea is perfekt and i will try it.
sunny
|
|
|
|
|
Sunnygirl wrote:
that or i should go to bed earlier.
Well, that is always an option, I have days like that myself.
Sunnygirl wrote:
i think your idea is perfekt and i will try it.
Good luck - if you get stuck, just ask some more.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
hi all
can i know how do i set the date of my programme so that it can take the date directly from the computer without we ned to set everytime we use the programme.Do i need to ue timer to do that.
pls reply asap
Thank alot!!!!!
diana
|
|
|
|
|
time.h contains an API called time, and one called ( from memory ) globaltime. If you look up time_t in the MSDN, you'll find all you need.
Christian
No offense, but I don't really want to encourage the creation of another VB developer.
- Larry Antram 22 Oct 2002
C# will attract all comers, where VB is for IT Journalists and managers - Michael
P Butler 05-12-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not
as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
It's so long since I had to this I have forgotten how to enumerate the com ports that are installed in a machine, including a USB to serial adaptor.
Does anyone have a simple example at their fingertips?
Thanks in advance.
Happy programming!!
|
|
|
|
|
Hi Wolfram,
there are a couple of hints in the Windows DDK documentation.. Try to search MSDN for 'Serenum', maybe this could help you.
Another aproach is try to open all known ports, in most cases it's enough to do this with at least 9 ports (COM1- COM9). If open returns OK, you can use this port, if not, it's already in use or not there...
That's the way I do it in my apps...
Greetings!
Olli!
Olli
Make it idiot proof and someone will make a better idiot......
|
|
|
|
|
The COM1-COM9 is what we did and thought is was a big enough choice to connect a single device up, but we had a bug report that COM10 was missing. Hence I thought if I enumerate what is actually installed there should be no further debate.
Happy programming!!
|
|
|
|
|
Take a look on http://www.codeproject.com/system/enumports.asp
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Thanks
Wonder why that didn't come up when I did a search?
Well I have it now
Happy programming!!
|
|
|
|
|
hi everybody,
i made a couple customized commands on my menu. i bind all the event handlers to the commands and they work correctly.. when i was running/testing my program, i check out the debug/output windows and i noticed i keep on getting error warning messages on the commands that i defined.. can someone please tell me what does this message mean? altho it doesn't affect the functionality of the program, i want to know what does it mean exactly.. thx in advance..
the error message:
Warning: no message line prompt for ID 0x0098.
|
|
|
|
|
When your main frame has a status bar, MFC shows flyby help in the status bar for the selected menu item. The debug msg is saying that you don't have a flyby help string for the menu item with ID 0x98. You can set a help string by double-clicking the menu item in the menu editor, then filling in the "Prompt" field in the property sheet.
--Mike--
If it doesn't move and it should: WD-40. If it moves and it shouldn't: duct tape.
1ClickPicGrabber - Grab & organize pictures from your favorite web pages, with 1 click!
My really out-of-date homepage
Sonork-100.19012 Acid_Helm
|
|
|
|
|
Anyone have any references for detecting temperature sensors on a motherboard and reading them??
PRETTY PLEASE
|
|
|
|
|
http://www.codeguru.com/forum/showthread.php?s=&threadid=173109&highlight=temperature
http://www.codeguru.com/forum/showthread.php?s=&threadid=209801&highlight=temperature
|
|
|
|
|
Hi,
I have an application with many tab controls (and in many of them I have other sub-tab controls) and I feel that it is heavy/troublesome to create new tabs or to maintain the existing ones.
Is there a way where I could just edit new tab controls visualy without having to create a new dialog for its content everytime?
I imaging being able to add a tab control to my dialog. Then I would simply specify the labels for my different sheets and by clicking a specific label, its content would be displayed and editable.
Now I always have to create a new dialog for every tiny sheet, then programatically set up everything and see the result only when running the application.
Thanks for your help
|
|
|
|
|
hello @all,
i have a dialogbased program.
there a two buttons (eg. button1 and button2).
if i press button1 first i get a new dialog (ID_DIALOG_COMBO) with a combobox (m_ctrlComboBox ).
if i press the button2 a CString (CString mystring ) should be enterd into the combobox from the ID_DIALOG_COMBO.
how can i do this????
thank you very much
this is only an example, to explain the real background would be take to much time
sunny
|
|
|
|
|
|
"Think about what you want the program to do. How would you do it manually ?" Christian Graus- Dec 02
ZARZOR13
|
|
|
|
|
Put button 2 on ID_DIALOG_COMBO
Kevin
|
|
|
|
|
i would be happy if i could do this, but the real program is more complicated...
i must have to different buttons, because if you have not a right password (somewhere before) you cannot see the ID_DIALOG_COMBO
thanks sunny
|
|
|
|
|
I would create the dialog in a thread, use a CStringArray for the contents of the combo box and create a function to refresh the combo.
_beginthread( ShowDialog, 0, ID_DIALOG_COMBO );
LRESULT ShowDialog( LPVOID pVoid )
{
CDialog Dlg;
Dlg.Create( pVoid );
Dlg.DoModal();
return TRUE;
}
or
CMyDialog* pDlg = new CMyDialog;
pDlg->... // initialize members
_beginthread( ShowDialog, 0, (void*)pDlg );
LRESULT ShowDialog( LPVOID pVoid )
{
CDialog* pDlg = (CDialog*)pVoid ;
pDlg->DoModal();
delete pDlg;
return TRUE;
}
The pointer method is preferable because you can store the pointer(s) and control the dialog using these pointers. Make a function to refresh your combo and call it through any initialized pointers. Maybe use a CPtrArray.
|
|
|
|