|
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
|
|
|
|
|
not sure, what do you exactly mean?
photo-shop works well for any monitor, E.g. when display "print size", pictures are exactly the same size on screen as printed (E.g. for CD cover, I can put a real CD on monitor to compare its size).
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
I mean when you right click on the desktop and select properties, go to "Settings" tab, press "Advanced" and go to "Monitor" tab what does it say there. Does it mention your monitor by name or does it just say "Plug and Play Monitor". My thinking is that if Windows doesn't know what type of monitor you have it may be guessing (wrongly).
If Photoshop knows this would seem not to be the case however, unless it knows because it was told by the user when it was installed.
The call I gave you is the way you go about find the information in Windows so I'm not sure what else to suggest.
Steve
|
|
|
|
|
no one told photo-shop about screen size when installed, it detects itself.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Does this, or GetMonitorInfo() , help?
"The greatest good you can do for another is not just to share your riches but to reveal to him his own." - Benjamin Disraeli
|
|
|
|
|
the functon doesn't work for NT,95 and some of 98.
we can not use this kind functions (excluding many users).
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
Hi all,
I have a mdi app where the child frames are always maximized. I want to get rid of (remove completely) the child minimize and restore buttons, but keep the close button that appear on the menu bar.
So far, I have been able to disable the unwanted buttons in the CChildFrame::DefWindowProc function, by using
pSysMenu->DeleteMenu(SC_MINIMIZE,MF_BYCOMMAND);
pSysMenu->DeleteMenu(SC_RESTORE,MF_BYCOMMAND);
I understand that to actually remove the buttons, rather than just disable them, I need to handle the WS_NCPAINT message. Can anyone tell me how and where I would do this? (sample code perhaps)
Thanks in advanced,
-----------------
Genaro
|
|
|
|
|
Did you try ModifyStyle() or modify the window styles before its creation (in OnCreate() or else)?
I modified dialog in this way, it should work for other windows.
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
I tried that, but perhaps I just used modifyStyle incorrectly.
Can you please send me a code snippet of how you did it?
Thanks,
-----------------
Genaro
|
|
|
|
|
try
UNIT uRemove=WS_MAXIMIZEBOX|WS_MINIMIZEBOX;
//call
pYourWnd->ModifyStyle(uRemove,0);
//or call
pYourWnd->ModifyStyle(uRemove,0,SWP_NOSIZE|SWP_NOMOVE);
A nice tool for optimizing your Microsoft html-help contents.
Includeh10
|
|
|
|
|
I have a dialog box with some buttons, etc, and I wanted to make the dialog box full screen, and I was able to do that without any problems(using the code below). But I noticed that when it's full screen, that basically my dialog box has been shifted to the top left corner, with rest of the screen filled in gray to create the "full screen" effect. What I really want is my dialog to be in the center, with gray filled in around it to create the "full screen" effect. Is there any possible way to do this? Thank you!
This is where my controls show up in full screen
-----------
xxx
-----------
I would like to have my controls show up in the middle of the full screen
-----------
----xxxx---
-----------
Code I have to make it full screen:
int cx, cy;
HDC dc = ::GetDC(NULL);
cx = GetDeviceCaps(dc,HORZRES) +
GetSystemMetrics(SM_CXBORDER);
cy = GetDeviceCaps(dc,VERTRES) +
GetSystemMetrics(SM_CYBORDER);
::ReleaseDC(0,dc);
// Remove caption and border
SetWindowLong(m_hWnd, GWL_STYLE,
GetWindowLong(m_hWnd, GWL_STYLE) &
(~(WS_CAPTION | WS_BORDER)));
// Put window on top and expand it to fill screen
::SetWindowPos(m_hWnd, HWND_NOTOPMOST,
-(GetSystemMetrics(SM_CXBORDER)+1),
-(GetSystemMetrics(SM_CYBORDER)+1),
cx+1,cy+1, SWP_NOZORDER);
-- modified at 17:52 Thursday 26th January, 2006
|
|
|
|