DeleteFile() not working in my VC.NET app

This is a discussion on DeleteFile() not working in my VC.NET app within the Windows Programming forums, part of the Platform Specific Boards category; Hi, this snippet is from a VC.NET app: Code: ..... ..... int i = m_clistboxreslist.FindString(0,dat); m_clistboxreslist.DeleteString(i); if(::DeleteFile(srcfile)) AfxMessageBox("Deleted"); else AfxMessageBox("Falied"); ...

  1. #1
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    375

    DeleteFile() not working in my VC.NET app

    Hi, this snippet is from a VC.NET app:
    Code:
    .....
    .....
    int i = m_clistboxreslist.FindString(0,dat);
    m_clistboxreslist.DeleteString(i);
    
    if(::DeleteFile(srcfile))
    	AfxMessageBox("Deleted");
    else
    	AfxMessageBox("Falied");
    
    RecreateListTxt();//dump data to file
    ......
    ......
    The problem is that DeleteFunction() ain't working. 'srcfile' is a valied file path (and DeleteFile(srcfile) works when i put it in a win32console app). Here the execution pointer jumps to the else statement, but then again, AfxMessageBox() is also not working. Why is this?

    any help.
    Some useless programs i've wrote : slprogrammersheaven
    Youtube: http://www.youtube.com/user/geekyzine
    My amature IT Blog: http://everything-geeky.blogspot.com/
    My Flash games: http://flashweed.blogspot.com/

    (and, sorry for my amature english)

  2. #2
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    What does GetLastError() say?

  3. #3
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    375
    rebooted vc.net and somehow DeleteFile() is working now. thx anyway.
    Some useless programs i've wrote : slprogrammersheaven
    Youtube: http://www.youtube.com/user/geekyzine
    My amature IT Blog: http://everything-geeky.blogspot.com/
    My Flash games: http://flashweed.blogspot.com/

    (and, sorry for my amature english)

  4. #4
    Woof, woof! zacs7's Avatar
    Join Date
    Mar 2007
    Location
    Australia
    Posts
    3,459
    "rebooted" ?

  5. #5
    Android
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    375
    it just sounded good than 'restarted'. funny.
    Some useless programs i've wrote : slprogrammersheaven
    Youtube: http://www.youtube.com/user/geekyzine
    My amature IT Blog: http://everything-geeky.blogspot.com/
    My Flash games: http://flashweed.blogspot.com/

    (and, sorry for my amature english)

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. pasword app
    By GanglyLamb in forum C Programming
    Replies: 2
    Last Post: 06-07-2003, 10:28 AM
  2. Project Builder console app
    By Luigi in forum C++ Programming
    Replies: 0
    Last Post: 12-28-2002, 06:57 PM
  3. How do I make my Linux app standalone?
    By Joda in forum C++ Programming
    Replies: 2
    Last Post: 11-27-2002, 03:53 AM
  4. Reading text in another app
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 03-12-2002, 08:45 AM
  5. Dialog app interface with web page...
    By Unregistered in forum Windows Programming
    Replies: 5
    Last Post: 01-29-2002, 07:41 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21