|
Hello,
If you only need a message map, I suggest that you don't use MFC at all. Just using plain old WIN32 APIs frees you from loading DLLs and eases the deployment.
If this is no problem, you should use the SDI application. Simply removing the dialog class is not enough as you need a window to have a message map. You can also use some handy classes here on CP for tray icons.
Hope this helps
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
hi,
yes, i have to use MFC because there are some classes in my app which need it.
creating the tray icon and the popup is no problem. i only have to bother with getting rid of unnecessary dialogs and/or windows. the result should be a MFC based application with only a tray icon and a popup menu as its GUI - neither a dialog nor a window can be visible.
aren't there any sample codes out there? i can't believe that i'm the first one who's trying this.
greeting
|
|
|
|
|
Hello,
You can simply set the style of the framewindow (in the SDI case) or your dialog to invisible.
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
yes thanks. now i got what i want.
here's what i have done: i've used a simple MFC dialog based application. i used to start it in InitInstance with RunModalLoop() and set the visible mode of the dialog in the resource editor to false. In the CDialog derived class i've overloaded the function OnCreate and added the following Window Style:
ModifyStyleEx(0, WS_EX_TOOLWINDOW );
and, well, it works: NO WINDOW. NO DIALOG. NO TASKBAR ENTRY. AND I STILL GOT MY MESSAGE MAP
thanks everone.
greetings
|
|
|
|
|
I have a large, complex app MFC with /CLR, Unicode, uses several dll's including one .NET assembly.
Release build works perfectly on dev machine.
Deployed to target machine with .NET Framework 2.0 and all necessary dependencies. It crashes immediately every time in kernel32.dll with exception 0x406d1388 . Further examination with depends.exe shows that the caller was advapi32.dll but I can't get much more info.
This happens on WinXP SP2 and on Win2k SP4.
It seems that the exception is the one normally used to set a thread name so it makes no sense to me that it's causing a crash.
If I run the app (same release version) by remote debugging from VS2005 it all works properly.
I've built a simpler test app to try to reproduce use as much as possible of the same environment (MFC, CLR, dll's and so on) and it also works perfectly.
Please can someone give me a clue????????
Regards,
Phil
|
|
|
|
|
You will need to get symbols and get a stack trace so you can find out what the actual call is.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
Thanks for the reply.
That's proving $%^@# difficult!
The problem seems to occur at some stage in the runtime initialisation.
If I run the programme under VS2005 it won't fail. I set it to break on the exception but it never sees it.
If I jit debug it the process wakes up and continues faultless as soon as the debugger attaches.
WinDbg sometimes sees the exception but I can't get any sense out of the call stack. I can't set breakpoints using WinDbg because it corrupts the code somehow and complains about "invalid x86 breakpoint in IL stream".
Any ideas ... ?
Regards,
Phil
|
|
|
|
|
I have fixed it. Please see my reply to the original post for details.
Thanks again for your interest.
Phil
|
|
|
|
|
Eureka! I have found it!
After hours of trying various debuggers and debugging strategies, countless cups of good strong tea and not a few words of frustration and annoyance I have located and fixed the problem.
Buried deep in my own initialisation code, in a place I haven't visited for years and had forgotten all about is a call to a function called SetThreadName which uses exception 0x406d1388 . This was being compiled as managed code so the framework was seeing the exception even before the catch block in the same function. The solution was simply to mark that function as unmanaged (and then drink more tea ).
Phil
|
|
|
|
|
Never use managed code
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
Dear Friends
I have created a dialog based MFC application. Here I have one form say "MyForm", showing on my current desktop when I run my application. I have two button on this form called "NewDesktop" and "OldDesktop".
Now when I press "NewDesktop" I use CreateDesktop() functions and then SwitchDesktop() so It creates new desktop and shows the new desktop. But now it hides my previous application and my form. Now I want to show my form(MyForm) in this new desktop. I don't know how to do that?
Any help please?
With many many thankx and regards in advance
Mahesh
|
|
|
|
|
Have you tried "SetThreadDesktop" and then create the UI?
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
Hi...
I have tried that but it return's false value.
Whats seems to be the reason?
Mahesh
|
|
|
|
|
"Remarks
The SetThreadDesktop function will fail if the calling thread has any windows or hooks on its current desktop (unless the hDesktop parameter is a handle to the current desktop)."
You must do this FIRST, then create your window. I don't think there is a way to move an already created window between desktops as it's managed by the WM for that particular desktop.
8bc7c0ec02c0e404c0cc0680f7018827ebee
|
|
|
|
|
hello,
does anybody know how to make a financial calendar? Here are some rules :
1- it begins on Jan 1 and ends at Dec 31 (always)
2- it has 4 4 5 (it means Jan has 4 weeks, Feb 4 weeks and March 5 and so on for each quarter)
Ex: Avril 4 weeks, Mai 4 weeks and Jui 5 weeks;
Jui 4 weeks, Aug 4 weeks and Sept 5 weeks;
Oct 4 weeks, Nov 4 weeks and Dec 5 weeks.
3- it has fews exceptions for bisextil year, on Jan can have 5 weeks. Ex: on 2004
Thanks...
|
|
|
|
|
And what do you need exactely ? Every calendar has the features you described, IMO. Do you need a Control, with UI ? Or a simple table or funcitonb that returns dates ? For which kind of app ? MFC ?
~RaGE();
|
|
|
|
|
i need a formula to create a financial calendar beside on standard one. I work with Progress v10.
|
|
|
|
|
homework?
regards,
mykel
If they give you lined paper, write the other way!
|
|
|
|
|
Is threre a way to change the background color and the font color in an edit box (rich or not)? 
|
|
|
|
|
Yes. I would look into the WM_CTLCOLOREDIT message.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
SubClass the edit control and handle in the ON_WM_CTLCOLOR_REFLECT.
|
|
|
|
|
I found a function for the rich edit box, member of the cricheditctrl !
|
|
|
|
|
Hey,
what message is send from a CListCtrl when a user changes the colwidht on the Header? I need this, beause I have to reposition some controls.
Thanks for your help...
|
|
|
|
|
Look for the HDN_BEGINTRACK notification message. See the example here.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
How to change the caption of a dialog box dynamically?
|
|
|
|