 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Blue Knight Guest
|
Posted: Thu Mar 03, 2005 12:47 am Post subject: Creating a Message DLL for Event Viewer |
|
|
Hi All,
Can anybody point me in the right direction for creating a message DLL
that can be used by the Event Viewer?
I have managed to use the Message Compiler (mc.exe) to create the
appropriate .h, .bin, and .rc files, but I can't figure out how to
create the message DLL from there - the Event Viewer doesn't seem to
recognise the DLL I have created as being a valid Message DLL.
Regards,
Bevan
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Mar 03, 2005 2:12 am Post subject: Re: Creating a Message DLL for Event Viewer |
|
|
"Blue Knight" <bevan231X (AT) Xhotmail (DOT) com> wrote
| Quote: | I have managed to use the Message Compiler (mc.exe) to
create the appropriate .h, .bin, and .rc files, but I can't figure
out how to create the message DLL from there
|
Simply add the .rc file to a DLL project, compile, and register the DLL in
the Registry as described by MSDN. Then include the .h file into your
application that is logging events.
| Quote: | - the Event Viewer doesn't seem to recognise the DLL I have created as
being a valid Message DLL. |
Did you register the DLL in the first place?
Gambit
|
|
| Back to top |
|
 |
Blue Knight Guest
|
Posted: Thu Mar 03, 2005 6:18 am Post subject: Re: Creating a Message DLL for Event Viewer |
|
|
Hi Remy,
| Quote: | Simply add the .rc file to a DLL project, compile, and register the DLL in
the Registry as described by MSDN. Then include the .h file into your
application that is logging events.
|
I thought I'd done that, but I'll try again.
| Quote: | - the Event Viewer doesn't seem to recognise the DLL I have created as
being a valid Message DLL.
Did you register the DLL in the first place?
|
You mean by writing into
HKLMSystemCurrentControlSetEventLog(MyApp)etc? Yes, I've done
that. I also made sure that the keys created were similar to those that
already existed.
Regards,
Bevan
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Thu Mar 03, 2005 6:22 am Post subject: Re: Creating a Message DLL for Event Viewer |
|
|
"Blue Knight" <bevan231X (AT) Xhotmail (DOT) com> wrote
| Quote: | You mean by writing into
HKLMSystemCurrentControlSetEventLog(MyApp)etc?
|
Yes.
| Quote: | Yes, I've done that. I also made sure that the keys created
were similar to those that already existed.
|
Assuming that the Registry settings are accurate, then the only reason for
the DLL to not work is if the message table in the DLL's resources is not
set up properly during compile-time. Since you did not show the contents of
the .rc or .h files, I cannot comment on whether they were generated
properly by mc.exe. I can tell you, though, that mc.exe is not required in
the first place, despite what Microsoft's documentation tries to suggest. I
have services of my own that I wrote to use message tables using
hand-written .rc files, and they work just fine in the Event Viewer.
Gambit
|
|
| Back to top |
|
 |
Blue Knight Guest
|
Posted: Thu Mar 03, 2005 11:23 am Post subject: Re: Creating a Message DLL for Event Viewer |
|
|
Hi Remy,
| Quote: | Assuming that the Registry settings are accurate, then the only reason for
the DLL to not work is if the message table in the DLL's resources is not
set up properly during compile-time. Since you did not show the contents of
the .rc or .h files, I cannot comment on whether they were generated
properly by mc.exe. I can tell you, though, that mc.exe is not required in
the first place, despite what Microsoft's documentation tries to suggest. I
have services of my own that I wrote to use message tables using
hand-written .rc files, and they work just fine in the Event Viewer.
|
I managed to resolve the problem - I had added the .RC file, but after
the .RES file in the project file list. In addition, I was doing a
Build every time. Once I did a Make, it seemed to work.
However, I would like to know how to create the .RC file without using
MC.EXE, do you have any good online references for that?
Thanks again for your help!
Regards,
Bevan
|
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Apr 20, 2005 8:18 pm Post subject: Re: Creating a Message DLL for Event Viewer |
|
|
"Blue Knight" <bevan231X (AT) Xhotmail (DOT) com> wrote
| Quote: | However, I would like to know how to create the .RC file without
using MC.EXE, do you have any good online references for that?
|
I don't use an RC file at all for that. I use PE Resource Explorer
(http://www.wilsonc.demon.co.uk/d6peresourceeditor.htm) to create a RES file
visually.
Gambit
|
|
| Back to top |
|
 |
Blue Knight Guest
|
Posted: Wed Apr 20, 2005 8:33 pm Post subject: Re: Creating a Message DLL for Event Viewer |
|
|
Hi Remy,
Remy Lebeau (TeamB) wrote:
Thanks for the link!
Regards,
Bevan
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|