From: Albe on
Dear all,
I want to do a MFC dll that catch windows messages and run in
background. To do this I want to start the dll with rundll32 at the
windows startup.
I wrote the dll but I can't use with rundll32, it seems that is not
possible to find the entry-point.

Any suggestions?
From: David Lowndes on
>I want to do a MFC dll that catch windows messages and run in
>background. To do this I want to start the dll with rundll32 at the
>windows startup.
>I wrote the dll but I can't use with rundll32, it seems that is not
>possible to find the entry-point.

You'll need to tell us more about what you've done, and what in
particular is wrong.

For starters, what have you created (and why)? Is it an MFC extension
DLL, or just a normal DLL that makes use of MFC?

You say you want it to catch messages - how's it doing that?

Dave
From: Kerem Gümrükcü on
Ciao Alberto,

what exactly are you trying to do? Please
show us some examples. To make something
work with rundll32, you have to do something like:

rundll32 shell32, ShellAbout

shell32 = shell32.dll
ShellAbout = the C-Style exportet function of your dll

In general you must export a C function from your sll
to make that work,...read this:

[Exporting from a DLL ]
http://msdn.microsoft.com/en-us/library/z4zxe9k8(VS.80).aspx

Hope this helps,...

Regards

Kerem

--
-----------------------
Beste Gr�sse / Best regards / Votre bien devoue
Kerem G�mr�kc�
Latest Project: http://www.pro-it-education.de/software/deviceremover
Latest Open-Source Projects: http://entwicklung.junetz.de
-----------------------

"Albe" <alberto_ressia(a)tiscali.it> schrieb im Newsbeitrag
news:c30f9b28-2e5f-4685-936b-40b736d3fefe(a)k4g2000yqb.googlegroups.com...
> Dear all,
> I want to do a MFC dll that catch windows messages and run in
> background. To do this I want to start the dll with rundll32 at the
> windows startup.
> I wrote the dll but I can't use with rundll32, it seems that is not
> possible to find the entry-point.
>
> Any suggestions?

From: Albe on
Hi all and thank you for the support,
sorry for my soft explanation, I'm going to explain you better. First
of all, usually I write the code for MFC application, for this work I
wrote an MFC application that works fine and the customer ask me to do
the same things with a simple dll (I'm not an expert in dll, I simply
did a file with a couple of function). So, I started from my MFC
application and I rewrote the code for a dll.
The dll works fine but now I have to add, in the application and in
the dll, a special behaviour before the windows goes in sleep mode
(S3).

In the application no problem, I added WM_POWERBROADCAST message in
the message map and I can do the special code. Now I have to do the
same in the dll, I used:
- GetMessage
- PreTranslateMessage
- PeekMessage

Unfortunally no one catchs the message, the strange thingh is that I
can intercept some message (WM_TIMER etc etc) but no the
WM_POWERBROADCAST.

It seems that is related to the assence of dialog.

So I was trying to do a MFC dll because there is the message map as
the application but if I try to start the dll with rundll32 a
messagebox advise me that is not possible (it seems that the sistem
can't find the Dll EntryPoint).

What can I do?

Best regards

Alberto
From: Joseph M. Newcomer on
It sounds like you are trying to create a hook, such as a message hook.

To do this, you require a DLL, which under ideal conditions is *not* an MFC-based DLL, and
you require an app to run it.

Since you have said nothing about what you are really trying to do, how you tried to use
rundll32, or anything else that might be useful in diagnosing what your problem is, it is
almost impossible to say something other than "you got it wrong, don't do that".

Note: MFC-based hook DLLs are considered to be In Bad Taste because they require injecting
not only your DLL but the entire MFC runtime into every process that handles window
messages. Not exactly the best of ideas. A good hook DLL is written without any MFC at
all.
joe

On Thu, 29 Oct 2009 04:20:55 -0700 (PDT), Albe <alberto_ressia(a)tiscali.it> wrote:

>Dear all,
>I want to do a MFC dll that catch windows messages and run in
>background. To do this I want to start the dll with rundll32 at the
>windows startup.
>I wrote the dll but I can't use with rundll32, it seems that is not
>possible to find the entry-point.
>
>Any suggestions?
Joseph M. Newcomer [MVP]
email: newcomer(a)flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm