Article View: borland.public.cppbuilder.nativeapi
Article #393Re: Delete File
From: bar
Date: Mon, 21 Apr 2008 14:18
Date: Mon, 21 Apr 2008 14:18
44 lines
2191 bytes
2191 bytes
Thanks everyone for the comments.
I have to post my problem once again.
I used this code
//Unit1.cpp file
#define NO_WIN32_LEAN_AND_MEAN
#include <shlobj.h>
#include <vcl.h>
#pragma hdrstop
#include "Unit1.h"
...
...
//In a button click event i have.
void __fastcall TForm1::Button1Click(TObject *Sender)
{
LPITEMIDLIST List = NULL;
char Path[MAX_PATH + 1] = {0};
if(SUCCEEDED(SHGetSpecialFolderLocation(0,CSIDL_COMMON_APPDATA, &List)))
{
if(SHGetPathFromIDList(List, Path))
ShowMessage(String(Path));
}
else
ShowMessage("SHGetSpecialFolderLocation failed");
CoTaskMemFree(List);
}
1 .Compile the code i have the following error messages.
[C++ Error] winsock2.h(109): E2238 Multiple declaration for 'fd_set'
[C++ Error] winsock.h(54): E2344 Earlier declaration of 'fd_set'
[C++ Error] winsock2.h(112): E2146 Need an identifier to declare
[C++ Error] winsock2.h(153): E2238 Multiple declaration for 'timeval'
[C++ Error] winsock.h(97): E2344 Earlier declaration of 'timeval'
[C++ Error] winsock2.h(209): E2238 Multiple declaration for 'hostent'
[C++ Error] winsock.h(153): E2344 Earlier declaration of 'hostent'
Technical Details
Message-ID:
<480ca220@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailReferences:
<480642de@newsgroups.borland.com> <4806635f$1@newsgroups.borland.com> <48085050@newsgroups.borland.com> <480859c5$1@newsgroups.borland.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,afa23fc7a34d3bb6 X-Google-Attributes: gid10cc67,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit From: "bar" <shaikakbar250281@yahoo.co.in> Newsgroups: borland.public.cppbuilder.nativeapi References: <480642de@newsgroups.borland.com> <4806635f$1@newsgroups.borland.com> <48085050@newsgroups.borland.com> <480859c5$1@newsgroups.borland.com> Subject: Re: Delete File Date: Mon, 21 Apr 2008 17:18:13 +0300 Lines: 47 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.3138 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-RFC2646: Format=Flowed; Response NNTP-Posting-Host: 62.150.228.242 Message-ID: <480ca220@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1208787488 62.150.228.242 (21 Apr 2008 07:18:08 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news2.google.com!news.glorb.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail