Dialog based application with background
-
Hello! I make simple dialog based programs. I make them with resource editor VS.NET 2003. When I create dialog it is grey. After I put some other controls on it. What is the easiest way to make Dialog based application with some background of some predefined background (picture)? Instead of grey there would be some picture. Best regards, Rostfrei
-
Hello! I make simple dialog based programs. I make them with resource editor VS.NET 2003. When I create dialog it is grey. After I put some other controls on it. What is the easiest way to make Dialog based application with some background of some predefined background (picture)? Instead of grey there would be some picture. Best regards, Rostfrei
Hi Rostfrei , if you need to paint dialog use WM_CTLCOLOR and if you want to draw picture I suggestion that use picture's in the WM_PAINT and the use handle dc
-
Hello! I make simple dialog based programs. I make them with resource editor VS.NET 2003. When I create dialog it is grey. After I put some other controls on it. What is the easiest way to make Dialog based application with some background of some predefined background (picture)? Instead of grey there would be some picture. Best regards, Rostfrei
include ->atlImage.h //in h file CImage m_Image;//in h file m_Image.Load("c:\\picture.bmp");//[in the OnInitDialog(example)] in function Onpaint CPaintDC dc(this); // device context for painting m_Image.BitBlt(dc.m_hDC,CRect(0,0,800,600),CPoint(0,0));
-
include ->atlImage.h //in h file CImage m_Image;//in h file m_Image.Load("c:\\picture.bmp");//[in the OnInitDialog(example)] in function Onpaint CPaintDC dc(this); // device context for painting m_Image.BitBlt(dc.m_hDC,CRect(0,0,800,600),CPoint(0,0));
When I include atlImage.h I get many errors like: LIBCMTD.lib(dbgheap.obj) : error LNK2005: _malloc already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(dbgheap.obj) : error LNK2005: _free already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: _exit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __exit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __cexit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0dat.obj) : error LNK2005: __c_exit already defined in msvcrtd.lib(MSVCR71D.dll) LIBCMTD.lib(crt0init.obj) : error LNK2005: ___xc_z already defined in msvcrtd.lib(cinitexe.obj) and so on... What shoild I do? Rostfrei
-
include ->atlImage.h //in h file CImage m_Image;//in h file m_Image.Load("c:\\picture.bmp");//[in the OnInitDialog(example)] in function Onpaint CPaintDC dc(this); // device context for painting m_Image.BitBlt(dc.m_hDC,CRect(0,0,800,600),CPoint(0,0));
It works!!! I can't thank you enough!!! To resolve linkage problem I had to Ignore specific library: libcmtd.lib The problem is described on http://discuss.microsoft.com/SCRIPTS/WA-MSD.EXE?A2=ind9710a&L=atl&P=5867[^] in project settings. Now it works just as I wanted. Ah yes, for anyone else reading this you have to include #include before #include like:
#include "afxstr.h" #include "atlimage.h"
Thank you! Regards, Rostfrei