|
How would I open a connection to an FTP server such that I could send actual
commands to the server (ex: LIST, etc) and view the actual responses the
server gives (Welcome messages, etc).
I know how to use the CFtpConnection to do basic FTP stuff, but I don't
think it does this.
Anyone have any ideas?
Adam
cabadam@houston.rr.com
|
|
|
|
|
ummmm you could just open a socket @ port 21 and send the commands thru as most full-blown ftp programs do ... you'll need the rfc for the ftp protocol and all that and then its not too difficult ... i dont know if there is any windows source code available to show it but i'm sure there would be some unix stuff around that wouldn't be too different in the basics of sockets etc
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Ok, still problem though:
I am using a derived CAsyncSocket (CFtpSocket) for initial connection. (Tried this with both CSocket and CAsyncSocket)
When I call the Connect(host,port), it returns true, giving me the initial socket connection. However, at that point, shouldn't I get a welcome message? I have been comparing what my program gives to what CuteFTP gives, and it says:
STATUS:> Connect: Monday 17:10:21 05-07-2001
STATUS:> Connecting to ftp.angelfire.com
STATUS:> Connecting to ftp.angelfire.com (ip = 216.33.20.80)
STATUS:> Socket connected. Waiting for welcome message...
220 Hi! Welcome to Angelfire's NEW FTP.
But in my program I never get that welcome message. It just stops after the socket connects. I have the OnReceive() overwritten and it SHOULD call that when I get the welcome message right? Or am I missing something? OnReceive is never getting called in my program.
Adam
cabadam@houston.rr.com
|
|
|
|
|
ummm
that is the ftp server answering a log-on request from the client app
you have to establish the connection and send the required commands to get anything going that u can work with
as i said ... check out the rfc on the ftp protocol to get a command list
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
LOL OK.. Thats what I deserve for trying to think while tired. Turns out my socket was going out of scope and being destroyed... *face turns red*
OK-- now I got my welcome message and I have read the RFC on FTP protocol so I understand pretty much how FTP is supposed to work. Now I need to actually send commands.
Ok, lets say I have:
CString command = "USER someone";
What do I need to tack on to the end of command to correctly send it?
I know the RFC said to have a carriage return and line feed. Isn't that \r\n? I tried that and nothing happened after I sent it. Tried adding basically every combination ("\r", "\n", "\r\n", "\n\r", "")
Still nothing worked.
Also, to send it, I should just do this correct:
char* buf = command.GetBuffer(command.GetLength());
Send(buf, sizeof(buf));
Thanks!
Adam
cabadam@houston.rr.com
|
|
|
|
|
Where can I find the default Internet Explorer (On 95/95/NT/2000?)
And launch it on a given page (local, intra or internet string ? )
Thnx
Wimel
|
|
|
|
|
ShellExecute will open IE to a page you want if you just ask it to open the URL, assuming IE is the default browser.
Christian
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
i need someone who can help me to configure this whole thing to work properly. i downloaded and installed the directx 8 sdk and the crystal space engine. built the engine and now i dont know where to even begin. any help would be appreciated.
Tinnin4eva
|
|
|
|
|
When you say you don't know where to begin, what do you mean ? Have you used DX before ? Have you read the Crystal Space docs ? Joined the mailing list ? Played with the demonstration applications provided ?
I haven't used Crystal Space ( 3D is high on my gunner list, but below GDI+ as of a few days ago, so unlikey to happen soon ) but I'd suggest that while others here *might* know a bit about it, you're more likely to find meaningful help from the mailing list, which is full of people who are using it. I'm not suggesting it's wrong to ask here ( it isn't, at least not in my NSHO ), but just that your success rate could be higher if you also try the people who are all using it and discussing it's use.
Christian
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
Hi,
I have some questions of you,
What is Crystal Space ?
How can i download it ?
Thanks for reply ...
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Hi!
I've spent quite a lot of time trying to convert a regular DLL into an extension DLL. The
problem is that the memory managment seems to be broken. The compilation and linking is warning-free, but when I start to test the application, I get all sorts of memory-related errors. Which errors depends on which features I test during the debugging session.
Error examples:
HEAP: Free Heap block 347fd0 modified at 348040 after it was freed
Acess violation when trying to write to normal variables.
_ASSERTE(_BLOCK_TYPE_IS_VALID(pHead->nBlockUse)); fails.
What do you think, have I done something bad in the DLL, or perhaps do I have some problem
which wasn't discovered when using regular DLLs?
//Olof
|
|
|
|
|
Double check to make sure you are using the correct run-time library (Project Settings, C/C++ Tab, Code Generation Category). If your DLL is using a different run-time library than the application (or DLL) that is using it, you will get all sorts of crashes if you allocate memory in code using one run-time library and deleting it in another. Other than that, buy a memory checking tool like purify or bounds checker (which you should have anyway, well worth the money).
Chris Hafey
|
|
|
|
|
I've got the correct library versions, thanks anyway. I'm afraid a memory checking tool is out of the question since I am a student.
|
|
|
|
|
I can't think of any reason why going from regular DLL to extension DLL should cause any problems. Without a memory checker, you will have to debug it the hard way . If you get stuck, email me your project and I'll throw it under bounds checker for you.
Chris Hafey
|
|
|
|
|
I run console application with redirected input/output (to files) from GUI application via CreateProcess.
Actually, console isn't allocated and that application works in background mode.
How can I send Ctrl+Break messages to that application for stop running?
|
|
|
|
|
ummmm can you not use EndProcess() ?
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
|
I run console application with redirected input/output (to files) from GUI application via CreateProcess.
Actually, console isn't allocated and that application works in background mode.
How can I send Ctrl+Break messages to that application for stop running?
|
|
|
|
|
Hi,
has anyone seen a "sound-mixing-engine" for Windows CE? I would like to play sound fx simultaneously to my background music. Is there a simple (please no directsound) soulution?
thanks for every comment
Jens
|
|
|
|
|
|
Hi
Just go to (www.maxcode.com) then go to visual c++ tutorial section
or go
(www.viet-learn.com) here you can get alot of free e-book
AHMAD ALWASHALI
washali@yahoo.com
|
|
|
|
|
Hi,
How can I create game which have color cursor ?
LC
|
|
|
|
|
Nothing like a specific question.....
I'm not sure what you want - is your game running in a window, or full screen ? Is it using DirectX or OpenGL, or is it just using standard Windows graphics stuff ?
Assuming you're running in a Window, you can catch OnSetCursor and set your cursor to whatever you want, based on any condition you desire.
Christian
The early bird may get the worm, but it's the second mouse that gets the cheese.
|
|
|
|
|
Hi!.
How I create a short cut (icon) from vc program?.
thx.
|
|
|
|
|
HRESULT CreateIt(LPCSTR pszShortcutFile, LPSTR pszLink,
LPSTR pszDesc)
{
HRESULT hres;
IShellLink *psl;
// Create an IShellLink object and get a pointer to the IShellLink
// interface (returned from CoCreateInstance).
hres = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER,
IID_IShellLink, (void **)&psl);
if (SUCCEEDED(hres))
{
IPersistFile *ppf;
// Query IShellLink for the IPersistFile interface for
// saving the shortcut in persistent storage.
hres = psl->QueryInterface(IID_IPersistFile, (void **)&ppf);
if (SUCCEEDED(hres))
{
WORD wsz[MAX_PATH]; // buffer for Unicode string
// Set the path to the shortcut target.
hres = psl->SetPath(pszShortcutFile);
if (!SUCCEEDED(hres))
AfxMessageBox("SetPath failed!");
// Set the description of the shortcut.
hres = psl->SetDescription(pszDesc);
if (!SUCCEEDED(hres))
AfxMessageBox("SetDescription failed!");
// Ensure that the string consists of ANSI characters.
MultiByteToWideChar(CP_ACP, 0, pszLink, -1, wsz, MAX_PATH);
// Save the shortcut via the IPersistFile::Save member function.
hres = ppf->Save(wsz, TRUE);
if (!SUCCEEDED(hres))
AfxMessageBox("Save failed!");
// Release the pointer to IPersistFile.
ppf->Release();
}
// Release the pointer to IShellLink.
psl->Release();
}
return hres;
}
Hope this helps
Cheers
Kannan
|
|
|
|