|
if the project is not using MFC, you can still download the Express Edition for free.
otherwise, the best you can do is recreating a solution under VS2003 and importing the files, at the risk that you won't have the solution settings anymore...
|
|
|
|
|
I would really recomend upgrading to 2005. I recently did it myself, though it takes a while to get used to the new layout it is by far one of the best compilers MS has produced.
|
|
|
|
|
are you certain?
Most of the reviews I read here on CP are bad, or even worse for C++/MFC coding.
the compiler might be good, but the IDE looks to be slow and slugish.
|
|
|
|
|
Of course I'm not certain, it's only my opinion. I used VC6 and 7 in the past. While version 7 was ok, 6 gave me nothing but a headache. It often froze while building, repositioned breakpoints without my sayso and forgot settings. Not to mention it's anability to correctly handle unicode caracters.
VC8 does take a little getting used to. Infact I hated it at first, the GUI is big and the controls were not where I liked them. But everything can be configured. I now have it layed out the way I like and not once had a problem with it.
|
|
|
|
|
( on vs.net 2003, on WinXP )
I'm trying to validate a path on my machine.
I use SHBrowseForFolder to select a folder on my system, as a test, I select "My Document"
The path returned is "C:\Documents and Settings\me\My Documents" which is a valid path, if I copy this in an windows explorer, it goes to that folder.
In my code, I use stat to check the folder like this :
struct stat St;
int iRet = stat( sPath, &St );
if( iRet != 0 )
{
perror( "Problem getting information" );
switch (errno)
{
case ENOENT:
printf("File %s not found.\n", sPath);
break;
case EINVAL:
printf("Invalid parameter to _stat.\n");
break;
default:
printf("Unexpected error in _stat.\n");
}
}
The problem I get is that stat return -1 for a lot of valid paths, and the error returned goes to the case default .
am I doing this wrong ?
Thanks.
|
|
|
|
|
Are you using stat() to validate a path returned by SHBrowseForFolder() ? If so, why?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
( I wish it was monday morning, at leat I'd have an excuse )
I use SHBrowseForFolder to select a path, I will store that path in the applications' settings.
When I reload the settings, I have to check if the path is still valid, and will use stat , and it fails on a valid path.
|
|
|
|
|
Maximilien wrote: ...and it fails on a valid path.
So use _access() or PathIsDirectory() instead
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
_access only checks for the existence of the path, not if I have read/write access to it.
|
|
|
|
|
Maximilien wrote: _access only checks for the existence of the path, not if I have read/write access to it.
Of course that's all it does. This is what you asked for (i.e, "I'm trying to validate a path on my machine.") in your initial post. If you want to know if you have read/write access to a folder, you need to state such.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
Check errno, besides try to use BOOL PathFileExists( LPCTSTR pszPath );
-----------
Mila
|
|
|
|
|
Mila025 wrote: ...try to use BOOL PathFileExists( LPCTSTR pszPath );
SHBrowseForFolder() does not return a file, so PathFileExists() is not going to help in that regard.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi,
PathFileExists Function:
Determines whether a path to a file system object such as a file or directory is valid.
Syntax
BOOL PathFileExists( LPCTSTR pszPath );
-----------
Mila
|
|
|
|
|
the path exists according to PathFileExists but not according to stat which returns an errno of ENOENT.
|
|
|
|
|
Maximilien wrote: the path exists according to PathFileExists but not according to stat which returns an errno of ENOENT.
This will happen if the path has a trailing backslash. Just out of curiosity, why are you using such an antiquated function as stat() , especially when newer alternatives exist?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
because I thought it would also give me information about the permisions ( read/write ) in the folder with the st_mode of the stat structure.
|
|
|
|
|
Maximilien wrote: because I thought it would also give me information about the permisions ( read/write )...
See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks David.
|
|
|
|
|
hi all
how to copy file from source to destination in vc++?
pls give me reply.
Thanks & Regards
rakesh baldha
|
|
|
|
|
Hi,
BOOL CopyFile( LPCTSTR lpExistingFileName, LPCTSTR lpNewFileName, BOOL bFailIfExists );
or
int SHFileOperation( LPSHFILEOPSTRUCT lpFileOp );
-----------
Mila
|
|
|
|
|
Have you tried CopyFile() or SHFileOperation() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi,
I want to get country code of Wireless LAN adapter.
for this i am using deviceIOControl as follows.
NDIS_OID ndisOid
//Atheros Specific OID
ndisOid = OID_ATH_REGULATORY_DOMAIN;
DeviceIoControl(theApp.m_hDevHandle,
IOCTL_NDIS_QUERY_GLOBAL_STATS,
(LPVOID)&ndisOid,
sizeof(ndisOid) + sizeof (ULONG) -1,
(LPVOID)&dwCountryCode,
sizeof(dwCountryCode),
&ulLen,
NULL);
this is working for WindowsXp, but not for Windows Vista.
can any body help me in this?????
to resolve this problem i got the information from MSDN site that it need to use WMI through the class "MSNdis_80211_WEPStatus".
i have seen it through WMI browser. but not getting any relevent information
pavan
|
|
|
|
|
Hello,
I am working with MFC dll and I would like have only one instance for a class into my dll.
now I have into my class a static funtion to GetObject():
static GlobalParameter* GetObject()
{
static GlobalParameter oneinstance;
return &oneinstance;
}
A other class that also in a other dll in this class and I have show I get different pointer from main app and this class.
Thank you to help me!
AutreChien
|
|
|
|
|
NorGUI wrote: A other class that also in a other dll in this class and I have show I get different pointer from main app and this class.
Uuh ? Sorry but I did not understand what you are trying to say. You need to explain that part a little bit clearer. What are you doing exactly with this class ?
|
|
|
|
|
Are you wanting only one instance of the DLL, or one instance of a class within the DLL?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|