|
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()
|
|
|
|
|
What kind of thread is it? If it is a worker thread, one solution is messages. Send a message to main frame and have it update the control.
Kuphryn
|
|
|
|
|
hello
i have add a DIALOGBAR and i have add in SLIDER. i want to attach one variable to this
SLIDER but when i go to the ClassWizard and i choice classename:CMainFrame i can't find
the the obectID IDC_SLIDER1 but i find it in the Classname :CAboutDlg.and i want to use
it in the calss CMainFrame.
and when i click on MessageMaps and choice class CMaiframe i can't add any variable??
|
|
|
|
|
Hi,
I'm not sure of what you trying to explain here. You use somebody else app? If it's an app that you have created with the wizard then the first "dialogbar" that is created is not a "dialogbar" but it is a toolbar. You have the choice not to use it into your app in the MFC wizard.
Everything's beautiful if you look at it long enough...
|
|
|
|
|
I have been given a VC++ 6 dll which has no documentation and no code. I need to find out what functions are available in this dll. Does anyone know of a utility somewhere that can show you the public functions of a dll?
Something similar to Lutz Roeder's .NET Reflector[^], but for a VC++ 6 dll.
Thanks,
Mark Sanders
|
|
|
|