• 0

[Visual C++ 6] File Transfer Dialog Box


Question

OK, I haven't used C++ in years so please bear with me.

I have a line of code that looks like this:

CopyFile(argv[2], argv[3], false);

While the file is copying, I want it to display a dialog box to show the progress of the transfer. You usually see this in Windows Explorer when you're transferring large files. How can I get this to work?

Thanks.

Link to comment
https://www.neowin.net/forum/topic/581364-visual-c-6-file-transfer-dialog-box/
Share on other sites

4 answers to this question

Recommended Posts

  • 0

Like I said, I haven't used C++ in years. What's wrong with my code? It keeps crashing.

		SHFILEOPSTRUCTA fop;

		fop.hwnd = NULL;
		fop.wFunc = FO_COPY;

		CString from = argv[2];
		from += "\ 0 \ 0"; //Double-null terminate? Is this how you do it? There's no spaces, but I put in the spaces so it would show up on the forums
		CString to = argv[3];
		to += "\ 0 \ 0"; //Double-null terminate? There's no spaces, but I put in the spaces so it would show up on the forums

		fop.pFrom = from;
		fop.pTo = to;
		fop.fFlags = FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR | FOF_SIMPLEPROGRESS;

		SHFileOperation(&fop);

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.