Using Win32 functions in Visual FoxPro Image Gallery
Error Handling
..msdn
Beep
FatalAppExit
FlashWindow
FlashWindowEx
FormatMessage
GetErrorMode
GetLastError
MessageBeep
SetErrorMode
SetLastError
Code examples:
Connecting a local device to a network resource
Custom FTP Class for Visual FoxPro application
Retrieving System Error message strings
Testing serial ports
FormatMessage
..msdn    Add comment     W32 Constants      Translate this page
The FormatMessage function formats a message string. It can be used to obtain error message strings for the system error codes returned by GetLastError.
Code examples:
Custom FTP Class for Visual FoxPro application
Testing serial ports
Connecting a local device to a network resource
Retrieving System Error message strings
Declaration:
DWORD FormatMessage(
  DWORD dwFlags,      // source and processing options
  LPCVOID lpSource,   // message source
  DWORD dwMessageId,  // message identifier
  DWORD dwLanguageId, // language identifier
  LPTSTR lpBuffer,    // message buffer
  DWORD nSize,        // maximum size of message buffer
  va_list *Arguments  // array of message inserts
);
FoxPro declaration:
DECLARE INTEGER FormatMessage IN kernel32;
    INTEGER   dwFlags,;
    INTEGER   lpSource,;
    INTEGER   dwMessageId,;
    INTEGER   dwLanguageId,;
    INTEGER @ lpBuffer,;
    INTEGER   nSize,;
    INTEGER   Arguments

Parameters:
dwFlags
[in] Specifies aspects of the formatting process and how to interpret the lpSource parameter

lpSource
[in] Specifies the location of the message definition

dwMessageId
[in] Specifies the message identifier for the requested message. For obtaining system error messages put the error code into this parameter.

dwLanguageId
[in] Specifies the language identifier for the requested message

lpBuffer
[out] Pointer to a buffer for the formatted (and null-terminated) message

nSize
Maximum or minimum (depends on settings) number of bytes in the output buffer

Arguments
[in] Pointer to an array of values that are used as insert values in the formatted message
Return value:
If the function succeeds, the return value is the number of TCHARs stored in the output buffer
Usage:
dwFlags = FORMAT_MESSAGE_ALLOCATE_BUFFER +; 
    FORMAT_MESSAGE_FROM_SYSTEM +;
    FORMAT_MESSAGE_IGNORE_INSERTS 

* lnErr -- error code; e.g. returned by GetLastError()
lpBuffer = 0 

lnLength = FormatMessage(dwFlags, 0,;
    lnErr, 0, @lpBuffer, 0, 0) 
My comment:
This function retrieves data from the MESSAGETABLE resource in KERNEL32.DLL. Most likely, the same can be accomplished with the FindResource and LoadResource calls (RT_MESSAGETABLE).
Word Index links for the FormatMessage :
Translate this page:
  Spanish    Portuguese    German    French    Italian  
FreeTranslation.com offers instant, free translations of text or web pages.
Created: 2001-07-21 12:00:00
Modified: 2010-05-27 13:52:10
Visited in last 7 days: 66
User Contributed Notes:
There are no notes on this subject.


Copyright 2001-2017 News2News, Inc. Before reproducing or distributing any data from this site please ask for an approval from its owner. Unless otherwise specified, this page is for your personal and non-commercial use. The information on this page is presented AS IS, meaning that you may use it at your own risk. Microsoft Visual FoxPro and Windows are trade marks of Microsoft Corp. All other trademarks are the property of their respective owners. 

Privacy policy
Credits: PHP (4.4.9), an HTML-embedded scripting language, MySQL (5.6.38), the Open Source standard SQL database, AceHTML Freeware Version 4, freeware HTML Editor of choice.   Hosted by Korax Online Inc.
Last Topics Visited (54.90.207.75)
15 sec.Function: 'CryptDestroyHash'
31 sec.Function: 'FreePrinterNotifyInfo'
48 sec.Function: 'GdipBitmapSetResolution'
1.08 min.Function: 'SetupOpenInfFile'
1.35 min.Function: 'GdipGetDpiY'
1.62 min.Function: 'ClosePrinter'
1.92 min.Function: 'ImageList_GetIconSize'
2.18 min.Function: 'InternetOpen'
2.45 min.Function: 'SHGetSpecialFolderLocation'
2.73 min.Function: 'GdiFlush'
Google
Advertise here!