|
Did you miss the #define new DEBUG_NEW statement at the top of your .cpp file? To squelch the compiler error, simply undefine the new operator prior to including gdiplus.h .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Or you could use ::new for GDI+ objects. That way you do not loss the DEBUG_NEW functionality in the rest of your code.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
Doh! Thanks for reminding me of the scope-resolution operator.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
i undefined new and everything went OK...but what's the functionality of DEBUG_NEW anyway..
|
|
|
|
|
saeedmalas wrote:
what's the functionality of DEBUG_NEW anyway
It implements the ability of the debugger to be able to track the line number and file name of where any memory leaks were allocated.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_mfc_debug_new.asp[^]
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it!
|
|
|
|
|
|
I beleave that this will do everything you need.
#pragma push_macro("new")
#undef new
#include <gdiplus.h>
#pragma pop_macro("new")
Thank You
Bo Hunter
|
|
|
|
|
i tried the push_macro but it didn't work!!!i think this is because the "new" in my code should be altered..
|
|
|
|
|
Hi again,
How to set the TAB ORDER of a control in runtime manually?
Can anyone help me plz?
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
in the dialog editor, Ctrl+D ("change the Tab order"), then reorganize...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
|
|
Use SetWindowPos() .
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
|
|
|
|
|
Ivan Cachicatari wrote:
How to set the TAB ORDER of a control in runtime manually?
The tab order is simply the Z-order of the windows, so to change it use SetWindowPos() as David suggested.
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi everyone,
I have a problem with hiding the vertical and horizontal scroll bars of the CHtmlView in a CFrameWnd or CDialog.
How to do it?
I did try with this code in CMyHtmlView::PeeCreateWindow function
cs.dwExStyle &= ~WS_EX_CLIENTEDGE;
cs.dwExStyle &= ~WS_EX_RIGHTSCROLLBAR;
cs.style &= ~WS_BORDER;
cs.style &= ~WS_VSCROLL;
return CHtmlView::PreCreateWindow(cs);
but it does not work!
Ivan Cachicatari
www.latindevelopers.com
|
|
|
|
|
I Am working on a win2000 pro and i want my app to the same interface as of the win xp luna theme what can i do to give my app the look of xp theme.
i have seen some programs which have the same look and feel as the xp theme wheter they are on xp ,2000, 9x, or me
|
|
|
|
|
When it doubt consult MSDN[^]
|
|
|
|
|
I have a MFC Dialog application, but now I would like to create and display an identical dialog, but with different initialisation when its created.
I thought I could use pointers to share/modife data between the displays I think thats OK.
But if I use the following to create the new dialog (in at the bottom of the dialogs OnInitDialog routine):-
g_pIDU[0] = this;
g_pIDU[1] = new CIDU_Dlg(this);
g_pIDU[1]->Create(CIDU_Dlg::IDD, GetDesktopWindow());
g_pIDU[1]->ShowWindow(SW_SHOW);
I am in a loop as never reach ShowWindow as go back into the OnInitDialog routine (which is the Main dialog initialisation).
Also problem with the InitNextDlg hence it commented out!
I dont want to add another dialog (and all the code/resources etc) to my solution as a copy of the main dialog is what I want, but is that the only way?
Any suggestions please.
|
|
|
|
|
where you call your dialog, you create a CmyDialog (for example) object before the dialog is displayed (DoModal() or Create() ).
You could make a specific constructor that receive the specific datas to initialize the dialog with. you should also have data members to store the constructor parameters, because you cannot do what you do in OnInitDialog() in the constructor (The dialog don't exist yet). Then, OnInitDialog() will be able to read the data members and create the dialog consequently.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
Sorry I dont understand what you are saying.
I declare an array of pointers to the dialogs:-
CIDUDlg g_pIDU[4]; Then in the OnInitDialog()
of the main dialog I set the first pointer:-
g_pIDU[0] = this;
So how and where do I create the second dialog and then set the pointer:-
g_pIDU[1] = ???;
sweep123
|
|
|
|
|
This is speculation - something to try if you get desperate
I think the problem here MIGHT be that you can not get the Create to work from within the OnInitDialog of the first dialog. Sometimes Windows has limitations of what functions are permitted while others are executing. So... You can post your FIRST dialog a special message to create the secondary dialogs. When the first dialog processes the message, it will no longer be within the OnInitDialog handler, and the other dialogs might create just fine.
Otherwise, I can't see anything inherently wrong with what you are doing, given that you can create child controls within an OnInitDialog call, so it might have something specifically to do with Createing the other dialogs. Or else thee is more to the problem not revealed by your code snippets.
|
|
|
|
|
ok, let's say the datas to pass to the dialog are a bool , a CString , and int .
then, you create a specific constructor :
CmyDialog::CmyDialog (<font color=#0000FF>bool </font>bFlag, CString strTitle, <font color=#0000FF>int </font>iSize)
: CDialog(CmyDialog::IDD),
m_bFlag(bFlag),
m_strTitle(strTitle),
m_iSize(iSize) {
}
of course, you had previously added the correct members to your class :
<font color=#0000FF>class </font>CmyDialog : <font color=#0000FF>public </font>CDialog {
<font color=#008000>
<font color=#0000FF>protected</font>:
<font color=#0000FF>bool </font>m_bFlag;
CString m_strTitle;
<font color=#0000FF>int </font>m_iSize;
<font color=#008000>
</font>};
then, you can call you function, let's say, when "Open" Button is clicked on the first dialog :
<font color=#0000FF>void </font>CDialog1::OnSClickOpenBtn() {
<font color=#0000FF>bool </font>b = 0;
CString str = <font color=#808080>"This is the title of my dialog"</font>;
<font color=#0000FF>int </font>iSz = 5;
CmyDialog dlg(b, str, iSz); <font color=#008000>
</font> dlg.DoModal(); <font color=#008000>
</font>}
the last thing you have to implement in you code is the following :
BOOL CmyDialog::OnInitDialog() {
<font color=#0000FF>this</font>->SetWindowText(m_strTitle);
<font color=#0000FF>if </font>(m_bFlag) {
<font color=#008000>
}
<font color=#008000>
</font> <font color=#0000FF>return </font>TRUE;
}
hope you understand better now
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I new in MFC
I need to send Byte Array from VB to MFC
how to write the function
and what to write in the myfile.h
i also need to impelment the odl file
HELP ME.
thanks Pini
|
|
|
|
|
I am trying to add a "C" file to a C++ program. I get
"fatal error C1010: unexpected end of file while looking for precompiled header directive"
and it will not compile. How do I get around this problem. Conversion to C++ will be very difficult to complete.
Keck
|
|
|
|
|
disable precompiled headers with the VC++ settings > Debug, don't use precompiled Headers.
this error has no relationship with convert C to C++.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|