Click here to Skip to main content
15,913,222 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: COleDropTarget.Register() problem - HELP ! Pin
Still learning how to code30-Nov-03 21:42
Still learning how to code30-Nov-03 21:42 
GeneralShellExecute problem Pin
nss30-Nov-03 5:04
nss30-Nov-03 5:04 
GeneralRe: ShellExecute problem Pin
BaldwinMartin30-Nov-03 6:20
BaldwinMartin30-Nov-03 6:20 
GeneralRe: ShellExecute problem Pin
nss30-Nov-03 6:53
nss30-Nov-03 6:53 
GeneralRe: ShellExecute problem Pin
Michael Dunn30-Nov-03 8:38
sitebuilderMichael Dunn30-Nov-03 8:38 
GeneralRe: ShellExecute problem Pin
BaldwinMartin30-Nov-03 19:49
BaldwinMartin30-Nov-03 19:49 
GeneralSetting File Attributes Pin
#realJSOP30-Nov-03 3:44
professional#realJSOP30-Nov-03 3:44 
GeneralRe: Setting File Attributes Pin
Michael Dunn30-Nov-03 8:49
sitebuilderMichael Dunn30-Nov-03 8:49 
Two things I'd change.
1. The line that builds the full path:
sInstalledFullPath.Format("%stracks\\%s", m_sSimPath, sInstalledTrackDir);
is assuming backslashes in certain places. Is that always right? I'd use the shlwapi functions instead (like PathAppend()) to build the name.

2. You're calling SetFileAttributes() without getting the existing attributes first. This results in you unsetting the FILE_ATTRIBUTE_DIRECTORY attribute, which might be what's causing the error. You should always get the current attrs and modify them. I'd do:
DWORD dwAttrs = GetFileAttributes ( sInstalledFullPath );
DWORD dwDesiredAttrib = bInTrackSet ? FILE_ATTRIBUTE_NORMAL : FILE_ATTRIBUTE_HIDDEN; 
 
  if ( INVALID_FILE_ATTRIBUTES == dwAttrs )
    // handle error...
  else
    {
    dwAttrs &= ~(FILE_ATTRIBUTE_NORMAL | FILE_ATTRIBUTE_HIDDEN);
    dwAttrs |= dwDesiredAttrib;
    BOOL bResult = SetFileAttributes ( sInstalledFullPath, dwAttrs );
    }


--Mike--
Ericahist | CP SearchBar v2.0.2 | Homepage | RightClick-Encrypt | 1ClickPicGrabber
If my rhyme was a drug, I'd sell it by the gram.
QuestionHow Creating Login with Password included by Dot? Pin
YULISA30-Nov-03 3:43
YULISA30-Nov-03 3:43 
QuestionHow Creating Login with Password included by Dot? Pin
YULISA30-Nov-03 3:38
YULISA30-Nov-03 3:38 
GeneralUSB Port & IEEE1394 Pin
mhmoud rawas30-Nov-03 2:22
mhmoud rawas30-Nov-03 2:22 
GeneralHelp of the program Pin
Member 64882830-Nov-03 2:04
Member 64882830-Nov-03 2:04 
GeneralRe: Help of the program Pin
Michael P Butler30-Nov-03 3:16
Michael P Butler30-Nov-03 3:16 
Generalregd CFile Object Pin
karteek30-Nov-03 1:24
karteek30-Nov-03 1:24 
GeneralRe: regd CFile Object Pin
David Wulff30-Nov-03 2:36
David Wulff30-Nov-03 2:36 
GeneralGetSystemMenu() doesn't contain Minimize/Maximize Pin
ohadp30-Nov-03 1:12
ohadp30-Nov-03 1:12 
GeneralRe: GetSystemMenu() doesn't contain Minimize/Maximize Pin
Michael Dunn30-Nov-03 8:56
sitebuilderMichael Dunn30-Nov-03 8:56 
GeneralRe: GetSystemMenu() doesn't contain Minimize/Maximize Pin
ohadp30-Nov-03 18:43
ohadp30-Nov-03 18:43 
GeneralSHGetPathFromIDList fails for the PIDL of the Recycle-Bin Pin
ohadp30-Nov-03 0:44
ohadp30-Nov-03 0:44 
GeneralRe: SHGetPathFromIDList fails for the PIDL of the Recycle-Bin Pin
Jörgen Sigvardsson30-Nov-03 11:51
Jörgen Sigvardsson30-Nov-03 11:51 
QuestionWSANO_DATA- WHAT does this mean? Pin
Stan the man30-Nov-03 0:20
Stan the man30-Nov-03 0:20 
Questionhow to create a shortcut to a dialup networking connection programmtically Pin
jetboy29-Nov-03 23:58
jetboy29-Nov-03 23:58 
GeneralProblems by catching outlook events Pin
derzellner29-Nov-03 23:52
derzellner29-Nov-03 23:52 
Generalwsnprintf() method .h file needed .. Pin
derik_konark29-Nov-03 23:52
derik_konark29-Nov-03 23:52 
GeneralRe: wsnprintf() method .h file needed .. Pin
PJ Arends30-Nov-03 0:05
professionalPJ Arends30-Nov-03 0:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.