Click here to Skip to main content
15,895,142 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHow to paint the caption bar Pin
kiranin18-Sep-06 18:50
kiranin18-Sep-06 18:50 
AnswerRe: How to paint the caption bar Pin
prasad_som18-Sep-06 19:29
prasad_som18-Sep-06 19:29 
AnswerRe: How to paint the caption bar Pin
Hamid_RT18-Sep-06 19:31
Hamid_RT18-Sep-06 19:31 
GeneralRe: How to paint the caption bar Pin
kiranin18-Sep-06 19:35
kiranin18-Sep-06 19:35 
GeneralRe: How to paint the caption bar Pin
Hamid_RT18-Sep-06 20:48
Hamid_RT18-Sep-06 20:48 
GeneralRe: How to paint the caption bar Pin
kiranin18-Sep-06 21:36
kiranin18-Sep-06 21:36 
AnswerRe: How to paint the caption bar Pin
Sarath C18-Sep-06 19:42
Sarath C18-Sep-06 19:42 
Questionquestion about getfileattributes function Pin
swatgodjr18-Sep-06 14:39
swatgodjr18-Sep-06 14:39 
i have been able to get my program to compile correctly and added in code to view the returned result of the dword value from GetFileAttributes() which should display the file attributes of the given file but when the function is called all it returns is an error message saying "the process cannot access the file because it is being used by another process." yet i made sure that before it was called i had closed the file before the function was called and even tried the function on a file that was never opened and it still gave the same error.

here is the code for my function:
<br />
ReportAttributes(char filename[])<br />
{<br />
  LPCTSTR pszCaption = "Debug Results:";<br />
  DWORD attribList   = GetFileAttributes(filename);<br />
<br />
  if(!attribList)<br />
  {<br />
	  MessageBox("An Error Has Occured", pszCaption, MB_ICONWARNING);<br />
  }<br />
  else<br />
  {<br />
    const DWORD dwFormatControl = FORMAT_MESSAGE_ALLOCATE_BUFFER |<br />
                                  FORMAT_MESSAGE_IGNORE_INSERTS |<br />
                                  FORMAT_MESSAGE_FROM_SYSTEM;<br />
<br />
    LPVOID pTextBuffer = NULL;<br />
    DWORD dwCount = FormatMessage(dwFormatControl, <br />
                                  NULL, <br />
                                  attribList, <br />
                                  0, <br />
                                  (LPTSTR) &pTextBuffer, <br />
                                  0, <br />
                                  NULL);<br />
    if(0 != dwCount)<br />
    {<br />
      MessageBox((LPCSTR)pTextBuffer, pszCaption, MB_ICONERROR);<br />
      LocalFree(pTextBuffer);<br />
    }<br />
    else<br />
    {<br />
      MessageBox("Unknown error", pszCaption, MB_OK);<br />
    }<br />
  }<br />
}<br />


i varied the icons in the messagebox calls to see which one came up when the error was displayed.
AnswerRe: question about getfileattributes function Pin
Nibu babu thomas18-Sep-06 17:22
Nibu babu thomas18-Sep-06 17:22 
GeneralRe: question about getfileattributes function Pin
swatgodjr18-Sep-06 17:54
swatgodjr18-Sep-06 17:54 
GeneralRe: question about getfileattributes function Pin
Nibu babu thomas18-Sep-06 17:58
Nibu babu thomas18-Sep-06 17:58 
GeneralRe: question about getfileattributes function Pin
swatgodjr18-Sep-06 18:51
swatgodjr18-Sep-06 18:51 
AnswerRe: question about getfileattributes function Pin
kakan18-Sep-06 22:33
professionalkakan18-Sep-06 22:33 
AnswerRe: question about getfileattributes function Pin
David Crow19-Sep-06 4:00
David Crow19-Sep-06 4:00 
GeneralRe: question about getfileattributes function Pin
swatgodjr19-Sep-06 8:18
swatgodjr19-Sep-06 8:18 
QuestionDo you see the resource leak? Pin
charlieg18-Sep-06 14:23
charlieg18-Sep-06 14:23 
AnswerRe: Do you see the resource leak? Pin
charlieg18-Sep-06 14:29
charlieg18-Sep-06 14:29 
AnswerRe: Do you see the resource leak? Pin
Stephen Hewitt18-Sep-06 16:26
Stephen Hewitt18-Sep-06 16:26 
AnswerRe: Do you see the resource leak? Pin
charlieg18-Sep-06 16:35
charlieg18-Sep-06 16:35 
AnswerRe: Do you see the resource leak? Pin
Christian Graus18-Sep-06 18:05
protectorChristian Graus18-Sep-06 18:05 
JokeRe: Do you see the resource leak? Pin
charlieg19-Sep-06 4:21
charlieg19-Sep-06 4:21 
AnswerRe: Do you see the resource leak? Pin
charlieg19-Sep-06 8:20
charlieg19-Sep-06 8:20 
QuestionReading from a file input Pin
Jay0318-Sep-06 13:50
Jay0318-Sep-06 13:50 
AnswerRe: Reading from a file input Pin
Stephen Hewitt18-Sep-06 16:28
Stephen Hewitt18-Sep-06 16:28 
QuestionCan't link to a library in Visual studio 2005 Pin
BarryOg18-Sep-06 11:33
BarryOg18-Sep-06 11:33 

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.