x
This website is using cookies. We use cookies to ensure that we give you the best experience on our website. More info. That's Fine
HPC:Factor Logo 
 
Latest Forum Activity

Remove File in eVC++

nathanpc Page Icon Posted 2009-09-07 6:11 PM
#
Avatar image of nathanpc
H/PC Philosopher

Posts:
327
Location:
Portugal
Status:
Hello,
I'm building dome very simple projects in eVC++, just to test they, but when i try to do a file remove project, i'm getting some errors, here is the code:
// Remove.cpp 
// 

#include "stdafx.h"
#include <stdio.h>

int WINAPI WinMain( HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPTSTR lpCmdLine,
int nCmdShow)
{
if( remove( "test.txt" ) !=0 )
printf( "Error When Deleting File..." );
else
puts( "File Successfully Deleted!" );
return 0;
}

And here is the compiler log:
C:\...\Remove.cpp(12) : error C2065: 'remove' : undeclared identifier

What Is Wrong?

Thanks,
Nathan Paulino Campos
 Top of the page
mscdex Page Icon Posted 2009-09-07 7:08 PM
#
Avatar image of mscdex
H/PC Sensei

Posts:
1,054
Location:
United States
Status:
Well, I'm not sure about a native C++ method, but wcecompat's unlink function simply calls the Windows API function DeleteFile.
 Top of the page
nathanpc Page Icon Posted 2009-09-07 10:28 PM
#
Avatar image of nathanpc
H/PC Philosopher

Posts:
327
Location:
Portugal
Status:
Huh, then i can call thw Window API function.
That's very simple!

Thanks!
 Top of the page
Jump to forum:
Seconds to generate: 0.140 - Cached queries : 60 - Executed queries : 9