|
i used INT_MAX for my intial counter value.
int counter = INT_MAX;
and then decreasing the coutner by 1 each time the loop processes
|
|
|
|
|
You do realize that the loop is going to execute 2,415,919,103 times, right?
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Alright, I'm new at programming in Windows API...My current two problems are the following. Any solution would be appreciated.
1: I have a text box in my program. In past programs such as DOS console-based programs, I could skip lines with the character '\n'. I tried it with this, it just displays a null character. How do I skip lines in a text box?
2: How do I make the background on a button a different color? I've gotten some advice to this but it wasn't very specific enough, this seems to be more complicated then it should be. Bill Gates is an ass. So how would I make the background on a button with handle, say, cmdStart, be, say, green?
Thanks for any help =)
Dave
|
|
|
|
|
1. What do you mean by "text box"? If it is an edit control, then make sure you have the "multiline" checkbox marked for the control (go to the resource editor, right click on the control and select "Properties"). If this is not what you're referring to please elaborate.
2. You're right changing the background of a color is unjustifiably hard. An excellent way to do it is explained in Yuri Goltsman's article Colored/Blinking Controls and Dialogs with any Font.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
How do I skip lines in a text box
\r\n
- Anders
Money talks, but all mine ever says is "Goodbye!"
|
|
|
|
|
Bill Gates is an ass.
LOL, that's great!
That's why he invented VB, to cover his "assness" up a bit. I'm sure you know that changing a button's background in VB is a piece of cake. In MFC it's a mission. And it's not because of C++, it's because MFC is mostly a thin wrapper around the Win32 API.
I hope Joaquin has pointed you to the solution, but if not, take a look at the CWnd::OnCtlColor in MSDN. I believe that's the easiest way to make it work without having to derive your own button class.
Regards,
Alvaro
|
|
|
|
|
If I am making a dialog box application with multiple dialog boxes which are supposed to appear in a given sequence then do I create them all at the same time, and keep all but one hidden?
Or do I create the next dialog box to be shown inside the current dialog box?
In the former case, the current dialog box will call the next dialog box's display function..
And in the latter case, an new dialog box is created (say while closing the current dialog box)
Which approach do you think is better?
|
|
|
|
|
You should use a wizard interface. Your main dialog should be a CPropertySheet (in wizard mode) and the sequentially displayed dialogs should be CPropertyPages.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
problem is I have to show the associations with the help of UML diagrams. And I will have a head ache trying to display a dialog box as a property sheet in UML.
In my diagrams I imagine there to be a different object for each dialog box, and some sort of relation exists between them (depending on whether dialog box A creates or calls the dislpay function of dialog box B)
What do you think?
|
|
|
|
|
I'd like to be able to bring up MSDN's help from outside DevStudio (using VIM's 'K' command, in particular) to get help on a particular word. I see that I can direct hh.exe to go to a particular topic by specifying the URL on the command line (e.g. hh mk:@MSITStore:/path/filename.chm::/path\topicname.htm), but the topics for things like 'printf' can't be derived from their name (printf's topic is "mk:@MSITStore:C:\Program%20Files\Microsoft%20Visual%20Studio\MSDN\2000APR\1033\vccore.chm::/html/_crt_printf.2c_.wprintf.htm").
Is anyone out there integrating MSDN help with 3rd party editors and tools?
Mark
|
|
|
|
|
Hi,
im using a CListCtrl (report view) with two columns in my app. the left column displays text and the right column should display color fields. i've read some tutorials about the CListCtrl. All i want to know is how i can add simple color fields in the right column. i dont want to add icons from a bitmap resource. how can i manage this????
thanks for your help!
bye b4ckup (:
|
|
|
|
|
I never did that, but if I need to do that, I must to try with GetItemRect, this function return to me the rect of each item, and I will try to paint each rectangle in the OnPaint event....
I hope to help.
me too!!!
Carlos Antollini.
|
|
|
|
|
Thanks for the answer!
I´m working on a ColorPicker. That means for every color that should be displayed in the right column, i must create an rectangle and fill it with the rgb data... argh is this idea working with the LV_ITEM structure? and how can i fill the rect ???
bye b4ckup (:
|
|
|
|
|
|
FYI, there are a bunch of nice color pickers available at http://codeproject.com/miscctrl/.
/ravi
"There is always one more bug..."
ravib@ravib.com
http://www.ravib.com
|
|
|
|
|
Ok, thanks a lot
bye b4ckup (:
|
|
|
|
|
Hi all,
How can i put Checkbox into one of CListCtrl (in Report mode) or Flex Grid rows ?
I need help !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Set the LVS_EX_CHECKBOXES extended style in CListCtrl or use 'item state images' for checkboxes (in fact LVS_EX_CHECKBOXES style is implemented with item state images). Note that LVS_EX_CHECKBOXES is not available on very old Win95 systems without IE 3.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Can you explain more ?
When i put LVS_EX_CHECKBOXES in extended style ... then how can i use of it ?
how can i control it ?
How can i put Ckeck in one of Checkboxes ?
or about positions, how can i set positions for it ?
Can you tell me, where can i download example about it ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have written a static library with a CDialog divivative in it, and drawn a grid on the dialog, I then wanted to traverse my grid and needed to capture key presses e.g. UP '1' '2', I did this using entries in an accelerator table. I can now capture the key presses, but each key press makes a beep, is there any way to disable this beep?
also is there any way to stop the up,down,left and right keys from changing the currently focused button or component??
cheers!!
Andy
|
|
|
|
|
Hey...I'm writing a C++ program in straight-out API (no MFC or anything). How do I keep a window from having a maximize button? DO I put it in the class definition or when I CreateWindow? Also, how do I make it so the borders are NOT sizeable? Any help would be appreciated, thanks. - Dave
|
|
|
|
|
Do not use WS_THICKFRAME and WS_MAXIMIZEBOX when you call CreateWindow[Ex]. Note that WS_OVERLAPPEDWINDOW is a combination of multiple styles, including thickframe and maximizebox. Have a look at its #define in winuser.h
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Can anyone tell me what's wrong with this code:
CMenu menu;
CMenu *submenu;
menu.LoadMenu(IDR_POPUP);
submenu = menu.GetSubMenu(0);
submenu returns NULL
The menu looks as follows:
[POPUP]
Menuitem 1
Menuitem 2
...
|
|
|
|
|
Everything seems to be in order... You can try two things:
1. Cut and post the menu definition from your .rc file (open with Notepad and search for IDR_POPUP ).
2. Try with "Rebuild all". Sometimes the IDE looses track of changes in the resources and begins doing funny things.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Hi,
Has anyone run across this problem when after installing the August SDK this error message appears during the IDL build phase?
If so, what was your solution to get rid of it? I created a project using the ATL COM wizard and when I try to build the very code it generates this error message appears. I have done a search on my hard drive and can not locate this file. I have also tried looking for this error message on MSDN but to no avail.
Is there a preproccesor definition to get rid of XML support in a ATL COM file? This is ridiculous the COM program I am building does not require XML support, and why would MS include XML support and not have the right idl files to support just a plain vanilla build of Wizard generated code?
I have also tried d/l the latest MS XML SDK and that did not work either it did not include this file as well.
Thanks in advance for any help or comments!
Sam C
----
Systems Manager
Hospitality Marketing Associates
|
|
|
|