#include <errno.h>extern int errno; HINSTANCE hModule=NULL; char buf[1000]; hModule=LoadLibrary("test.dll"); if (hModule == NULL) { sprintf(buf, "%s: %s \n", "errno = ", strerror(errno)); }
unsigned char buff[512]; FormatMessage( FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default language (LPTSTR) &buff, sizeof(buff), NULL ); printf("%s", buff);