Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
MessageFormat unable to find resource in module
Message
From
04/11/2001 13:57:11
 
 
To
All
General information
Forum:
Visual Basic
Category:
Windows API functions
Title:
MessageFormat unable to find resource in module
Miscellaneous
Thread ID:
00577211
Message ID:
00577211
Views:
86
Hi all

I'm writing a VB6 program to monitor NT event logs from a central location. So far I've got the event records, got the event ID and source, found the module name from the registry, and loaded it with LoadLibraryEx. I find the EventMessageFile from the registry and load it with LoadLibraryEx and get a handle OK, but then when I use FormatMessage it returns zero and Err.LastDLLError is 1812, saying that the image does not contain a resource section.

The code looks like this:

lngSize = 2000&
strTemp = String(lngSize, 0)
lngFlags = FORMAT_MESSAGE_FROM_HMODULE Or FORMAT_MESSAGE_IGNORE_INSERTS Or FORMAT_MESSAGE_FROM_SYSTEM
lngLen = FormatMessage(lngFlags, hMsgFile, lngEventID, &H400&, strTemp, 2000&, ByVal 0&)

where...

lngFlags = &H1A00
hMsgFile = big non-zero number (file is IOLogMsg.DLL)
lngEventID = 7

I have messed about with different parameters, but without success. Does anyone have experience of doing this and making it work?

Regards

Neil
Reply
Map
View

Click here to load this message in the networking platform