Hello DAD,
The main reason why the Event Viewer indicated that there was no information available in your message is because the DLL you created in CVI is not formatted as a resource-only DLL.
I would suggest creating a resource-only DLL using another tool (Visual Basic, etc). The steps to create a resource-only DLL in VB are as follows:
(courtesy of www.thevbzone.com)
"Create an ActiveX DLL project and rename the default "Class1" class module to "NoInterface" (or something like that) to indicate that this ActiveX DLL isn't meant to be instantiated and called as a COM object, but rather meant to be a static source of resources. Next, open up the resource editor and add your custom resources and save the resource as part of the ActiveX DLL project. Compile and build your DLL."
If you do not have Visual Studio, I have attached a resource-only DLL which includes your sample resource file (ELTMessages.res).
1) Manually copy the attached DLL (or the one you create) into the system32 directory.
2) Edit the line: strcpy(szBuf, "C:\\WINDOWS\\system32\\Project1.dll");
with the name of your new DLL.
3) Then, you can delete the ELT registry key so that the key is created with the new path to the resource-only DLL.
4) Finally the message returned by FormatMessage() should be of type LPTSTR instead of an array of UCHAR.
In particular, the call should look like:
LPTSTR Message;
status = FormatMessage( FORMAT_MESSAGE_FROM_HMODULE | FORMAT_MESSAGE_ALLOCATE_BUFFER,
hModule, MSG_TEST_ERROR, MAKELANGID(LANG_ENGLISH, SUBLANG_ENGLISH_US),
(LPSTR) &Message, 0, NULL);
Hope this helps.