|
What will the /Y3 option do for me?
It displays the compile/link times in the output window.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Are you using incremental linker (for your debug builds)? It may be slower the first time but it should be faster afterwards if only few files have changed.
Also, you could verify that linker options and disable some of them in you debug builds.
Also, a tip is too avoid running other disk intensive application at the same time. This effectively could increase link time a lot.
And limit the debugging informations in file where it is not so usefull. Probably for many files, line information will suffice and linking an application without much debug information could be much faster.
Philippe Mori
|
|
|
|
|
Challenge: How do you determine the physical dimensions of your pixels/monitor?
There must be a smart way of determining the real size of a pixel, or at least figuring out the width:height ratio!
I can't believe that information has not been stored with the video driver but unfortunately it seems to be the case.
Does anyone know of some clever way to work out the physical monitor view dimensions? Implicitly this could mean working out the real pixel size, pixel ratio, pixels per inch...
I know there's information to retrieve using GetDeviceCaps but they are for some strange reason fix values. They don't change!!! Why is that?
There's a huge prize waiting for you if you accept and solve this quiz/challenge... Well, not really, but I'd be very grateful!
And measuring the screen by hand does not count!
/Tommy
|
|
|
|
|
I don't think you can get 'real' sizes. The way to calculate pixel ratio and draw rulers with inches/centimeters is to use GetDeviceCaps with LOGPIXELSX/LOGPIXELSY.
I know there's information to retrieve using GetDeviceCaps but they are for some strange reason fix values. They don't change!!! Why is that?
Probably it's because video driver doesn't care if monitor has 15 or 49 inches And imagine a CRT projector connected to your graphics card which displays an image on the wall. In this case, these values would depend on the distance between the device and the wall Your machine would have to be equipped with some sonar system.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Ok, that's what I thought... But are you saying that you can create rulers in inches/centimeters using the LOGPIXELSX/Y? Ok, you can create them but they will not reflect the real size on screen right?
Intuitively it feels like there's a solution to this... just gotta get someone to find it!
/T
|
|
|
|
|
Ok, you can create them but they will not reflect the real size on screen right?
Exactly. That's why the parameters you pass to GetDeviceCaps are called 'logical' pixels, not 'real' pixels. One more reason for that: you have controls in your monitor for adjusting the width and height of actual picture displayed on the screen - your graphic card is of course unaware of these adjustments.
If you find any program that draws rulers using *real* centimeters/inches, let me know
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Try these functions:
void MyFunc(CDC* pDC)
{
int logx = pDC->GetDeviceCaps(LOGPIXELSX);
int logy = pDC->GetDeviceCaps(LOGPIXELSY);
int nMM = 100;
int nPixelsX = MmToPixels(nMM, logx);
int nPixelsY = MmToPixels(nMM, logy);
}
int MmToPixels(int mm, int LogPixels)
{
return ((int)((long)mm * LogPixels / 25.4));
}
int PixelsToMm(int Pixels, int LogPixels)
{
return (int)(Pixels * 25.4 / LogPixels);
}
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
To determine the "viewable area", get the horizontal and vertical resolution windows is currently set to, and convert those pixel values to millimeters (using the PixelsToMm function). If you need it in inches, it is a simple matter to convert mm to inches, and there you have it.
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Well, I appreciate your help, but the result is not real size...
For instance, GetDeviceCaps(LOGPIXELSX/Y) returns a value that is fixed and doesn't depend on any physical settings made on the monitor or even changes made in resolution and physical monitor size. If it would, then everything would have been fine.
Try for your self and measure your screen.
/T
|
|
|
|
|
Hi!
I've been trying to send keystrokes from say Window1 to Window2. It's easy when Window2 is the active one. However, I want to send it keystrokes even when it's not the active window. The code I've written for Window1 looks like below:
PostMessage(hWnd, WM_KEYDOWN, VK_CONTROL, MAKELPARAM(0x1, MAKEWORD(MapVirtualKey(VK_CONTROL, 0), 0x00)));
PostMessage(hWnd, WM_KEYDOWN, 'B', MAKELPARAM(0x1, MAKEWORD(MapVirtualKey('B', 0), 0x00)));
PostMessage(hWnd, WM_CHAR, 'B', MAKELPARAM(0x1, MAKEWORD(MapVirtualKey('B', 0), 0x00)));
PostMessage(hWnd, WM_KEYUP, 'B', MAKELPARAM(0x1, MAKEWORD(MapVirtualKey('B', 0), 0xC0)));
PostMessage(hWnd, WM_KEYUP, VK_CONTROL, MAKELPARAM(0x1, MAKEWORD(MapVirtualKey(VK_CONTROL, 0), 0xC0)));
The problem seems to be this - Window2 has 'Ctrl-B' defined as an accelerator. So, when one actually presses 'Ctrl-B' in Window2, the TranslateAccelerator function in Window2 translates the keystrokes to WM_COMMAND message. However, when the same keystroke sequence is sent programmatically, it doesn't get translated to WM_COMMAND.
Can someone help me out with this please.
Vijay Chauhan
|
|
|
|
|
Try to use
keybd_event()
or
SendInput()
Eventually try to activate application first.
|
|
|
|
|
Thanks, but I've already tried using SendInput. However, I don't really want to activate the other window before sending it the keystrokes. I want to continue working with the current window, while simultaneously updating the other window, even if it's minimized.
|
|
|
|
|
Hi,
I have a connection to an active Internet explorer window, where I call the Navigate2 method to download a http page. After calling this navigate method I would like to stop the current thread processing and wait for the web browser to completely download the page.
I currently have the following code,
m_webBrowser.Navigate2(URL);
while(m_webBrowser.GetBusy())
{
DWORD res = WaitForSingleObjectEx(m_webBrowser.GetBrowserWnd (),20000,TRUE);
}
but the method GetBusy() of web browser returns false after only a couple of milliseconds, but I know full well that the page is not yet downloaded. Also the function WaitForSingleObjectEx returns in a complete state.
What I woul ideally like to do is stop within this while loop and wait until the web browser has completely loaded the page, where I can then call the GetHtmlDocument method.
Any ideas
Thanks
CAB
|
|
|
|
|
Hmmm, I don't know. GetBusy has worked fine for me in the past, but then again I was using Navigate not Navigate2. I don't know why in your case it returns false before it should...
As an alternative, you may wanna use the OnDownloadComplete event handler and have it signal an event that you then check inside WaitForSingleObject. I've never done that before; I used your technique and it worked fine.
Good luck!
Alvaro
|
|
|
|
|
Hi,
I am writing an app which communicates with a server using tcp/ip sockets over the internet. What I want to be able to do is add support for connecting via a SOCKS5 proxy server. Has anyone got any suggestions for how to go about it?
James Spibey
I love the word naked, it's brilliant isn't it, 'naked'. When I was a kid I used to write the word naked on a bit of paper hundreds of times and rub my face in it - Jeff, Coupling, BBC2
|
|
|
|
|
hey guys
is there anything i can do like put an entry in the registry to get windows to delete a file when its next starts up. I could write a program and stick it ibn run once but that seems overklill when all i need to do is get windows to start up and delete a file and it only has to do this once.
Any ideas
Cheers
Peter
|
|
|
|
|
On NT, use MoveFileEx(). On 9x/Me, you need to edit %WINDIR%\wininit.ini. On 95, it should look like:
[rename]
NUL=C:\your\file\here.exe On 98/Me it's easier and can be done with WritePrivateProfileString():
[NUL]
c:\your\file\here.exe=1 Be aware that this file gets processed in real mode DOS, so you must use only short filenames.
--Mike--
http://home.inreach.com/mdunn/
#include "witty_sig.h"
your with and
|
|
|
|
|
Is there a way to open a message box in a particular place on the screen ???
elisabeth.sever@europlacer.fr
|
|
|
|
|
AFAIK, the only way is to use CBT hook and respond to HCBT_ACTIVATE notification. If you're not allergic to Visual Basic you may find KB article Q180936 helpful. It's titled 'HOWTO: Position a MsgBox Using a Windows Hook Procedure'
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Cool!
Thanks for the info Tomasz...
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
Nope! You cannot!
If you are very specific about where you want it to come you can write your version of MessageBox and call it instead of using the standard MessageBox.
I am not sure, but there should be something in CP!
Nish
Sonork ID 100.9786 voidmain
|
|
|
|
|
I want to have a very flat frame, flat tool bar and flat menu, also there is no separate line between the tool bar and menu.
Thank you.
|
|
|
|
|
I need to trap any authentication that the domain makes for any principal, and add my condition to the procedure. I need to check if the prinicipal exists in my special DB and only if so the principal will be able to get the folder/file/process etc on the domain.If you have any relevant information I will be thankful!!!
B"H
|
|
|
|
|
Hi, All!
========
Is there a MSDN for windows XP ?
Thanks.
|
|
|
|
|
Do you mean "does MSDN include docs for windows XP development"? If so, yes it does. Furthermore, the last Platform SDK (now called something else, Windows SDK I think) include everything you need for XP (but not .NET)
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|