|
|
and what does the last sentence you quoted means for you ???
"You can declare friend functions or friend classes to access not only public members but also protected and private class members."
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
Thanks for responding.
I have declared function in class decalaration like this
class date <br />
{<br />
private:<br />
....
....<br />
....<br />
public:<br />
date(int=1, int =1, int =1900);<br />
friend ostream& operator<<(ostream& , date&);<br />
}
Now i define this function is .cpp file like this
ostream& date::operator<<(ostream&o, date& a)<br />
{<br />
o<<year<<month<<day<<endl;<br />
return o;<br />
}
but it gives me this error,
error C2039: '<<' : is not a member of 'date'
Why this error is occuring?
Thanks
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
|
Sorry toxcct, I could not get your point. Can you please explain it? Thank you.
We Believe in Excellence
www.aqueelmirza.cjb.net
|
|
|
|
|
|
The operator<< function is a friend of your class thus it is not a member of the class.
Change the definition into:
ostream& operator<<(ostream&o, date& a)<br />
{<br />
...<br />
}
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Another thing I didn't see when I first read your post :
The first argument of the operator has to be a stream (cause it is the part which is on the left of the operator). Thus You can't make it a member of the CMyClass class. You have to make it a global function.
So, the solution is to declare the prototype in the header file of CMyClass (but outside the class) and then use this definition:
ostream& operator << (ostream& os, date& d)
{
return os;
}
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
Hi All,
I got a problem in creating popup...Can anyone tell me how to get popup window or menu while right clicking the mouse button in a ListCtrl..
thanks in Advance
With regards
Raja Bose
-- modified at 6:43 Thursday 8th June, 2006
|
|
|
|
|
|
Next, if your problem is to display a menu, try TrackPopupMenu or TrackPopupMenuEx members of CMenu class.
|
|
|
|
|
SaRath C wrote: Add message handler for NM_RCLICK
why not for WM_CONTEXTMENU ?
nave
|
|
|
|
|
yes WM_CONTEXTMENU of course with one if.if hwnd==m_list.hwnd
whitesky
|
|
|
|
|
See like this
<br />
void CAnswerDlg::OnNMRclickList1(NMHDR *pNMHDR, LRESULT *pResult)<br />
{<br />
HMENU hmenu,hmenuPopup;<br />
CPoint point;<br />
GetCursorPos(&point);<br />
hmenu = LoadMenu(AfxGetApp()->m_hInstance,(LPCTSTR) IDR_MENU1); <br />
hmenuPopup = GetSubMenu(hmenu, 0); <br />
TrackPopupMenu(hmenuPopup, TPM_LEFTALIGN | TPM_LEFTBUTTON, <br />
point.x,point.y, 0,m_List1.m_hWnd, NULL); <br />
DestroyMenu(hmenu); <br />
*pResult = 0;<br />
}<br />
whitesky
|
|
|
|
|
Dear guys,
I am trying to build an application using OMAKE,
the error is "fatal error RC1109: error creating TusMsvFE.res"
what could be the reason ?
Velayudhan
|
|
|
|
|
make sure that the file is not read only. that may be a reason for this.
SaRath.
"Don't Do Different things... Do Things Differently..."
Understanding State Pattern in C++
|
|
|
|
|
no , file is not read only
but when i deleted the tusmsvfe.res file from the folder and then builded, no error is there.
But again, when I modify resource, error comes,
what may be the reason ?
|
|
|
|
|
When I modify string like this
\nExts\nExts\nMyDocTypes(*.aaa;*.bbb)\n.aaa;.bbb\nExts.Doc\nExts Doc
then in "FileOpen" dialog file types are displayed:
MyDocTypes (*.aaa, *.bbb)
And I'd like it to be displayed like when I'm creating "FileOpen" dialog by myself - then file types are displayed like this:
MyDocType1 (*.aaa)<br />
MyDocType2 (*.bbb)<br />
MyDocType3 (*.ccc)<br />
MyDocType4 (*.ddd)<br />
All files (*.*)
How could I do this? )
~~~~
-- modified at 6:07 Thursday 8th June, 2006
|
|
|
|
|
I think it should be:
"MyDocType1 (*.aaa)\0*.aaa\0MyDocType2 (*.bbb)\0*.bbb\0MyDocType3 (*.ccc)\0*.ccc\0MyDocType4 (*.ddd)\0All files (*.*)\0*.*\0";
this is this.
|
|
|
|
|
See Here[^] maybe it is some helpful to you
whitesky
|
|
|
|
|
Hi
This is my first project on web services using MFC. I just have gone through Add Web Reference
menu item to add a web service. But while creating web service proxy file, it is giving the following error which I did not understand.
Creating web service proxy file for com.oracle.us.ecmbuild ...
sproxy : error SDL1000 : Not enough storage is available to complete this operation.
sproxy : error SDL1001 : failure in processing WSDL file: "c:\Documents and Settings\venkat\My Documents\Visual Studio Projects\ODriveNotifier\com.oracle.us.ecmbuild\RemoteLoginManager.wsdl".
I searched a lot on the net. I did come across questions which are same as this but I could not find the answer. Where is the problem? I appreciate any small help.
Thank you,
venkat.
|
|
|
|
|
can somebody tem me how to fetch date from mysql into vc++(MFC)
as mysql format is yyyy-mm-dd and mfc format is dd-mm-yyyy
now which function i use to fetch date as it is stored in mysql table
gourav dogra jfjunf
|
|
|
|
|
"Fetching" a date field is done exactly as you would for any other type of field (i.e., number, text). If the date is stored as yyyy-mm-dd, then I suspect you do not have a date field but rather a text field that just happens to hold the date. Can you confirm?
In this article, I retrieve several date fields from an Access database. It may give you some clues.
"The largest fire starts but with the smallest spark." - David Crow
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
can we insert dialog box in between listbox items in runtime.
please tell me the solution.
or give me some samples
vasu.
-- modified at 5:29 Thursday 8th June, 2006
|
|
|
|
|
I am afraid you still don't make any sense
You know you're obsessed with computer graphics when you're outside and you look up at the trees and think, "Wow! That's spectacular resolution!"
|
|
|
|