|
greetings,
1. Is a CSliderCtrl kinda a CScrollBar?
2. Do child controls of a dialog window reflect messages to the parent window?
3. Can class wizard connect the CSliderCtrl messages to the parent window?
|
|
|
|
|
I wrote a simple program that cycles through a bunch a bitmaps and displays them each for 5 seconds. The program can run for hours. The problem is that the i can't stop the program once it starts (beside hitting the X and crashing). While inside the for loop, the menu is ignored. I'm sure this is common and there's a simple way to check for user input but I can't find it.
|
|
|
|
|
put the loop into it own thread... this way, it doesn't block the UI...
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
then in the loop (that's in its own thread), have it check some static variable or something that gets set to true when a certain button is pressed. Then add that variable as part of the criteria for your loop to continue looping
My articles
BlackDice
|
|
|
|
|
Greetings,
you have to allow the message pump of the main window run; Either dispatch messages from your bitmap loop; check msdn for pumpmessage;
|
|
|
|
|
Thanks a lot everyone. I'm wasn't ready to try tackling threads yet, especially for this program, since I just needed to cancel out of the main loop. I looked up info on PumpMessage() and found a great article call "Lengthy Operations Without Multiple Threads". I implemented the technique and the program runs exactly like I wanted it to.
|
|
|
|
|
How do I catch this even without checking if the point belongs to list box area or not ?
Please help.
--------------------------------
Human stupidity is infinite.
|
|
|
|
|
Hi dudes!
I have an especial electronical device that I connect to my computer through USB, and there's a USB-serial driver that emule the RS232 communication through USB.
That's ok.
The fact is that many times I must to point to Control Panel -> Sistem -> Hardware -> Devices -> Comm Ports to see which comm port the device is using.
I want to developed an small application, with just a button. Then when I press it, a MessageBox shows the Comm Port used for that device.
What API function/s should use in the button click event handler to get that kind of information, (in fact, it is the same that control panel display in Comm Ports).
Thank very much guys!
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
Well, you could enumerate the serial ports in the system, and then open/close them one by one. Any port in use will not open. Hence you will know which port is in use, but still, it could be a serial mouse.
this is this.
|
|
|
|
|
you can read the regedit in you system,
"HKEY_LOCAL_MACHINE\\HARDWARE\\DEVICEMAP\\SERIALCOMM"
at there you can get the information you need!
学习是一辈子的事!
|
|
|
|
|
Yes wotur that's what I need.
Thank you very much.
Regards.
Demian.
"I have always wished that my computer would be as easy to use as my
telephone. My wish has come true. I no longer know how to use my telephone."
-Bjarne Stroustrup, computer science professor, designer of C++
programming language (1950- )
|
|
|
|
|
i am using a ddl to call other dll to show a form, that´s ok.But the problem is, i can not give the focus to the form, if there are more forms or programs opened the form that i call stay under the others , i want it to apears in front of all the others things opened,i have already used ShowModal but it does not work, can you help me, i am using C++ Builder(Borland) in windows 2000.
tks
|
|
|
|
|
I have a modeless child dialog of another parent dialog.
when initializing the parent dialog, I set initial values for the child dialog controls; one of those controls ( more than one actually ) is a radio button group. That radio button group will enable/disable corresponding controls depending on which button is pressed.
Now, I want to initialize the radio with one value, and automatically enable/disabled corresponding controls ( like it would behave if the user click on one of the radio choice ).
I do something like :
m_RadioValue = myRadioValue;
UpdateData( FALSE );
When doing the UpdateData, it will set the UI for the radio button, but is there a way to call the callback that would be called if the user clicked on one of the button; or do I have to do all this manually ? not a big work, but will need a bit of code re-organizing.
hope I was clear enough.
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I would refrain from using UpdateData() , especially with radio buttons. Create a CButton control variable for each radio button. In the dialog's OnInitDialog() method, do something like:
if (1 == myRadioValue)
{
m_button1.SetCheck(BST_CHECKED);
OnButton1();
}
else if (2 == myRadioValue)
{
m_button2.SetCheck(BST_CHECKED);
OnButton2();
}
else if (3 == myRadioValue)
{
m_button3.SetCheck(BST_CHECKED);
OnButton3();
}
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I will remove the UpdateData ... I already have CButton for each button.
Thanks, will look into that.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I think that my problem lies elsewhere, when I call my method to enable/disable controls, it does not work.
I do this in my OnInitDialog :
m_Radio1.SetCheck( BST_CHECKED );
m_Edit1.EnableWindow( FALSE );
m_Edit2.EnableWindow( FALSE );
m_Edit3.EnableWindow( FALSE );
but all of there are still enabled when the dialog appears.
'nyway ... In the grand scheme of things, it's only a minor, minor UI glitch.
Thanks David.
I'm certain I asked that same question a couple years ago ...
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote: but all of there are still enabled when the dialog appears.
Do you have other staments where EnableWindow(TRUE) is called?
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
no, not that I can see, I put breakpoints everywhere ( running in debug mode ), and they never get called before I actually want them to be called.
I went this way, I disabled all my controls in the resource editor, and enabled them as needed ( instead of disabling them in the code ) ; my problem is when I initialized the dialog, not when using it.
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote: no, not that I can see, I put breakpoints everywhere ( running in debug mode ), and they never get called before I actually want them to be called.
Just to verify, temporarily change all EnableWindow(FALSE) calls to EnableWindow(TRUE) . Even though a breakpoint is not being hit, this will at least eliminate the debugger as masking the problem.
Maximilien wrote: I went this way, I disabled all my controls in the resource editor,
Again, temporarily change all the controls to be enabled via the resource editor. Now your dialog should come up with all of the controls enabled. Yes? If so, start changing one statement at a time, or one control at a time in the resource editor, until the problem shows up.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Are you suspecting a resource ( ID related ) mixup ?
I will look at this tomorrow ... will launch a full rebuild when I leave tonight, to remove all possible conflicts.
Thanks.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
Maximilien wrote:
Are you suspecting a resource ( ID related ) mixup ?
No, but don't dismiss that either. I'm trying to rule out the possibility that a EnableWindow(FALSE) statement is actually being called even though the breakpoint in the debugger is indicating otherwise. I've seen it happen a few times.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I need help in trying to code a report using Crystal Reports in C++. I can not find any examples using this capabilities. I find some using VB and C# but not C++. I could use anybody's help. Either an example or direction.
Thanks
Dick Willms
(WillmsDick@hotmail.com)
|
|
|
|
|
Are you trying to run the report, display the report, or programmatically modify the report (you use different things for each)? By the way, you'll want to use their COM objects in C++, which aren't hard to use, and the VB and C# examples somewhat translate. By the way, which version of Crystal are you using?
|
|
|
|
|
I will be doing all of the above. I am using the one that comes with .Net 2002 and or 2003. I have both. Currently I have finished the data collection phase and now I neeed to do the reporting phase against the data being collected.
|
|
|
|
|
In MSDN, under "Crystal Reports for Visual Studio .Net":
When you are creating a C++ project to host Crystal reports on the Web or Windows, you should choose the Managed C++ Application template.
Procedures that involve design view operations and automatic code generation to incorporate Crystal reports generally apply to Visual Basic and Visual C# projects only. You should use the Report Object Model, the Web Forms Viewer class description and the Windows Forms Viewer class description to incorporate Crystal reports in Managed C++ projects.
It looks like the only portion of Crystal Reports they distribute with .Net is the .Net version, not the ActiveX controls or COM interfaces. So, is your C++ app a managed app?
|
|
|
|