|
Perhaps it considers that the pts aren't actually in the region. They just make up the boundary.
Jason Henderson My articles
"The best argument against democracy is a five-minute conversation with the average voter." - Winston Churchill
|
|
|
|
|
Hello everyone, i'm wondering why simple RasEnumConnections(..) doesn't work in WinXP platforms? I mean, when i 'run' a connection with program that checks every 500ms usin RasEnumConnections(), whenever i *click* on the icon in dial-up, programs gimme a good information that i want to connect somewhere. I am after testing this on XP's - well, i have to be onest : it does not work? Any ideas why ?
|
|
|
|
|
I am interested in printing the contents of a picture control (its a bmp), and was wondering if there are any useful links that might show me how...
Appreciate your help,
ns
|
|
|
|
|
Are you wanting to render the graphic itself, or display properties about the graphic such as size, colors, etc?
|
|
|
|
|
I display the bmps in the control and wanted to put in a file menu that will print the bmp out for me. Assuming thats doable.....I read about drawtext but I dont think thats going to work to print a bmp.....
Thanks
ns
|
|
|
|
|
See if this helps:
http://www.flounder.com/printbitmap.htm
|
|
|
|
|
I am looking athis this article. Thanks.
ACtually I think what I want to do is use code to just simply print out a bmp on my hard drive. There must be some simple way? Like invoking paintbrush or something?
Appreciate your help,
ns
|
|
|
|
|
Greetings,
I have some C++ source files that have a .cc suffix and I would like them to be recognized by Visual Studio 6.0 in the same manner as .cpp. Other than renaming the files (not an option for obscure reasons), how can I get VS to compile them exactly like .cpp files?
Thanks!
|
|
|
|
|
Add the /TP to the compile parameters and it will treat all files as C++. If you just want individual files then use /TpFILENAME. Have a look here for more details
|
|
|
|
|
THAT's what I was looking for!
Thanks!
|
|
|
|
|
Is there a Win32 function that retrieves the Computers screen resolution?
Thanks
|
|
|
|
|
I use this piece of code:
HDC hDC = GetDC(NULL);
if(hDC == NULL) return(FALSE);
int nHorzRes = GetDeviceCaps(hDC, HORZRES);
int nVertRes = GetDeviceCaps(hDC, VERTRES);
int nBPP = GetDeviceCaps(hDC, BITSPIXEL) * GetDeviceCaps(hDC, PLANES);
nHorzRes is the screen width (for example 1024), nVertRes the screen height (for example 768), and nBPP the color bits per pixel (8 bit = 256 colors, 16 bit = high color, 24/32 bit = true color).
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
Great !!
but how can I get my app. notified when the user changes the resolution?
|
|
|
|
|
I don't know of any callback function that notifies you when the screen resolution changes, but why not saving the current resolution (x, y, bpp) and checking in an infinite loop if it changes? (Perhaps with a Sleep delay of 1 sec and in a thread)...
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
I believe that the system broadcasts a WM_SETTINGCHANGE message to all top level windows when the screen resolution has changed. So, in your main top-level window, simply add a handler for this message.
|
|
|
|
|
Another approach is the following:
<br />
int iScreenWidth = ::GetSystemMetrics( SM_CXSCREEN );<br />
int iScreenHeight = ::GetSystemMetrics( SM_CYSCREEN );<br />
But I'm not sure if it's win32...
|
|
|
|
|
It works without MFC yes.
MSDN says:
Width and height, in pixels, of the screen of the primary display monitor. These are the same values you obtain by calling GetDeviceCaps(hdcPrimaryMonitor, HORZRES/VERTRES).
So exactly the same as in my post above
-Dominik
_outp(0x64, 0xAD);
and
__asm mov al, 0xAD __asm out 0x64, al
do the same... but what do they do??
|
|
|
|
|
This method is good if you are using GDI for drawing (for consistency in using device context handles), however I prefer ::GetSystemMetrics for use with DirectX/OpenGL projects because I want to get away from GDI completely when using these technologies (its also the example given in the DX SDK documentation).
|
|
|
|
|
Here is my code...
How can I display my Icon to the toolbar?
Thanks
Patrick
~~~~~~~~~~~~~~~~~ SOURCE CODE ~~~~~~~~~~~~~~
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME)| !m_wndToolBar.LoadBitmap(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Delete these three lines if you don't want the toolbar to be dockable
m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
EnableDocking(CBRS_ALIGN_ANY);
DockControlBar(&m_wndToolBar);
return 0;
}
Patrick
|
|
|
|
|
Make up your mind, do you want your app's status bar, your app's toolbar, or Windows' taskbar?
|
|
|
|
|
in the app's toolbar.
from explorer I want to see my application witn the icon of my project.
Thanks
|
|
|
|
|
This solves the toolbar icon, but I also want to have it showing with explorer which currently shows an "MFC icon"
// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
SetIcon(m_hIcon, FALSE); // Set small icon
~~~~~~~
Halfway there.
|
|
|
|
|
The icon is contained in your project's res folder. Replace the MFC .ico file with one of your own, recompile, and you're done.
|
|
|
|
|
Hi,
I have a thread that needs to update a dialog.
When I use UpdateData(false) from the thread I will get an exception.
Any idea why ?
Thanks,
Shay
|
|
|
|
|
Ideas Why:
1) Not a UI Thread
2) Not the thread that owns the dialog
Possible Solutions:
1) shared memvar, updated by the thread and monitored by the dialog.
2) PostThreadMessage()
|
|
|
|