|
Sorry - it's 'return TRUE;' in CSortListCtrl handler connected to msg map with ON_NOTIFY_REFLECT_EX macro.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Did both things that you said --BOOL and _EX. Still no response!
Appreciate your help,
ns
rebuilt it too!
|
|
|
|
|
I've checked MSDN again - I've found two contradictory articles; one advertised 'return TRUE' while other suggested FALSE. Anyway, this simple example worked for me - I've got two TRACES.
BEGIN_MESSAGE_MAP(CListCtrl2, CListCtrl)
ON_NOTIFY_REFLECT_EX(LVN_COLUMNCLICK, OnColumnclick)
END_MESSAGE_MAP()
BEGIN_MESSAGE_MAP(CTest2Dlg, CDialog)
ON_NOTIFY(LVN_COLUMNCLICK, IDC_LIST1, OnColumnclickList1)
END_MESSAGE_MAP()
BOOL CListCtrl2::OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult)
{
TRACE("in the listctrl-derived class\n");
*pResult = 0;
return FALSE;
}
void CTest2Dlg::OnColumnclickList1(NMHDR* pNMHDR, LRESULT* pResult)
{
TRACE("in dialog class\n");
*pResult = 0;
}
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
The columclick is working with the false. A biiig thank you! I thought I'd have to abandon this slick control.
The item click event in the dialog doesnt respond, but the plain old click does.....wonder why?
void CSortListCtrlTestDlg::OnClickList(NMHDR* pNMHDR, LRESULT* pResult) works
void CSortListCtrlTestDlg::OnItemclickList(NMHDR* pNMHDR, LRESULT* pResult) doesnt!
THe click however always seems to be on an item (in the row the columns all get selected at once), so this will do. I just dont know if click means anywhere in the control, not just on the item.
Appreciate your help,
ns
|
|
|
|
|
I'd try your ideas on it, but there is no itemclick oe even click event in the class itself.
Appreciate your help,
ns
|
|
|
|
|
I guess you're after NM_CLICK; it should be available in CSortListCtrl and CYourDlg as well.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Will use nm_click. What I meant by there being no click event in the class was that there was no handler implemented for it. The message is of course available.
I think I'm going to take off now for the day (unless I just cant resist getting on again later!). ONce again you have proven to be a very valuable resource and I cant thank you enough for all the help you've given me.
Appreciate your help,
ns
|
|
|
|
|
Hi.
I am in the predesign stage of an FTP server. My goal is to release an FTP server within a year. I have some basic questions.
First, when an FTP client sends a command, does the server read the data and then basically search the data received, which is text, from a list of FTP commands such as get, ls, etc? How does a typically transcript between an FTP client and FTP server look like?
Secondly, where is reliable source for FTP commands? I know a source for TCP/IP commands. Do you use the same commands for FTP i.e. "/get?"
Lastly, does the FTP client sends the login and password in login->password order or is it opposite?
Thanks,
Kuphryn
|
|
|
|
|
You need to take a look at the RFC. I have a copy of RFC 959, but I don't know if that is the latest and greatest. Mabye soeone can correct me if there has been another one since then (I believe there has been a revision/addendum to address MPFTP, or something like that, maybe). This outlines the FTP protocol.
If you would like to see what happens between the server and client in action, just install an FTP client, say CuteFTP or WS_FTP, and an FTP server on your machine, say BulletProof FTP or something similar. Both have logging functionality, so you can see the commands the client sends, and the responses the server sends back.
Set up an account in the FTP server, start the server, and log in with the client. Give the host address as "localhost", browse around in the client, download and upload a couple of files, etc.
Basically, it works something like this. The client establishes a connection to the server over a socket to issue commands and receive responses. This socket is the control socket. Commands are issued as text, the command followed by (optionally) arguments. The server receives the command on the other end, and sends a response to the client on the control socket, indicating whether the commad was successful, further information, etc. Data is transferred over a second socket, the data socket, which is generally connected for the duration of a transfer only, and may be either the responsibility of the client or the server to establish the data connection for file transfers, directory listings, etc., depending on what mode the session is in (Passive mode, or "Not Passive").
Maybe you should try implementing an FTP client first? This is not trivial, but simpler than implementing a server, since you only have to worry about two sockets, instead of an arbitrary number for the server.
The RFC specifies this in greater detail, but generally, USER, then (optionally) PASS, and in some cases ACCT. Though, practice, there is almost always a password required, but I think there doesn't have to be. Take a look at the RFC.
Good Luck!
Aaron
|
|
|
|
|
Okay. Thanks.
I will definitely look into RFC. Are there RFC hardcopy reference available or do you have to print them out from a website?
You made a good point about just keeping a log of an FTP client and FTP server to see how FTP communication typically works.
I have considered design an FTP client before an FTP server. However, I have worked with direct TCP/IP connection and HTTP in the past. I would like to go ahead and design a major network communication server where I will have to utilize real I/O model including overlapped I/O and completion port.
Kuphryn
|
|
|
|
|
Just use Google to search for the RFC (search for "RFC XXX" where XXX is the number you want). I bet you'll find it.
--
Please state the nature of your medical emergency.
|
|
|
|
|
or, search google for "RFC XXX", I bet you'll find something entirely different
Signature space for rent. Apply by email to....
|
|
|
|
|
Hmm.. an XXX-rated RFC, is that some kind of questionnaire a hooker would send to her customers?
--
Please state the nature of your medical emergency.
|
|
|
|
|
Hello @all,
i have a dialogbased mfc-programm. one button on the dialog should do this: a CFileDialog and when i choose a .txt file my program should read it.
what i did: i create a new dialog and i choose the CFileDialog as basis class. in the button-function i wrote doModal()...etc. when i run the program, i get an error: something with the standardkonstruktor.
what i must change or add???
and how can i read the choose txt file???
has anybody good links or tipps???
sunny
|
|
|
|
|
You don't need to derive new class from CFileDialog. Just create CFileDialog object, call DoModal. If DoModal returns IDOK, get the file name with CFileDialog::GetPathName. You can use stdio.h/CStdioFile/fstreams for actual input.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
okay, i wrote now:
CFileDialog d;
d.DoModal();
when i run the program i still get the same error.
sunny
|
|
|
|
|
1) You need to provide some parameters to CFileDialog constructor
2) You need to check the value returned by CFileDialog::DoModal. If it's not IDOK, then user has cancelled the operation.
Sunnygirl wrote:
when i run the program i still get the same error.
What kind of error it is?
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
error: no suitable standard constructor available
sunny
|
|
|
|
|
See (1) in previous post. I'd recommend reading docs on CFileDialog first.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
thank you very much, the CFileDialog works.
the stuff with the istream, iostream and so on i will try tomorrow....it´s too late now....
thanks
sunny
|
|
|
|
|
|
Here's my problem. I've got a pointer to an STL list inside a class that resides in a DLL. I was attempting to allocate an object for that pointer to point to inside the EXE, then, in the destructor for the class (in the DLL), I delete it. At which point I delete it, the heap checker becomes unhappy with me and gives me a user breakpoint. I've seen this kind of problem before with different heaps etc, but I've got plenty of other objects in this program which are allocated in the EXE and deleted in the DLL.
Why is it a problem with an STL list?
Chris Richardson
|
|
|
|
|
Chris Richardson wrote:
Why is it a problem with an STL list?
KB article Q168958 may shed some light on this subject:
Some STL classes contain nested classes. These classes can not be exported. For instance, deque contains a nested class deque::iterator. If you export deque, you will get a warning that you must export deque::iterator. If you export deque::iterator, you get a warning that you must export deque. This is caused by a designed limitation that once a template class is instantiated, it can not be re-instantiated and exported. The only STL container that can currently be exported is vector. The other containers (that is, map, set, queue, list, deque) all contain nested classes and cannot be exported.
Tomasz Sowinski -- http://www.shooltz.com
*** Si fractum non sit, noli id reficere. ***
|
|
|
|
|
Ahhh, thank you very much. I was wondering why everything was going well with my vector object. Looks like I'll have to use vector for this collection as well.
Thanks again,
Chris Richardson
|
|
|
|
|
It's a problem with VC++ STL implementation. Microsoft reports it here[^]. Dinkumware (the company that wrote STL for VC++) provides a fix here[^], go to paragraph "Fix to <xtree>".
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|