|
Can you show snippet code
|
|
|
|
|
Hi
static CLogoStretched m_BackgroundAddOnNoe;
static CBitmap m_BitmapAddOnNoe;
if(GetDlgItem(hDlg, IDB_MAP_ADDON_10_NOE))
{
if(m_BitmapAddOnNoe.LoadBitmap(IDB_BITMAP_ADDON_10_NOE))
{
VERIFY(m_BackgroundAddOnNoe.SubclassDlgItem(IDB_MAP_ADDON_10_NOE, CDialog::FromHandle(hDlg)));
m_BackgroundAddOnNoe.SetBitmap(&m_BitmapAddOnNoe, FALSE, FALSE);
}
}
Here IDB_BITMAP_ADDON_10_NOE is the bitmap which is loaded . CLogoStreched is defined as below
I do not understand the functionalities associated with CLogoStreched ...Please tell me what you get at it...
class AFX_EXT_CLASS CLogoStretched : public CStatic
{
// Construction
public:
CLogoStretched();
CBitmap* GetBitmap() { return m_pBitmap; }
void SetBitmap(CBitmap* pBitmap, BOOL bKeepRatio = TRUE, BOOL bTransparent = TRUE, COLORREF TranspColor = RGB(255,255,255), BOOL bResizeLogo = TRUE) { m_pBitmap = pBitmap; m_bKeepRatio = bKeepRatio; m_bTransparent = bTransparent; m_TranspColor = TranspColor; m_bResizeLogo = bResizeLogo;}
void ResetBitmap() { m_pBitmap = NULL; }
private:
CBitmap* m_pBitmap;
BOOL m_bKeepRatio;
BOOL m_bTransparent;
BOOL m_bResizeLogo;
COLORREF m_TranspColor;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CLogoStretched)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CLogoStretched();
// Generated message map functions
protected:
//{{AFX_MSG(CLogoStretched)
afx_msg void OnPaint();
long GetBmWidthBytes(long bmWidth, WORD bmBitsPixel);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
redindian
|
|
|
|
|
Its not my answer you have two if,load bitmap and setbitmap to CStatic(m_BackgroundAddOnNoe) where you calculate sizes and use of streche.
|
|
|
|
|
Hi
The SetBitmap function and other functions of CStatic does not have any co-ordinate tranformation or DPI dependent functions.
So I feel CBitmap operations only should take care of the resizing issue. Have you got any ideas as to how I can stretch the bitmap from the CBitmap member m_BitmapAddOnNoe ?
I am desperate for help ....
redindian
|
|
|
|
|
Well you only increase size of window but for bitmap you need to StretchBlt your bitmap
and then set new hbitmap to your control.
|
|
|
|
|
Hi Friends,
I am new to this discussion.
I am facing Linker error while building my project.
Error is:Creating library C:\Program Files\Quark\QuarkDDS 4\QuarkDDS\XTension\OptimakerSXT2.lib and object C:\Program Files\Quark\QuarkDDS 4\QuarkDDS\XTension\OptimakerSXT2.exp
LIBCD.lib(wwincrt0.obj) : error LNK2001: unresolved external symbol _wWinMain@16
C:\Program Files\Quark\QuarkDDS 4\QuarkDDS\XTension\OptimakerSXT2.xnt : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
I have done settings like: 1) c/c++ Tab->Preproccessor->WIN32,_DEBUG,_WINDOWS,_MBCS
2) Link-> Output->wWinMainCRTStartup.
Inspite of these settings i am getting Above errors.Anybody knows, please reply me.
|
|
|
|
|
Raghavendra Pise wrote: I have done settings like: 1) c/c++ Tab->Preproccessor->WIN32,_DEBUG,_WINDOWS,_MBCS
You should also include UNICODE and _UNICODE in these defintions.
|
|
|
|
|
If i did, i will get more errors.Is there any other idea?
|
|
|
|
|
Raghavendra Pise wrote: WinMain
You are obviously missing this function into your build, e.g. there is a missing file you need to #include (maybe #include <windows.h> ?)
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Do you want to use the MBCS or Unicode character set? Your preprocessor settings say MBCS but you're using the Unicode entry point.
|
|
|
|
|
Nevermind, forget my answer, I did not read your post thoroughly.
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Thanks for your feedback.I am Using MBCS not Unicode,Can u plz tell me which Entry point i should use in LInk->Output Option?
Please send reply,if u know.
|
|
|
|
|
Thaks for your feedback.
I am already using this, #include <windows.h> header file in my project.
Is there any other header file to support WINDOWS?
|
|
|
|
|
And see here[^] maybe it some helpfuls
|
|
|
|
|
I have to implement NTP (Network Time Protocol) in C (or GCC).
Can anyone help me?
In this I have to set the System Time of my System, using System Time of Server (or optional other Server) in Network.
Please give me the steps requied to implement NTP.
|
|
|
|
|
On the project settings dialog, in the General tab, we have an option saying if MFC is to be used as a shared dll or a static library. From what little I know, if we select the static library options, MFC42.dll does not have to present on the client machine and if we select the shared option, MFC42.dll has to be installed on the client machine. Am I right? Now a dll is dynamic in nature and I believe can never be linked statically like a static library. If I am correct then how does the VC++ IDE statically link to MFC42.dll or is there an MFC static library which I am unaware of?
Any clues?
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
It’s rather simple to write an unmanaged C++ application that crashes when it performs a callback. It’s impossible to write a managed application that does the same, thanks to delegates. - Jeff Prosise
|
|
|
|
|
HakunaMatada wrote: Am I right?
Yes.
HakunaMatada wrote: I believe can never be linked statically like a static library
Yes.
HakunaMatada wrote: If I am correct then how does the VC++ IDE statically link to MFC42.dll or is there an MFC static library which I am unaware of?
I am not quite sure about what you are asking here. But if you choose the static lib, then you'll get a lib to be included in your project. I presume VC++ compiles the MFCs into the lib, it does not come as a whole in the VC++ package. (I am not 100% positive about all this, though).
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Look in the file afx.h. All the library files that are needed by MFC are listed in there.
Dynamic linking links in mfc42.lib, which causes mfc42.dll to be loaded at run time.
Static linking links in nafxcw.lib, which is the static MFC library.
You may be right I may be crazy -- Billy Joel --
Within you lies the power for good, use it!!!
|
|
|
|
|
Dear All,
I need to calculate the length of the BYTE Array. Is there any function available for doing this?
is strlen() fn supporting it ?
Thanks.
|
|
|
|
|
Sakthiu wrote: I need to calculate the length of the BYTE Array
Which BYTE array ?
Sakthiu wrote: is strlen() fn supporting it ?
No, strlen is used to calculate the length of a zero terminated string.
|
|
|
|
|
When working with raw C/C++ arrays you will have to keep track of the length yourself.
The strlen() function works on strings because it assumes that the last element of the array is zero.
|
|
|
|
|
if you have an array, you have its size, no ?
otherwise, you can use this :
#define ARRAY_SIZE(array) (sizeof(array)/sizeof(array[0]))
|
|
|
|
|
i wish to have transluscent buttoms in my dialog app. i found a class which is giving so many errors. could someone help with a tutorial, or a working code. Preferably no class.
|
|
|
|
|
What class and what errors?
|
|
|
|
|