|
You'll notice I qualified my statement by saying "Currently, the int and long variable types are both 32-bit signed integers". This statement is true for C++ compilers used in the Windows environment (any other environment doesn't apply; this is a Windows programming site, after all). I didn't think it necessary to be pedantic about it, given the elementary nature of the original question.
Software Zen: delete this;
|
|
|
|
|
Hi,
I have two radio buttons. onselecting one of the choices i want another text box to get enabled or become visible.
how can i implement either of these actions ?
Thanks
U get wht u Give
|
|
|
|
|
To Enable/Disable, use either :
EnableWindow(TRUE);
EnableWindow(FALSE);
To Show/Hide, use either :
ShowWindow(SW_SHOW);
ShowWindow(SW_HIDE);
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
hi
I have Try alot to search chat application which is writen in the dialog eviroment but no found
i want it in the simplest of it`s example and briefly
explanation of it
|
|
|
|
|
|
Hi all,
Is there anyway to prevent losing data when trying to convert the float into long?
e.g:
float M=floor(13.22);//M=13
long N=long(M);//N=12????
Thanks.
Grenouille
|
|
|
|
|
|
By definition, you are going to lose data when going from float to long. What might be happening is that M=12.9999999 and thus returns 12 when doing the type conversion. Try this "long N = long (N + .5);". This is technically a round, but will avoid the whole problem with floating point numbers being inexact.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
HI
How can i use the values in one dilog box in another dilog box.
Can we pass values from one dialog box to another?
Thanks
U get wht u Give
|
|
|
|
|
|
basically, you have to pass the value to the new dialog's constructor...
so, you have to overload the constructor of your dialog's class, which contains as parameters the values to pass to it...
to recover the values after the dialog treated them, you could either read the members into the dialog object (still existing when dialog has closed) if the members are public, or you pass to the costructor some references.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
make a general class..... letz say CInfoz class,which has got all the information u need to pass to the second dialog.....
make an instance of the CInfoz class in both the dialog classes.....
then pass this infoz object whenever u open the new dialog .....eg:
say from one dialog class we call the second dialog...
dialog one
{
...
...
..
dlg = new CCreamzDlg;
dlg->infoz=infoz;//update the information
...
...
...
}
i hope u find thiz helpful!!!!!
cheerz.....
"faith, hope, love remain, these three.....; but the greatest of these is love" -1 Corinthians 13:13
|
|
|
|
|
Hi all:
The DC is available, but how can i get what the color of brush is in it, and also some other parameters in it, such as pen etc.?
GetObject()?
|
|
|
|
|
Hello Kwib,
if you are using MFC,here is answer
GetCurrentBrush - Returns a pointer to the currently selected CBrush object.
GetCurrentFont - Returns a pointer to the currently selected CFont object.
GetCurrentPalette - Returns a pointer to the currently selected CPalette object.
GetCurrentPen -Returns a pointer to the currently selected CPen object.
[Vote One Here, Complete my Survey....]
Alok Gupta visit me at http://www.thisisalok.tk
"I Think Believe this Will Help"
|
|
|
|
|
Thanks ThatsAlok
But I'm working under plain c, should I call it SDK environment?
|
|
|
|
|
|
Greetings,
I am trying to change the size of a FormView application after I have resized a control and I must be missing something essential.
I can get the window to resize (smaller), but then scroll bars appear that weren't there before. I suspect it is something inherent to how a FormView works as when I resize smaller manually, the scroll bars appear even though no controls are obscured.
I suspect I have some setting in the FormView wrong since it doesn't behave with manual resizing.
Anyway...
My current approach is to call AfxGetMainWnd()->GetWindowPos(), adjust the values and then call SetWindowPos(). Then I call ResizeParentToFit() which almost does the job.
Here is a code fragment. The control involved is a CListCtrl...
WINDOWPLACEMENT wpMain, wpOldList;
AfxGetMainWnd()->GetWindowPlacement(&wpMain);
m_RecordList.GetWindowPlacement(&wpOldList);
... make the size and content changes to the list ...
WINDOWPLACEMENT wpNewList;
m_RecordList.GetWindowPlacement(&wpNewList);
int sizeChange = wpOldList.rcNormalPosition.right - wpNewList.rcNormalPosition.right;
wpMain.rcNormalPosition.right -= sizeChange;
AfxGetMainWnd()->SetWindowPlacement(&wpMain);
ResizeParentToFit();
Any hints would be greatly appreciated. Thanks!
|
|
|
|
|
I'm not sure to understand, so I hope I won't provide a bad answer.
As I understand it, you want to force the size of your application. I would do so by resizing the MainFrame object, using CMainFrame::SetWindowPos. Then I would catch the WM_SIZE message in the Form View to handle controls size and position changes.
Oh, and you can manage the way your view handles scroll bars by overring CScrollView::SetScrollSizes.
HTH,
|
|
|
|
|
K(arl) wrote:
As I understand it, you want to force the size of your application. I would do so by resizing the MainFrame object, using CMainFrame::SetWindowPos. Then I would catch the WM_SIZE message in the Form View to handle controls size and position changes.
Yes, I want to set the size of the application. I've tried using SetWindowPos(), but it works no better.
Catching the OnSize stuff would not help as the control has already been sized; there is nothing to be done. Manually (or rather programatically) adjusting the scroll bar is something I would like to avoid.
For now, I am using a kludge by setting the original size of the Formview and the control that gets resized (in the visual dialog editor) to something absurdly small. Then when I load up the control and resize it, I can also resize the MainFrame and it seems to work. No annoying, unneeded scrollbars appear. But this seems like an inelegant solution. Surely there is a better way!
|
|
|
|
|
I suppose the code you indicated is in a method of the Form View, right? Did you try to resize the view using /*CFormView::*/SetWindowPos() instead of AfxGetMainWnd()->SetWindowPos() (which would resize the main frame) and then calling ResizeParentToFit which should resize the Main Frame according to the size of the view?
|
|
|
|
|
I'll try that when I get home.
Thanks!
|
|
|
|
|
K(arl) wrote:
As I understand it, you want to force the size of your application. I would do so by resizing the MainFrame object, using CMainFrame::SetWindowPos. Then I would catch the WM_SIZE message in the Form View to handle controls size and position changes.
Oh, and you can manage the way your view handles scroll bars by overring CScrollView::SetScrollSizes.
OK, now I understand what you meant.
What I am doing now is use WindowSetPos() and SetScrollSizes. Pretty much as you suggested. I didn't understand from the documentation what SetScrollSizes did. It just sets the the threhold for window size for when the scrollbars appear. Which is what I needed.
Thanks for your help.
|
|
|
|
|
I know the information is out there and I am just missing it. Of course there is the overwhelming amount of information out there.
OK, here it is: I am trying to understand the VC++ .NET environment and having no luck. I have one window that has a text box and a button. The button calls another form there text is entered or edited. A button on that form hides that window. What I am trying to do is to get the edited text from the second window into the first, calling window and pass it to the text box there.
Most everything I have been seeing around is for C# and I intend on moving in that direction, but my professor has insisted we use VC++ .net for this project. Sadly, I may have no hair left when we are done.
Help?
Thom
|
|
|
|
|
When you create a second form, add a method that returns GetWindowText() from the control in question. That'll be the string. If you want to get the text AFTER the form closes, store it in a variable when the form closes, because once it's gone, it's gone
Christian
I have several lifelong friends that are New Yorkers but I have always gravitated toward the weirdo's. - Richard Stringer
|
|
|
|
|
Thanks, I will give it a try. I ahve spent a lot of time looking at help files and search engines, the lines of text are squirming. It would help if that GUI/OOP class taught more than puting pretty lines in a graphic window.
Thom
- Hind sight is always 20/20 -
|
|
|
|