|
Anatari wrote:
Make sure that you have included the header file that contains the declaration for ListNode
This is in the same file that the implementation of the list exists.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
in the line:
<br />
ostream &operator << (ostream &strm, ListNode& *Node)<br />
are sure you didn't mean to write:
<br />
ostream &operator << (ostream &strm, ListNode& Node)<br />
Just trying to help even if i'm way off =)
- Anatari
|
|
|
|
|
Anatari wrote:
Just trying to help even if i'm way off =)
I still get the same error.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
I'd concur that a reference to a pointer is a bit funny. What is a ListNode ? Have you tried putting class ListNode; above the operator ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Christian Graus wrote:
Have you tried putting class ListNode;
Nope, but just did....AND IT WORKED! What is the purpose of doing a forward reference here? ( please explain ) I also switched it so that it was only passing a pointer not a reference to the pointer (it's getting late ). Thanks Christian.
Nick Parker
May your glass be ever full.
May the roof over your head be always strong.
And may you be in heaven half an hour before the devil knows you’re dead. - Irish Blessing
|
|
|
|
|
Hi,
I'm trying to get the address of the windows proc of a running application using:
WNDPROC AppWndProc = (WNDPROC)GetWindowLong(m_hWnd, GWL_WNDPROC);<br />
DWORD errVal = GetLastError();
The call to GetWindowLong fails (returns null) and the value returned from GetLastError() is 5, which is an access denied result.
I'm not sure if i'm missing something, but how is it that this application is preventing me from getting this address ? Is there some way to prevent people from using GetWindowLong ? I want to subclass this app so that when a user moves it i can be notified as well.
Thanks
|
|
|
|
|
Are you in a separate process? If so you will need to do something else to get your DLL loaded in their process. Any address that is returned to you by this function will only be valid in the process that contains the window.
Your problem may be related to that fact, but I am not certain.
Build a man a fire, and he will be warm for a day Light a man on fire, and he will be warm for the rest of his life!
|
|
|
|
|
Hi,
I posted this before, but no one responded.
I'm new to C ++/mfc and I'm trying to modify a chat program to have the capability to transfer files as well as messages.
I found help from with code to send the file from this forum, but when I implemented it, I keep getting an error, "Unknown error while accessing unnamed file".
I put a button on the client side, and when the person clicks on it, the file dialog box is supposed to open, and the person can choose the file to send.
I get the dialog box, but I get the error right after I choose the file.
I put messages throughout the code to see where the program has reached, and it seems to be going through fine! It's also reading the data!
I'm really confused!!
I'm pasting the code below. If anyone has any idea what I'm doing wrong please respond.
-------------------------------------------------
void CMainFrame::OnSFile()
{
MessageBox("File Transfer");
CSocket cSocket;
cSocket.Create();
cSocket.Connect((LPCTSTR(m_strServerIP)),m_iFTPort);
csocketfile sf(&cSocket);
CArchive ar(&sf, CArchive::store);
/*code for CFileDialog goes here*/
static char BASED_CODE szFilter[] = "All Files (*.*)|*.*||";
CString strPath;
CFileDialog m_ldFile(TRUE,".*","*.*",OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, szFilter);
// Initialize the starting directory
//m_ldFile.m_ofn.lpstrInitialDir = _T("C:\\");
// Show the file open dialog and captures the result
//if IDOK
if (m_ldFile.DoModal() == IDOK)
{
strPath = m_ldFile.GetPathName();
CFile myFile(strPath,
CFile::modeRead | CFile::typeBinary);
MessageBox("here");
//get file info
DWORD length = myFile.GetLength();
MessageBox("here2");
char *data = new char[length];
MessageBox("here3");
myFile.Read(data, length);
MessageBox("here4");
//send it across
ar << myFile.GetFileName();
ar << length;
ar.Write(data, length);
delete[] data;
myFile.Close();
}
MessageBox("here5");
}
----------------------------------------------------------------
|
|
|
|
|
Pett wrote:
I'm new to C ++/mfc and I'm trying to modify a chat program to have the capability to transfer files as well as messages.
If you're really new to C++, you need to forget MFC and Windows, and do some console programming until you've had a chance to learn the core language properly.
Do you know how to use the debugger ? Do you know what line is breaking ? Do you know if you have a connection first ?
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Thank you for responding.
I actually have to do this for an assignment in one of my MSc classes.. Networking. So, I have no choice but to dive into everything at once..
Also, I have tried putting messages in the code to see if the program is actually reaching that part of the code... and it goes through fine... then I get the error.
I'm not sure if I'm using debugger properly, but I put a break point at several places, and it went through again... then the error.
I showed this to my professor yesterday, and he said it was puzzeling as well.
You asked if I had a connection. You mean to the server right? Yes I do...
If I am sending a file, but there is no receiving code on the server side, what will happen?
I'm wondering now if it is my sending that is the problem. Maybe I'm not doing something with CArchive...
Thanks a lot for your input.
|
|
|
|
|
i have the process id and its name and i want to get
GUITHREADINFO object.for that purpose i have to call
GetGUIThreadInfo where i have to put idThread value .
and my question is about idthread.
inorder to get idthread i have to call GetWindowThreadProcessId where i have to put hwnd and lpdwProcessId.
is idthread of each window of a process is different ?
mey i get GUITHREADINFO object using process id and its name using some other methods ?
because when i get GUITHREADINFO object it dose not have correct thread in it.
r00d0034@yahoo.com
|
|
|
|
|
If you're using MFC, *this will give you the HWND.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
plz read question first then ans.
r00d0034@yahoo.com
|
|
|
|
|
how do i compile a console program so that when it it is don it does not close the ms-dos window so i can read the output.
I know this is simple but im new to visual c++ 6.0.
Thanks
|
|
|
|
|
You need to make it wait. Assuming you've #included iostream and are using std::cin, it's something like
int n;
cin >> n;
This will keep accepting input until you enter something other than whitespace.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
How can I add a toolbar to my dialog-based application and how can I call the functions when a button on my toolbar is clicked?
|
|
|
|
|
I'm sure there is an article on CP about that.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002
|
|
|
|
|
Hi
Where could I find good tutorials on making a IM client such as MSN Messenger, ICQ or Yahoo messenger?
Thanks
|
|
|
|
|
It's a long time, but I think that MFC comes with a client/server chat sample, that would server as a good basis for anything like this.
That's assuming you want to roll-your-own. There is code around that shows how to use the MSN protocol, so you can integrate whatever you produce with an existing service.
--
Paul
"I need the secure packaging of Jockeys. My boys need a house!"
- Kramer, in "The Chinese Woman" episode of Seinfeld
MS Messenger: paul@oobaloo.co.uk
Sonork: 100.22446
|
|
|
|
|
How to add text using the ReplaceSel() function in a SDI application?
|
|
|
|
|
What ?
I don't understand a word you wrote ! please, make this more precise, tell us what your real problem is ( in programming category ) , and we'll be glad to help you.
But for now, I don't know where to start !
Max.
|
|
|
|
|
|
Can't believe I'm having so much trouble with this...
I have a dialog box with a combo box that I want to fill with values just prior to creating the modal dialog box. Isn't there an easy way to do this?
Thanks... (feelin pretty dumb)
|
|
|
|
|
i usually put combo box inits in the OnInitDialog function. this gets hit before the dialog is visible, but after all the controls have been created.
-c
“If it turns out that I’m actually the one who did it, then looking for the real killers would be a big old waste of time.”
-- OJ Simpson
|
|
|
|
|
That's where I'm at, but I can't figure out how to add the strings to the combo box resource created with the dialog editor. I created an array of CStrings that I load after instantiating the dialog box class, but before executing the DoModal function. In OnInitDialog I'm trying to move the CStrings into the combo box, but for an hour now, I'm not having any success.
I suppose I could create the combo box and position it in the dialog in OnInitDialog, but it sure seems like there should be a easier way to do this, using the layout created in the Dialog Editor.
A little more help please!
Thanks.
|
|
|
|