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\Microsoft.NET\Framework\v2.0.50727\msc orlib.dll>
using namespace System;
using namespace System::IO;
#include "stdafx.h"
#include <Tlhelp32.h>
#include <windows.h>
#include <commctrl.h>
void installCab(LPTSTR cabFile);
void installCabs(LPCTSTR directory);
bool checkIfWCELOADIsRunning();
void removeInstallFiles();
void removeInstallFiles()
{
Delete(" ");
}
ERRORS:::
Error 1 error C3861: 'Delete': identifier not found Installer.cpp 64
ANY IDEAS?!?!
thanks, smp 4 1762 sm*****@gmail.com 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::File::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
On Jul 31, 10:02 am, "Carl Daniel [VC++ MVP]"
<cpdaniel_remove_this_and_nos...@mvps.org.nospamwr ote:
smp9...@gmail.com 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::File::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)
"Carl Daniel [VC++ MVP]" <cp*****************************@mvps.org.nospam >
wrote in message news:ej**************@TK2MSFTNGP05.phx.gbl...
sm*****@gmail.com 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::File::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
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 This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
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...
|
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...
|
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....
|
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...
|
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...
|
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
|
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
|
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...
|
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...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Shællîpôpï 09 |
last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
| |