|
Hi..
In CView application I am showing a dialog(Like toolbar/ Status bar).
I have to change the dialog background color.
I used the following code. But background color not changing. If i use this same in new dialog application the background color is changing.
ON_WM_ERASEBKGND()
BOOL CTech::OnEraseBkgnd(CDC* pDC)
{
CRect rect; GetClientRect(&rect);
CBrush myBrush(RGB(255, 0, 255));
CBrush *pOld = pDC->SelectObject(&myBrush);
BOOL bRes = pDC->PatBlt(0, 0, rect.Width(), rect.Height(), PATCOPY);
pDC->SelectObject(pOld);
return bRes;
}
How to solve this problem.
Any help will be appriciated..
Thanks...G.Paulraj
|
|
|
|
|
I do not think that this is the message for the dialog's background repaint. Take a look at the WM_CTLCOLORDLG[^] notification. txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
It is working fine in form based applications... G.Paulraj
|
|
|
|
|
Paulraj G wrote: It is working fine in form based applications...
What has that to do with a Dialog? Did you follow the link I posted, and try using the methods suggested by Microsoft?txtspeak is the realm of 9 year old children, not developers. Christian Graus
|
|
|
|
|
Hello,
I am using VS2008 and OS Win XP. I create one application and uses the following function for writing the CD and it works fine.
SHGetFolderPath();
CoCreateInstance();
pICDBurn->HasRecordableDrive();
pICDBurn->GetRecorderDriveLetter();
pICDBurn->Burn();
When i deploy this application on OS Windows 2000, these function fails.
Is Win 2000 does not support this API or functions?
If i have to write CD in win 2000, what changes i have to made in this application or any other way to write CD?Abhijit
|
|
|
|
|
Usually error handling is helpful in such cases.
However, reading the
Minimum operating systems=Windows XP
info in the documentation [^], is priceless.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanks for your help.
Is there any other way to write CD on Win 2000?
|
|
|
|
|
Probably there is, unfortunately I haven't found it (for instance IMAPI too are not supported).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi,
How to hide the dialogbox in win32. I tried ShowWindow(hWnd,0) in Initdialog()but fails to hide.
|
|
|
|
|
you can only hide a dialog if you have already created it.
A simple way is to only create a dialog if it has to be shown Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
KarstenK wrote: A simple way is to only create a dialog if it has to be shown
I think the OP wants a hidden dialog.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
If the dialogbox is the main window of your application look for the m_nCmdShow member of your CWinApp class. This member could be set in the InitInstance() method of your app.
Here is an article about it: A Simple Method to Control the Startup State of an MFC SDI Application[^]
If it is not the main window try to remove the WS_VISIBLE style from your dialog template.
|
|
|
|
|
Handle the first WM_PAINT message and call ShowWindow(hWnd, false); there. Because that's the first message that will be posted to the dialog after it's created.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
If you are using MFC, see the first part of this article."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hello,
I created one application in MFC using Visual Studio 2008. I want to run this application exe on OS Windows 2000. When i run this, it gives error about .dll files.
How can i run this application on OS Windows 2000?Abhijit
|
|
|
|
|
|
Hello,
I run this vcredist_x86.exe on Windows 2000 but it gives error message
"The procedure entry point HeapSetInformation could not be located in the dynamic link library KERNEL32.dll"
What could be the problem.Abhijit
|
|
|
|
|
Select 'Project/Properties' to bring up your project's property sheets. Select the 'Configuration Properties/General' tab. Set 'Use of MFC' to 'Use MFC in a Static Library'.
Rebuild.
You might also want to check out this[^], and download the Dependency Walker[^].L u n a t i c F r i n g e
|
|
|
|
|
Hello,
I change project properties from Use of MFC- Use MFC in a shared DLL to
Use MFC in Static library, but size of application make it to large.
Use MFC in a Shared DLL - size is 50 KB
Use MFC in Static library - size is 500 KB
How can i create minimum size exe or is there any option.Abhijit
|
|
|
|
|
50K are less than 500, but 50K + the size of the MFC DLL are much more than 500!
If you don't want DLL dependency, static linking is a must.
If you want small sizes, welcome in the DLL hell!
2 bugs found.
> recompile ...
65534 bugs found.
|
|
|
|
|
Abhijit D. Babar wrote: Use MFC in a Shared DLL - size is 50 KB
Use MFC in Static library - size is 500 KB
Unless you have strict requirements on the executable size (for instance if you need to send the executable on a slow line) such figures are irrelevant: whenever the executables becomes processes (i.e. are loaded by the OS ) the amount of wasted memory is roughly the same.
On the other hand, if an efficient executable is needed, why are you using MFC ?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
you need to build a setup to install the MFC-Runtime. Press F1 for help or google it.
Greetings from Germany
|
|
|
|
|
Sorry sir, i am not geting what you mean to say.
|
|
|
|
|
Goto build option, click on that for build tthe application, and goto debug option click 10 to execution, it will help to what happening in line by line
|
|
|
|
|
In addition to everything below, you need to make sure you don't use any Win32 APIs not in Windows 2000.
To do that you need the following #defines before you include any files in your stdafx.h:
#define _WIN32_WINNT 0x0500
#define WINVER 0x0500 Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
CodeProject MVP for 2010 - who'd'a thunk it!
|
|
|
|