Click here to Skip to main content
15,921,793 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionHandling events in MFC. Pin
Pratheep Kenny18-Sep-06 21:16
Pratheep Kenny18-Sep-06 21:16 
AnswerRe: Handling events in MFC. Pin
Christian Graus18-Sep-06 21:41
protectorChristian Graus18-Sep-06 21:41 
AnswerRe: Handling events in MFC. Pin
Hamid_RT18-Sep-06 21:51
Hamid_RT18-Sep-06 21:51 
AnswerRe: Handling events in MFC. Pin
Pratheep Kenny19-Sep-06 0:45
Pratheep Kenny19-Sep-06 0:45 
QuestionHow to get the a system's Uniquee ip address on internet through coding ! Pin
gloriousgopi18-Sep-06 21:04
gloriousgopi18-Sep-06 21:04 
AnswerRe: How to get the a system's Uniquee ip address on internet through coding ! Pin
Matt Godbolt18-Sep-06 22:49
Matt Godbolt18-Sep-06 22:49 
GeneralRe: How to get the a system's Uniquee ip address on internet through coding ! Pin
gloriousgopi18-Sep-06 23:18
gloriousgopi18-Sep-06 23:18 
AnswerRe: How to get the a system's Uniquee ip address on internet through coding ! Pin
David Crow19-Sep-06 3:46
David Crow19-Sep-06 3:46 
AnswerRe: How to get the a system's Uniquee ip address on internet through coding ! Pin
cmk19-Sep-06 8:19
cmk19-Sep-06 8:19 
QuestionRegarding " #if _MSC_VER >= 1100" Pin
janadhana18-Sep-06 20:29
janadhana18-Sep-06 20:29 
AnswerRe: Regarding " #if _MSC_VER >= 1100" Pin
Christian Graus18-Sep-06 20:40
protectorChristian Graus18-Sep-06 20:40 
AnswerRe: Regarding " #if _MSC_VER >= 1100" Pin
prasad_som18-Sep-06 20:41
prasad_som18-Sep-06 20:41 
AnswerRe: Regarding " #if _MSC_VER >= 1100" Pin
Nibu babu thomas18-Sep-06 20:42
Nibu babu thomas18-Sep-06 20:42 
QuestionListing files in a directory Pin
Imtiaz Murtaza18-Sep-06 20:11
Imtiaz Murtaza18-Sep-06 20:11 
AnswerRe: Listing files in a directory Pin
Nibu babu thomas18-Sep-06 20:40
Nibu babu thomas18-Sep-06 20:40 
AnswerRe: Listing files in a directory Pin
Hamid_RT18-Sep-06 21:02
Hamid_RT18-Sep-06 21:02 
AnswerRe: Listing files in a directory Pin
David Crow19-Sep-06 3:54
David Crow19-Sep-06 3:54 
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.

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.