|
Ok, but there i must derive many functions from the Template classes.
I startet like this:
i created a new class, derived from CMDIChildWnd
There i can store all informations i want.
At the Create-Event i associate with the Frame the View:
CCreateContext CC;
CC.m_pNewViewClass = RUNTIME_CLASS ( MyView );
CC.m_pCurrentFrame = this;
MyView* ActView = DYNAMIC_DOWNCAST( MyView, this->CreateView(&CC) );
if(ActView) {
ActView->ShowWindow(SW_SHOW);
ActView->OnInitialUpdate();
// Set this view active
SetActiveView(ActView);
RecalcLayout();
ActView->ResizeParentToFit(FALSE);
//RecalcLayout();
}
it works, but the border of the frame is displayed very confused.
The Minimize&Close Buttons are fixed ( aren't all the time in the right corner )
And the Dialog in the View has a wrong size ...
You have already made an application like this?
I'm more than one week over this problem
Thanks
Sprichst du besser Deutsch? Ou plustot francais?
|
|
|
|
|
I have a difficulty...
when I want to make a LPCSTR variable, I do this:
LPCSTR test = TEXT ("hello");
Now I want to make a LPCSTR,including "hello" + name of a persion, which changes every time.
I can't do below:
CString name = "John";
LPCSTR test = TEXT ("hello" + name);
or
CString name = "John";
name = "hello" + name
LPCSTR test = TEXT (name);
please tell me how to do to achieve that result, or show me some pages related to changes of LPCSTR.
|
|
|
|
|
vtalau wrote: CString name = "John";
LPCSTR test = TEXT ("hello" + name);
This should not be done.
Always use TCHAR types with TEXT and _T , else when you compile with _UNICODE defined it could lead to waste of time.
You can do likewise...
CString name = _T( "Nibu " );
name += _T( "Hello" );
LPCTSTR test = name; There is no need to wrap name inside TEXT() . You should be careful when using statements like
LPCSTR test = name; So always adopt a generic approach. Try to use _T() or TEXT() wherever possible along with their counterparts like LPCTSTR .
|
|
|
|
|
Nibu babu thomas wrote: name += _T( "Hello" );
Just a detail, but this should be
name = L("Hello")+name;
otherwise: "Nibu Hello"
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Rage wrote: otherwise: "Nibu Hello"
|
|
|
|
|
vtalau wrote: TEXT
Never seen this...
CString str="Hello "+name;
LPCTSTR string = str.operator LPCTSTR();
or
CString str="Hello "+name;
LPCTSTR string = (LPCTSTR)str;
Also, see this[^]
~RaGE();
I think words like 'destiny' are a way of trying to find order where none exists. - Christian Graus
|
|
|
|
|
Dear all
I write one small program to read and write data to Parallel mode in ECP mode.
I write one thread for this purpose. but when I stop and start the thread, Cpu usage of computer goes to 98% .
Do you know what is the source of this error.
Regards
Monhi
|
|
|
|
|
had u tried to debug n see where the actual problem comes i mean code that take the CPU to 98%
Tasleem Arif
|
|
|
|
|
What's going on in your thread? Polling in a loop?
You need to give other threads some time too!
|
|
|
|
|
Hello all
I have a dialog box on which a bitmap is loaded with LoadBitmap function . Its static . But if I change the display settings from 96 to 120 DPI then the dialog appears big but bitmap is not streched. Can anyone please tell me how to redraw my bitmap so that it fits to the dialog with new DPI ?
redindian
|
|
|
|
|
I think you asked this question did you see my reply?
|
|
|
|
|
Hi
In fact i saw your answer , but I did not understand when you said the bitmap does not display .
In fact bitmap is displayed but it has not streched to the new size of dialog . The bitmap size remains static .Can you please help me how I can increase it to the new size due to increase in DPI from 96 to 120 ?
redindian
|
|
|
|
|
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?
|
|
|
|