473,809 Members | 2,780 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

HELP!! Library for deleting file not there!

Hello.

I'm developing a Win32 Console Application for a Smart Device (MotoQ).

All i need to do is delete a file with a known name and path. I'm
under the impression that I have to use File::Delete( path ) based on
what MSDN is telling me. Thus I need to include mscorlib.dll ... I
#using this and the method cannot be found. I have tried almost
everything and am completely confused.
#using <C:\WINDOWS\Mic rosoft.NET\Fram ework\v2.0.5072 7\mscorlib.dll>

using namespace System;
using namespace System::IO;
#include "stdafx.h"

#include <Tlhelp32.h>
#include <windows.h>
#include <commctrl.h>
void installCab(LPTS TR cabFile);
void installCabs(LPC TSTR directory);
bool checkIfWCELOADI sRunning();
void removeInstallFi les();

void removeInstallFi les()
{
Delete(" ");
}

ERRORS:::

Error 1 error C3861: 'Delete': identifier not found Installer.cpp 64
ANY IDEAS?!?!

thanks, smp

Jul 31 '07 #1
4 1783
sm*****@gmail.c om wrote:
Hello.

I'm developing a Win32 Console Application for a Smart Device (MotoQ).

All i need to do is delete a file with a known name and path. I'm
under the impression that I have to use File::Delete( path ) based on
what MSDN is telling me. Thus I need to include mscorlib.dll ... I
#using this and the method cannot be found. I have tried almost
everything and am completely confused.
It looks like you might be mixing managed and unmanaged code in an odd way.

If you're doing Managed code, then you would want call
System::IO::Fil e::Delete, but you're trying to call ::Delete, which doesn't
exist. Given the using directives that you have in force, File::Delete
should be a sufficiently qualified name.

If, on the other hand, you're writing pure native code, just call the
::DeleteFile function from the Win32 API and forget about using the CLR
function to do it.

For that matter, since you're writing in C++, you can simply use
::DeleteFile no matter what - the compiler will "do the right thing" to make
it work from managed or native code.

-cd
Jul 31 '07 #2
On Jul 31, 10:02 am, "Carl Daniel [VC++ MVP]"
<cpdaniel_remov e_this_and_nos. ..@mvps.org.nos pamwrote:
smp9...@gmail.c om wrote:
Hello.
I'm developing a Win32 Console Application for a Smart Device (MotoQ).
All i need to do is delete a file with a known name and path. I'm
under the impression that I have to use File::Delete( path ) based on
what MSDN is telling me. Thus I need to include mscorlib.dll ... I
#using this and the method cannot be found. I have tried almost
everything and am completely confused.

It looks like you might be mixing managed and unmanaged code in an odd way.

If you're doing Managed code, then you would want call
System::IO::Fil e::Delete, but you're trying to call ::Delete, which doesn't
exist. Given the using directives that you have in force, File::Delete
should be a sufficiently qualified name.

If, on the other hand, you're writing pure native code, just call the
::DeleteFile function from the Win32 API and forget about using the CLR
function to do it.

For that matter, since you're writing in C++, you can simply use
::DeleteFile no matter what - the compiler will "do the right thing" to make
it work from managed or native code.

-cd
Awesome, that seemed to have worked (::DeleteFile)

Jul 31 '07 #3

"Carl Daniel [VC++ MVP]" <cp************ *************** **@mvps.org.nos pam>
wrote in message news:ej******** ******@TK2MSFTN GP05.phx.gbl...
sm*****@gmail.c om wrote:
>Hello.

I'm developing a Win32 Console Application for a Smart Device (MotoQ).

All i need to do is delete a file with a known name and path. I'm
under the impression that I have to use File::Delete( path ) based on
what MSDN is telling me. Thus I need to include mscorlib.dll ... I
#using this and the method cannot be found. I have tried almost
everything and am completely confused.

It looks like you might be mixing managed and unmanaged code in an odd
way.

