Thread: DeleteFile() not working in my VC.NET app

  1. #1
    Android geek@02's Avatar
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    470

    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.
    GameJolt: https://gamejolt.com/@KasunL
    Game Development Youtube:
    https://is.gd/XyhYoP
    Amateur IT Blog: http://everything-geeky.blogspot.com/



    (and, sorry for my amateur English)

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

  3. #3
    Android geek@02's Avatar
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    470
    rebooted vc.net and somehow DeleteFile() is working now. thx anyway.
    GameJolt: https://gamejolt.com/@KasunL
    Game Development Youtube:
    https://is.gd/XyhYoP
    Amateur IT Blog: http://everything-geeky.blogspot.com/



    (and, sorry for my amateur English)

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

  5. #5
    Android geek@02's Avatar
    Join Date
    Mar 2004
    Location
    Kurunegala Colony, Sri Lanka, Sri Lanka
    Posts
    470
    it just sounded good than 'restarted'. funny.
    GameJolt: https://gamejolt.com/@KasunL
    Game Development Youtube:
    https://is.gd/XyhYoP
    Amateur IT Blog: http://everything-geeky.blogspot.com/



    (and, sorry for my amateur 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, 07:57 PM
  3. How do I make my Linux app standalone?
    By Joda in forum C++ Programming
    Replies: 2
    Last Post: 11-27-2002, 04:53 AM
  4. Reading text in another app
    By Unregistered in forum C++ Programming
    Replies: 3
    Last Post: 03-12-2002, 09:45 AM
  5. Dialog app interface with web page...
    By Unregistered in forum Windows Programming
    Replies: 5
    Last Post: 01-29-2002, 08:41 PM