|
I can see a break in the if condition.maybe that is why the loop occurs once?
try to debug it
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi Sarvan AL,
Why you use break in your code?
|
|
|
|
|
Hi WhiteSky,
Let me explain the scenario in detail.
I have one CScrollView derived class (Type-1) and Four CFormView derived classes (Type-2). I open three objects of Type-1. From the menu, I am changing the font and like to repaint all three windows. I have only one document. The GetNextView in the while loop makes the -pos- parameter NULL when I trace.
I open the child windows using the following function, with document name "MyView".
void CProj5App::OpenForm(CString strDocName)<br />
{<br />
CString strDoc ;<br />
POSITION pos = GetFirstDocTemplatePosition() ;<br />
<br />
while(pos)<br />
{<br />
CDocTemplate *pDoc = GetNextDocTemplate(pos) ;<br />
pDoc->GetDocString(strDoc, CDocTemplate::docName) ;<br />
<br />
if(strDocName.CompareNoCase(strDoc) == 0)<br />
{<br />
pDoc->OpenDocumentFile(NULL) ;<br />
break ;<br />
}<br />
}<br />
}
Where I am wrong?
Thanks in advance,
Sarvan AL
|
|
|
|
|
Where's the class wizard in VC7.1 ? How can I handle events for my Dialog ? when I right click on the dialog, I dont find "add Event Handler" , I know I'm quite late to notice it. But please help me , is there any round about way to reach the wizard ?
NULL
|
|
|
|
|
|
Hi,
i want draw graph which has got time in sec on X-axis and on Y axis i have different parameter Say A,B,C..Say A in temprature B is VOlts etc..i.e for A,B,c X-axis is same Y-Axis varies , Is there example which will meet my requirement..If any thing is not clear pls let me know so that i will clarify,i am in urgent need of it.
Its very similar to diagram in below URL pls check the URL
http://www.memorytesters.com/sim2/s2_ap11.htm
James rocky
-- modified at 6:31 Monday 17th April, 2006
|
|
|
|
|
I think you are going to plot something... then you have some readings with constant time intervals, right?
Then take these values in an array (or arrays for A, B, C, etc.).
Can you do these things?
- NS -
|
|
|
|
|
Is there any sample application to implement the timing diagram concept?
|
|
|
|
|
I'm sorry. I don't have any sample with me.
- NS -
|
|
|
|
|
My problem is that when i rotate my multiline text 180 degrees , the text is rotated but the ordering of lines in the text is wrong as the first line comes as last and last line comes as first(for eg. if i have two lines line1 & line2 then after rotation line2 is displayed and below it line1 is diaplayed).I have passed the DT_WORDBREAK as parameter to the CDC drawtext function to handle word wrapping.
Is ther any other way to handle rotation of multiline text?
Kindly let me know
|
|
|
|
|
The following example shows how to rotate text at any angle (doesn't work on 95/98/ME). It renders text at (50, 50) rotated 30 degress clockwise.
--------------------------------------
CPaintDC dc(this);
int OldMode = SetGraphicsMode(dc.m_hDC, GM_ADVANCED);
static const double pi = 4.0*atan(1.0);
static const double angle = 30.0*(pi/180.0);
static const XFORM xf = {cos(angle), sin(angle),
-sin(angle), cos(angle),
0, 0};
SetWorldTransform(dc.m_hDC, &xf);
CRect rcClient;
GetClientRect(&rcClient);
rcClient += CPoint(50, 50);
dc.DrawText(_T("Hello\nThere"), -1, &rcClient, 0);
SetGraphicsMode(dc.m_hDC, OldMode);
--------------------------------------
Steve
|
|
|
|
|
hi all,
plz tell me how to draw colored button in mfc
thanks in advanced
Rahul here
|
|
|
|
|
You have to use ownerdraw...
- NS -
|
|
|
|
|
|
Hi rahul.shendurnikar,
You can use derived CButton and use WM_DRAWITEM in class
|
|
|
|
|
Hi all,
I have a CTreeCtrl as a child of a docking window (CMyBar). In my docking window class I set a handle just like this:
(
CMyBar.cpp)<br />
ON_NOTIFY(TVN_SELCHANGED, ID_TREE, OnTreeChange) ...<br />
The declaration of the function is
(CMyBar.h)<br />
afx_msg void CMyBar::OnTreeChange(NMHDR *hdr, LRESULT *NotUsed)<br />
I had to explicity add the ON_NOTIFY handler because the Visual Studio6 ClassWizard doesn't show the ON_NOTIFY event for my docking class (CMyBar), (don't know why?).
As far as I know CTreeCtrl does send ON_NOTIFY notifications to it's parent (CMyBar). Spying++ CMyBar window class shows CMyBar gets WM_NOTIFY messages...
Now all this crap doesn't work (OnTreeChange never gets called), and I'm to figure out what's going on and what's wrong with it.
Would be really happy if someone can answer this question...
Thank you!
|
|
|
|
|
try to look with spy on the Tree Control properties, perhaps it has a flag indicating not sending a parent notify (WM_PARENTNOTIFY).....in my code the selchange does call the parent notification and the method OnTreeChange does get called....
hope this helps
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
Hi Yaron,
Thanks for the reply... But the problem is my parent window (CMyBar) does get WM_NOTIFY and VM_PARENTNOTIFY messages(I've checked it with Spy), but my method OnTreeChange never gets called...
I'm new to MFC and I'm sure I'm missing something here.
Jim Jim
|
|
|
|
|
well, if you have checked it with spy and the Bar does get the WM_NOTIFY message, then check the id of the tree control (IDC_TREE) check the name of the function.....other than that it suppose to work....
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
YaronNir wrote: well, if you have checked it with spy and the Bar does get the WM_NOTIFY message, then check the id of the tree control (IDC_TREE) check the name of the function.....other than that it suppose to work....
Thanks for your help! You're right, it was a an incorrect id of the tree control.
Jim Jim
|
|
|
|
|
hi all,
i am unable to access the property page control values from another property page.
// snippet of the code
CPropertySheet dlg(_T("Hellow"), this, 0);
one a; //First Property Page
two b; //second Property Page
three c; //third Property Page
dlg.AddPage(&a);
dlg.AddPage(&b);
dlg.AddPage(&c);
dlg.SetWizardMode();
dlg.DoModal();
//================================================
if the first property page contains the ComboBox with some values i am trying to acces the values in the second property page as
one* m_Main2 = (one *) GetParent();
CString str;
for(int i =0;i< m_Main2->p->GetCount();i++)
{
m_Main2->p->GetLBText(i,str); // p is the pointer of the combobox
MessageBox(str);
}
where p is the pointer of combobox control in the first property sheet.
any solutions for this please.
thanks
uday.
uday kiran
|
|
|
|
|
The dialog of property will be created only if it is shown once. That is why you can't access them.
- NS -
|
|
|
|
|
As each tab loses focus, store the control's values in the sheet (parent).
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I have a big project and when run application, VC report leak memory but I don't know variable is cause leak memory? Can you help me
-----------------
conglt
|
|
|
|
|
Install Bounds checker
never say die
|
|
|
|