If you're doing Managed code, then you would want call
System::IO::Fil e::Delete, but you're trying to call ::Delete, which
doesn't exist. Given the using directives that you have in force,
File::Delete should be a sufficiently qualified name.

If, on the other hand, you're writing pure native code, just call the
::DeleteFile function from the Win32 API and forget about using the CLR
function to do it.

For that matter, since you're writing in C++, you can simply use
::DeleteFile no matter what - the compiler will "do the right thing" to
make it work from managed or native code.
I was under the impression that Smart Device runtime can't do C++ interop
(aka It Just Works), so you need to stick with either purely managed code or
purely unmanaged code, and can't use ::DeleteFile Win32 API function from a
managed assembly (at least, you'd need DllImport attribute and use
p/invoke).
>
-cd

Aug 3 '07 #4
Ben Voigt [C++ MVP] wrote:
I was under the impression that Smart Device runtime can't do C++
interop (aka It Just Works),
I believe you're right - I missed the Smart Device part of the question when
I replied. Mea culpa!

-cd
Aug 7 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
3934
by: matt | last post by:
I have compiled some code, some written by me, some compiled from various sources online, and basically i've got a very simple flat file photo gallery. An upload form, to upload the photos and give them a caption, storing the caption and filename in a text file. It's a bit buggy when removing the photos and captions from the file, and also in displaying them on the delete page. you can see it in action at www.4am.com.au/gallery/upload.php...
1
1515
by: amine | last post by:
Hi, I am trying to develop an app for an IPAQ. the app is basically an ftp client. I have been using the webrequest and webresponse classes to download and upload files which works perfectly fine. I actually have a couple of questions: * how can I delete a file from the HTTP server? * how can I create a folder in the HTTP server?
3
2713
by: Abhas | last post by:
> > Hi, this is Abhas, > > I had made a video library program in C++, but was facing a problem. > > After entering 12 movies, i cannot enter any more movies. > > Something gibberish comes instead. > > Can somebody please tell whats wrong?? > > This is the code : : #include<fstream.h> #include<conio.h>
0
1409
by: Bandit | last post by:
I'm populating a gridview (called docList) with document info from a network folder like so: Sub Show_Files(ByVal inputDir As String) Dim strFileNamePath As String = inputDir Dim dirInfo As DirectoryInfo = New DirectoryInfo(strFileNamePath) Dim aFiles As FileInfo() = dirInfo.GetFiles("*.doc") Array.Sort(aFiles, New CompareFileInfoEntries (CompareByOptions.LastWriteTime)) docList.DataSource = aFiles
2
2967
by: Bruce Russell | last post by:
This may sound stupid but I can't rename the WebForm1.aspx in the solution explorer. The file is located in my local web server at C:\Inetpub\wwwroot\Lab3-VB-Starter\WebForm1.aspx Is there some configuration problem in my IIS setup? Thanks,
1
2986
by: Amit D.Shinde | last post by:
I am using kill function to delete the file on disk but it deletes the file permanantly but how to delete the file and send it to recycle bin? Please Reply
6
2146
by: yxq | last post by:
Hello, The File.Delete(VS2005) function can not delete file on Vista-64bit, why? And, what changes of API between 32-bit and 64-bit? Thank you
1
2427
by: diyasher | last post by:
hello my code is in c#. i am using fileSystemWatcher class to watch event when file is deleted. event is fire when file is deleted, i want to stop deleting file, means when user want to delete file, file cannot be deleted. how to stop deleting file bye
2
1933
by: pandurusankar | last post by:
Hi, Need a pointer for managing File type button in HTML page, i am able to handle all the components in HTML using IEAutomation module like: text box, links, radio button, list box etc. but i need help in handling File type (Upload button). Thank you very much inadvance. reg JAI
0
9603
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10376
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10387
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9200
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7662
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6881
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5689
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4332
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3015
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.