|
EnumWindowsProc?
Norm Almond
Chief Technical Architect
FS Walker Hughes Limited
|
|
|
|
|
It works fine. Thank you very much!
But I think enumeration's performance isn't very high. Are there any other solutions?
Law is meaningless without chaos.
Chaos without Law is equal to destruction.
Chaos and Law create our rich and colorful world.
|
|
|
|
|
Hi All,
I have one MFC GUI stand-alone application (its SDI doc/view architecture) and I want to convert it to ATL inproc dll. To do that I have added all the required files + resource file from MFC app to new ATL application. To invoke GUI from one of the interface method, I have created document template and then used CreateNewFrame.
When I use this ATL dll from a client application, it properly pops up GUI with some limitions. Accelerators dont work and tool bar buttons dont get the command ui message. I mean the menu items get update but associated tool bar buttons dont update. Does anybody tell me what is wrong ? Is there any different way to pop up GUI from ATL dlls ? Explicit loading of accelerator table also does not work.
Thanks,
Sujata.
|
|
|
|
|
Have you looked at WTL that comes with the Platform SDK. I think it might help you.
Michael
|
|
|
|
|
True !!! This is a second option I can consider. But the simplest and the fastest solution is removing MFC application's InitInstance and creating frame by my own in dll. Unfortunatly I dont have much knowledge about WTL. Does it support similar doc-view architecture ?
Thanks,
Sujata.
|
|
|
|
|
Probably PreTranslateMessage doesn't work when you invoke your component from client app. Override this function in your frame class (if it's not there yet) and put the breakpoint; if it doesn't fire, this is the source of your problems.
Explicit loading of accelerator table also does not work.
Loading doesn't have any effect visible to the user. You have to call ::TranslateAccelerator in the message loop if you want working accelerators. The problem is that you can't control the message loop from withing component - it's in the client app.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Thank you for the response.
I tried to override PreTranslateMsg in my frame class and also added TraslateAccelerator call. But PreTraslateMessage never gets fire.
Thanks,
Sujata.
|
|
|
|
|
PreTranslatemessage is called from within message loop somewhere in CWinThread. In your case it will not work - message loop is out of your control inside the client application.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
So does it mean that MFC DOC-View could not work properly with ATL ? Is there any other way to invoke GUI from ATL inproc ?
Thanks,
Sujata.
|
|
|
|
|
So does it mean that MFC DOC-View could not work properly with ATL?
I don't know. I think you could play with multiple threads and invoke your application in the separate GUI thread with its own message queue. Have no idea if this is worth the effort.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Great ! Thanks, I will try out.
Sujata.
|
|
|
|
|
I wrote DLL How can I compile it in Release mode ?
|
|
|
|
|
The build toolbar in VC++ has a combo box, from there you can choose the Release mode setting. Then compile.
Michael
|
|
|
|
|
|
Look on the build menu, you should have a Set Active Configuration option. In there should be a list of configurations. One should be Win32 Release or somethink like that.
Michael
|
|
|
|
|
1. If I choose this option (Win32 Reelease) and compile my proj I get Debug library with dll file that create and not something with Release.
2. What is the different between regular dll to Release ?
|
|
|
|
|
1. The default naming convention is for each type dll to have the same name -- they are put in different folders. Using Windows Explorer you will see the folders in your project folder. One is a debug and the other a release folder. You can change the name of the dll if you wish in Project | Settings, click the Link tab.
2. There are lots of differences between debug and release versions. Most of them are the way the compiler optomizes your code. You need to study the optinization flags (there are a lot of them) in MSDN or other books to realize what the compiler does to your code in release mode. In a nutshell, it rearranges the code, eliminating redundencies, inefficiencies, and makes it run faster. You need to be careful about this because I have seen it sometimes (but not very often) make wrong decisions.
|
|
|
|
|
Hi all,
I must create an application that capture all Pressed keys from the keyboard. My difficult is that i can't capture the Keys that is pressed outside my application.
Really i'm able to capture all the keys that are pressed into my application, but if my application works in backgroud and some keys are pressed it doesn't intercept.
Is there anybody going to help me?
If someone can help me send the solution to my E-Mail address : benmar@libero.it
Thanks!!!
|
|
|
|
|
You'll have to create a global hook. Check the docs for SetWindowsHookEx.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
You need to create a global keyboard hook using SetWindowsHookEx(WH_KEYBOARD...)
You need to set your HOOKPROC in a DLL. MSDN has more info I think.
|
|
|
|
|
In my program I would like to build a list of all files in a specified folder. I might also want to rename some of the files found, probably based on the name of the containing folder.
Could someone please give me a hint what MFC classes I could use? I guess CFile might come in handy, but what class/classes should I use to scan the folder?
|
|
|
|
|
|
in my application i have got to draw dotted, solid and dashdotted (wrong word, i know..) lines..
i create em like that:
cp_dot.CreatePen (PS_COSMETIC | PS_DOT, 1, RGB (0,0,0));
cp_solid.CreatePen (PS_COSMETIC | PS_SOLID, 1, RGB (0,0,0));
cp_dashdot.CreatePen (PS_COSMETIC | PS_DASHDOT, 1, RGB (0,0,0));
the problem is that they don't appear to be dotted after printing them (the dots are like thinner normal lines..) on the screen they appear like a bunch of short lines (NO DOTS...)
it's the same with the dashdot pen...
can anyone help me out???
thanx in advance
Bernhard
stolen signature #11
"That probably would've sounded more commanding if I wasn't wearing my yummy sushi pajamas."
-- Buffy
|
|
|
|
|
Get rid of PS_COSMETIC for a start. Are you saying the pen is not dotted on the screen, on a paper printout, or both ?
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
okay...
the pen is somewhat LIKE dotted on the screen.. it is drawn as many little lines
(somewhat like '-- -- -- -- --', when i zoom in, it looks like '- - - - - - -').
on the paper printout it looks like a totally drawn line.
the dashdot - line looks as follows.. '---- - ---- - ---- - ---- - ---' and it isn't printed
correctly either...
in other words.. the DOTS are too long, they look like lines.. and the dashdotted line is too long too.. i hope now you understand my problem..
btw.. i tried it without PS_COSMETIC.. it was a little bit better.. but not really as good as i wished it would be..
stolen signature #12:
eople who love sausage and respect the law should never watch either one being made
|
|
|
|