|
Hi Dave Calkins,
The 0xC015000F activation context error I experienced was easily avoided by adding the following line into my InitInstance() function.
afxAmbientActCtx = FALSE;
I did a bit of research into the subject and discovered that this boolean enables or disables the MFC internal SxS Activation Context[^] switching.
By setting this boolean to false your MFC application Module State Management[^] will not use the Activation Context[^] technologies. Essentially your MFC state management will work about as good as it did in older MFC versions.
Setting the boolean to false will not directly cause any problems. But unfortunately your MFC application loses benefits from SxS. This may or may not be a problem depending on whether your application uses multiple versions of the same library.
Welcome to DLL Hell[^].
Best Wishes,
-David Delaune
|
|
|
|
|
Hi All,
I am facing problem pretty much similar to Lance's one.My application crashes while closing.With a message "The activation context being deactivated is not the most recently activated one.". I tried the solution suggested in multiple replies to this issue, - adding the line afxAmbientActCtx = FALSE; to InitInstance();.But it didn't helped, the crash is still there.I tried to find any unhandled activation context but we do not have any left !!! Although we are saving xml files while closing the application.Any more ideas ? this is how the dump looks like --
> ntdll.dll!776e8b2e()
[Frames below may be incorrect and/or missing, no symbols loaded for ntdll.dll]
ntdll.dll!77733d60()
ole32.dll!75e101e5()
ole32.dll!75e10261()
ole32.dll!75e106fd()
ole32.dll!75dcc969()
msvcrt.dll!772f513f()
msvcrt.dll!772f50cf()
ole32.dll!75dc6cd4()
mfc90.dll!5ced3c82()
mfc90.dll!5ced3b22()
mfc90.dll!5d01e29f()
mfc90.dll!5ce99717()
mfc90.dll!5cedea57()
ole32.dll!75d7aa55()
ole32.dll!75dc6cd4()
mfc90.dll!5ced3c82()
mfc90.dll!5ced3b22()
mfc90.dll!5d01e29f()
mfc90.dll!5ce99717()
mfc90.dll!5cedea57()
ole32.dll!75d7aa55()
ole32.dll!75dc6cd4()
mfc90.dll!5ced3c82()
mfc90.dll!5ced3b22()
mfc90.dll!5d01e29f()
mfc90.dll!5ce99717()
mfc90.dll!5cedea57()
ole32.dll!75d7aa55()
Thanks In Advance
Sumit
|
|
|
|
|
Hi all,
I don't know if anyone is still having this problem, but..
Did any of you tried to figure out what unhandled exceptions occured?
I fixed my problem by switching on ALL Win32 exceptions. Found the issue in just minutes.
In VS 2005 or VS 2008; Debug -> Exceptions... (Ctrl-Alt-E) -> Check the option "Win32 Exceptions" (which enables all options in that branch)
Now start your app in debug mode in VS (Hit the F5 button). Look where it crashes now with an unhandled exception. Its just that simple
Happy hacking,
Albert van Peppen
PS.
The use of "afxAmbientActCtx = FALSE;" should be avoided at all times because it will hide some issues which gonne bite you later on!
|
|
|
|
|
|
Thanks for the info, I appreciate it.
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
Hey Jorgen,
Din valkomna
|
|
|
|
|
Hi,
With the help of Bacon Ultimate Chessburger
I changed my program or My Control Creation
Logic from ::Create to DDX_CONTROL
DDX_CONTROL in addition to Attaching the
Window object to the CWnd object
Subclass it
After the App Crashed with the Stack Overlow
right after exiting ::DoDataExchage
I went to the "CALL STACK" menu item
and noticed there were a number of calls
to AfxWndProc with message # 15
If I use DDX_CONTROL to Attach an Object
DO I have to provide that Dialog Control
A Message Map entry
|
|
|
|
|
can you paste your code here? you should create your dynamicaly created controls in OnInitDialog, not on DoDataExchange or in OnCreate cause maybe CWnd is not valid in that point
|
|
|
|
|
For the static controls I didn't have a unique
Identfier e.g IDC_STATIC for all my static
controls
DDX_CONTROL(pDX,IDC_STATIC,mycstatic)
DDX_CONTROL(pDX,IDC_STATIC,mycstatic1)
Once I gave each of them a unique identifier
e.g .IDC_STATIC1 IDC_STATIC2
the problem resolved
thankx
|
|
|
|
|
Hi friends,
I want to know why does an application class contain only one object in MFC. Plz tell me.
Thanks & Regards
Sairam
|
|
|
|
|
Because there is only one application in your application...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
In an executable, there must be one entry point that can be called by the loader, runtime etc.
There cannot be any ambiguity here.
That is why we can have only one main function in a console program and only one WinMain function in a windows program. And that is exactly why we can have only one CWinApp or CWinAppEx instance 'cause this class encapsulates the entry point for the executable.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
|
Hi,
I can give "transaction effect" with BitBlt() on Screen in case of Bitmap image.
but I'd like to know how to give "transaction effect" in case of jpg,gif and so on.
=== short example code ===
CDC MemDC;
BITMAP bm;
m_Bitmap.LoadBitmap(IDB_BITMAT1);
m_Bitmap.GetBitmap(&bm);
MemDC.CreateCompatibleDC(pDC);
CBitmap* pOld = (CBitmap*)MemDC.SelectObject(&m_Bitmap);
int w=bm.bmWidth;
int h=bm.bmHeight;
for(int j=0;j<w;j+=2)
{
pDC->BitBlt(0,0,j,h,&MemDC,w-j,0,SRCCOPY);
}
pDC->BitBlt(0,0,w,h,&MemDC,0,0,SRCCOPY);
MemDC.SelectObject( pOld );
Any comment will help me!
Thanks, have a day.
|
|
|
|
|
|
Bacon Ultimate Cheeseburger wrote: 1300 calories of pure beef goodness can't be wrong!
However you've to run for about twelve miles in order to consume them.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi everybody, Happy Friendship Day to you all.
I want to know what is the main difference between OnDraw() and OnPaint(). Plz tel me in which cases they will be used?
Thanks & Regards
Sairam
|
|
|
|
|
OnPaint is the message handler for WM_PAINT .
Here you do any drawing on your window.
OnDraw is a virtual function for all view classes.
OnDraw is called by the OnPaint handler for each view to do its on-screen drawing.
OnDraw will also be called by the MFC framwork for printing in respose to WM_PRINT .
This is why OnDraw has a CDC parameter which specifies the DC on which to do the drawing.
This could be the DC of either the screen or the printer depending on where the drawing needs to be done.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
please suggest ur ideas??
|
|
|
|
|
If you could make it do syntax coloring, that would be very cool.
|
|
|
|
|
I can see where creating even a small text editor could be helpful. It can be very instrumental in getting experience dealing with primitive text layout (fixed vs. variable width fonts), carets, word wrap (or not to wrap), auto-indention including spaces vs tabs, syntax highlighting and a wide range of other text related stuff.
You could do something nifty like displaying comments containing FIXME, TODO and other such tags in a different color. Something small that utilizes functionality you would already need to implement but makes it stand out a little more.
I guess the big question is how much time do you have to implement it and how functional does it have to be?
1300 calories of pure beef goodness can't be wrong!
|
|
|
|
|
i have around 8 months to complete my project!!
|
|
|
|
|
The big feature I see missing from a lot of IDE's is syntax highlighting of USER-DEFINED TYPES.
Say I have a class called Foo, and I instantiate an object of type Foo...
int theInt;
Foo theFoo;
Of course that greatly complicates things as you would need to find every single user-defined type (including types defined in windows headers, etc). This then leads me to think - why the hell DOESN'T Visual Studio have this feature? It would be incredibly simple to implement, given that Intellisense already does the hard part of identifying user-defined types...
|
|
|
|
|
Starting with Visual Studio 5 you can edit the usertype.dat file (found in the same directory as msdev.exe) to add custom keywords. The "User Keyword" setting in the "Fonts and Colors" configuration can be used to change the color of these keywords (all custom keywords are the same color). Technically you should be able to create a plugin which scans either the class view data or browser file and automatically updates this file. Later versions of Visual Studio provide additional support for custom languages and syntax highlighting.
http://msdn.microsoft.com/en-us/library/bb166778(VS.80).aspx[^]
[Correction: for later versions of VS it's devenv.exe instead of msdev.exe]
1300 calories of pure beef goodness can't be wrong!
|
|
|
|
|
I'm aware of this, but the typical project is going to have a large number of classes and other user-defined types... So it's somewhat inconvenient to manually edit a file every time you add a new one.
Not to mention the fact that these settings are global and will be applied regardless of which project you're working on, so you may have types appearing with syntax highlighting even if they dont exist within the current project.
Someone needs to do something about that and make it dynamically updated in real-time, and if you're going to be writing a code editor for your final project, then why not implement such a feature?
|
|
|
|