|
John M. Drescher wrote:
To output a % you need to put a \ before it.
Or use %%, as per the <codeprintf()< code=""> docs
I agree with not needing to use <code>Format(), although this may not actually be the code in his program...
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Ryan Binns wrote:
Or use %%, as per the docs
I guess its time to get some sleep.. I am soo tired...
John
|
|
|
|
|
Yeah, that's probably a good idea sometime
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Hi all,
I want to connect to ftp server and move file1 to a archive folder. I have been using Wininet lib. for my ftp connect and get commands, however, how do I move a file on the server to a certain directory ?
Maybe I have to use another lib. , any help is appreciated ?
Thanks.
R.Bischoff | C++
.NET, Kommst du mit?
|
|
|
|
|
FTP doesn't support moving files around on the server. To do this, you'll need to download the file (GET), delete the file (DELE), change to the new directory (CD) and upload the file again (PUT). You might want to delete the file after uploading the new file, just in case you lose the connection before it uploads properly. It's very slow, but the only way you can do it using ftp.
Hope this helps,
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
My, didn't I find that out early! Whenever I rename a file on an FTP server, I always ask myself, "Why didn't the protocol designers have the sense to make a rename command???".
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
Yeah, it's crazy isn't it. If I ever find that I have to do something like this, I try to use telnet instead (if the server supports it), but it's a bit complex
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Actually, that's not entirely true. Most FTP servers I've seen actually get command support from binaries in their bin directory. If someone were to add a copy command to the bin directory and allow certain users to access it, they should be able to move and / or copy files. The command set in FTP servers usually come from a combination of built-in functions (like GET and PUT usually) and applications. If the FTP server had such commands, you should be able to issue a custom command. Otherwise, downloading and re-uploading would, of course, work.
-----BEGIN GEEK CODE BLOCK-----
Version: 3.21
GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++
-----END GEEK CODE BLOCK-----
|
|
|
|
|
Heath Stewart wrote:
If the FTP server had such commands, you should be able to issue a custom command.
That's the issue. "If"
I've seen a couple of servers that support this, but not many. It's not standard and may work differently on some servers to others.
I still think it's a PITA that ftp doesn't support copying/moving in the standard
Ryan "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"
|
|
|
|
|
Thanks for your insight Ryan and to all others who have commented. This has confirmed my suspicions.
R.Bischoff | C++
.NET, Kommst du mit?
|
|
|
|
|
Should not be too hard but I'm probably just very stupid
I have a dialog with a listbox.
I want to know when the mouse-button is released in the listbox's client-area.
I DON'T want to create a special class for the listbox.
So how can my dialog get an OnLButtonUp from the listbox..?
Any help would be greatly appreciated!
|
|
|
|
|
One solution is to add the appropriate mouse message handler and determine whether the mouse is over the client area via PtInRect().
Kuphryn
|
|
|
|
|
Well, that was my first try too.
But when the mouse is over the listbox's client-area the dialog doesn't receive the OnLButtonUp-message...
|
|
|
|
|
your dialog is receiving only
notification messages from it's childs
WM_NOTIFY message and notification code.
You could simulate this behaviour
by subclasing the listbox and send a message to it's parent (dialog)
use CHookWnd class By PJ Naughter
http://www.codeproject.com/cpp/chookwnd.asp
|
|
|
|
|
I am trying to build a property sheet with its pages instantiated in the header file of the sheet. The project builds fine, but gives an assertion error on ASSERT(afxCurrentResourceHandle != NULL) as soon as execution is attempted (in the construction of a page). This error does not occur if pages are instatiated "on-the-fly" in the body of the property sheet previous to the DoModal() call. But I need to have property page member functions visible to other classes, so they need to be predefined. Any ideas as to why it barfs on property page construction in this setting?
Thanks in advance,
Ben
|
|
|
|
|
Post the code in the sheet's constructor and the code that adds the pages.
Kuphryn
|
|
|
|
|
Constructor:
CMsgETIData::CMsgETIData() : CPropertyPage(CMsgETIData::IDD)
{
//{{AFX_DATA_INIT(CMsgETIData)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
How I _was_ adding pages:
CMsgETIData m_page2;
m_DQRMsgCreateSheet.AddPage(&m_page2);
m_DQRMsgCreateSheet.DoModal();
m_DQRMsgCreateSheet.RemovePage(&m_page2);
How I _want_ to add pages:
in the sheet header:
public:
CMsgETIData m_page2;
in the body:
m_DQRMsgCreateSheet.AddPage(&m_page2);
m_DQRMsgCreateSheet.DoModal();
|
|
|
|
|
Sorry...actually I want to do
AddPage(&m_page2)
in the constructor of the sheet!
|
|
|
|
|
Correct. The call to AddPage() should work correct in the constructor.
Kuphryn
|
|
|
|
|
Correct. The call to AddPage() should work correct in the constructor.
Should is the key word...that is the problem!
|
|
|
|
|
Hello,
I want to search all drives for particular filetypes. I know how to search all the directorys on a drive, but I don't know how to get a list of all the drives availeble on the computer (I don't need a list of network drives)?
many thanks in advance
|
|
|
|
|
Check out GetLogicalDrives()[^].
"Blessed are the peacemakers, for they shall be called sons of God." - Jesus
"You must be the change you wish to see in the world." - Mahatma Gandhi
|
|
|
|
|
thanks
|
|
|
|
|
Hello!
I am writing a program which needs to read the data file (in plain text format) to the memory structure (array).
Currently, I am reading the text data file one line at a time using CStdioFile and CString. For each line in the CString, from left to right, decode each segment (separated by ,) into another CString and then atof it to a real number. This is very slow and read in a 600K file will needs 10 seconds or more.
How can I do it faster using C++? (I don't want to mix C in it.)
Thanks a lot.
The data file looks like:
134.235, 235.23, 2353.25, 252.23, 2356.247, .....
234.235, 635.23, 6233.25, 772.23, 8356.247, .....
534.235, 895.23, 3553.25, 243.23, 7856.247, .....
I am using a data structure similar to a 2D array to hold it.
|
|
|
|
|
Kevein wrote:
This is very slow and read in a 600K file will needs 10 seconds or more.
That is redicously slow. It should be < 1 sec on a reasonably machine. I'd look at using a Memory Mapped File and possibly STL. With CStdioFile and CString there is a lot of waisted overhead moving stuff around in memory, allocating memory etc.
Have a look at the pugXml article here on CP http://www.codeproject.com/soap/pugxml.asp[^] which shows an example of using MMF. I can open and parse a 10M XML file on my slow old 550Mhz PC in approx .5 sec using this code.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|