Win32API Movefile() Pathname problem

Thread Solved
Reply

Join Date: Dec 2008
Posts: 2
Reputation: spodder is an unknown quantity at this point 
Solved Threads: 0
spodder spodder is offline Offline
Newbie Poster

Win32API Movefile() Pathname problem

 
0
  #1
Dec 10th, 2008
I have a problem with the MoveFile() function of the Win32 API.
I cant move files which are in the same directory as the exe file,if i specify the pathname,it dosent work.I dont know how this function works.Need urgent help.......
  1. # include<windows.h>
  2. # include<iostream.h>
  3. int main()
  4. {
  5. MoveFile("C:\File1.txt","C:\New Folder\File2.txt");
  6. }
Last edited by Ancient Dragon; Dec 10th, 2008 at 2:53 pm. Reason: correct code tags
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 670
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Win32API Movefile() Pathname problem

 
0
  #2
Dec 10th, 2008
You should double backslash \\

Chris
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 2
Reputation: spodder is an unknown quantity at this point 
Solved Threads: 0
spodder spodder is offline Offline
Newbie Poster

Re: Win32API Movefile() Pathname problem

 
0
  #3
Dec 10th, 2008
Thanks a lot Chris.Its working
Last edited by spodder; Dec 10th, 2008 at 2:12 pm.
Reply With Quote Quick reply to this message  
Join Date: Apr 2008
Posts: 670
Reputation: Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough Freaky_Chris is a jewel in the rough 
Solved Threads: 113
Freaky_Chris's Avatar
Freaky_Chris Freaky_Chris is offline Offline
Practically a Master Poster

Re: Win32API Movefile() Pathname problem

 
0
  #4
Dec 10th, 2008
If thast all mark as solved please

Chris
Knowledge is power -- But experience is everything
Reply With Quote Quick reply to this message  
Reply

This thread has been marked solved.
Perhaps start a new thread instead?
Message:



Other Threads in the C++ Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC