|
There's more to this than what you've provided. I was able to create a dialog-based project with three controls. The first control has the initial focus. When I disabled the second control, focus remained on the first control. Pressing the Tab key changed focus to the third control.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
I have combo box control (1st control) . When you change current selection using arrow keys, OnSelectionChanged handler will recognize that certain item was selected and will call EnableWindow(FALSE) to some another button (2nd control). When you hit down arrow key again, instead of changing current combo box item, the 3rd control in the dialog is focused
rrrado
|
|
|
|
|
Something else is still at play here. I duplicated your layout and it still worked fine. Your best bet is to create a temporary dialog-based project with just those three controls on the dialog template, and a ON_CBN_SELCHANGE() handler. What does that yield?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Thank you for your time ! Clean dialog works for me too, I'll find out what's going on in my project.
thank you !
rrrado
|
|
|
|
|
Hi guys,
I've been trying to load bitmaps into my dialog. I have one picture control and i have 2 bitmaps that i want to use.
this is part my code in general:
if (Firstsituation)
{
thisimage.SetBitmap(bmp1);
}
else
{
thisimage.SetBitmap(bmp2);
}
I'm wondering why it keeps on loading the image i have at default at my picture control properties. I just can't load them the way I want them to.
Even when I remove the code for LoadBitmap(CONTROL), it still executes the project, though a bit of code is missing. Anyone who can enlighten me? I'm kinda confused.
waxiegal
|
|
|
|
|
|
Hello,
I tried to use __try __except in a certain function, and the compiler said, "Can't use __try in a function that requires object unwinding."
Does "object unwinding" refer to objects declared on the stack?
Does it imply that if all the objects used in the function happen to be on the heap, then I can use __try __except?
Thanks,
Rich
|
|
|
|
|
See here and here.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Hello folks, need ur help....
I have a SDI application, and in the IDR_MAINFRAME menu resource the last one is the Help. Below the About menu item, i added another one 'Info' to show a dialog box showing a brief description of the application. In the Frame class i did a message map for the menu item which call DoModal for the dialog box. But the problem is that when i run the application, the newly added menu item is inactive and is not responding. What do i do to solve this???
God is Merciful...
|
|
|
|
|
|
If we draw a line on paper by:
MoveTo(0,0);
LineTo(1000,0);
the horz line is not at topmost of paper, there is a top margin.
how to adjust width (or height or distance) of the margin?
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
|
GetViewportOrgEx() return (0,0);
so the value (0,0) is not (0,0) on paper.
If I don't know width of original margin, how to adjust it?
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Hello everyone!
OK, here's some previous declarations/definitions:
<br />
char ** mapLayers;<br />
<br />
#define WIDTH 512<br />
#define HEIGHT 384<br />
Now, look at my func:
void Mazzee::GetMapInfo(std::string map)<br />
{<br />
this->mapLayers = (char**)new char[3][(WIDTH/32)*(HEIGHT/32)];<br />
<br />
FILE * f[3] = {fopen((map + ".ml1").c_str(), "rb"), fopen((map + ".ml2").c_str(), "rb"), fopen((map + ".ml3").c_str(), "rb")};<br />
<br />
int p;<br />
while (p < (WIDTH/32)*(HEIGHT/32))<br />
{<br />
for (int x = 0; x < 3; x++)<br />
{<br />
p = 0;<br />
<br />
if (feof(f[x]))<br />
return;<br />
<br />
int v = fgetc(f[x]);<br />
if (v > 32)<br />
{<br />
this->mapLayers[x][p] = v;<br />
++p;<br />
}<br />
}<br />
}<br />
}
Why won't it work?! Thanks!
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
int p;<br />
while (p < (WIDTH/32)*(HEIGHT/32))
Where is "p" initialized?!?
Steve
|
|
|
|
|
Although it's not the problem, this is C++, it can't be C. So why are you using C file handling ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
I was wondering that - especially since he's using std::string but then has to call c_str every time he wants to use the string.
Steve
|
|
|
|
|
((map + ".ml1").c_str()
Calling c_str on a temporary object like this is asking for trouble - Although I think it's probably safe in this instance.
Steve
|
|
|
|
|
Kixdemp wrote: Why won't it work?!
Most likely because you have not told us what the problem is.
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
Stephen Hewitt:
Initialized p... nothing.
Christian Graus:
I didn't know there was C++ file handling...
DavidCrow:
Oops... sorry! The problem is that it shows me a "Mazzee 2.exe has encountered a problem and needs to close. We are sorry for the inconvenience"
(Why is Microsoft sorry anyways? They didn't make my app...)
Hmm... I was wondering... how do you debug the app from the Release directory, where all the files needed are? Or, where does the debug run from? Thanks!
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
Actually... the problem's right here:
this->mapLayers = (char**)new char[3][(WIDTH/32)*(HEIGHT/32)];
I tried this:
this->mapLayers[1][3] = 'v';
I put a SDL_Delay(5000); before it, it delayed for 5 seconds, and then crashed. I put it after it, and it crashed immediately. What could be wrong with that declaration?
Thanks!
Lord Kixdemp
www.SulfurMidis.com
www.SulfurSoft.tk
[ftp://][http://][hotline://]tsfc.ath.cx
|
|
|
|
|
it is easy to get screen size in pixels.
but, how to get screen size in millimeters or inches?
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
You need to look at the GetDeviceCaps API, in particular the HORZSIZE and VERTSIZE flags.
Steve
|
|
|
|
|
the function GetDeviceCaps is trick.
I tested several monitors but it doesn't work well.
currently I test with a 15 inch monitor, the function returns:
width=211, height=158.
it is not correct, actual size is over 270x210 mm^2.
what is problem?
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Does windows correcty report your monitor type?
Steve
|
|
|
|