From: Eric on
An ASSERT is thrown in wincore.cpp/886 when I call CDialog::Create. I'm
compiling a DLL. The problem only happens if I set to use MFC in a Shared
DLL. I cannot remember what I've changed since this happens. But when I
select static link MFC it works perfectly. The ASSERT is in
CWnd::AssertValid, "should be in temp. handle map". CWnd::AssertValid is
called by AfxAssertValidObject, then by CWnd::CreateDlgIndirect,
CDialog::CreateIndirect, CDialog::Create (according to stack trace). In the
debugger I cannot debug MFC source (I don't know why). Any ideas?
Eric


From: Ajay Kalra on
On Feb 6, 9:45 am, "Eric" <bauersa...(a)kull.ch.cuthere.nospam.me.com>
wrote:
> An ASSERT is thrown in wincore.cpp/886 when I call CDialog::Create. I'm
> compiling a DLL. The problem only happens if I set to use MFC in a Shared
> DLL. I cannot remember what I've changed since this happens. But when I
> select static link MFC it works perfectly. The ASSERT is in
> CWnd::AssertValid, "should be in temp. handle map". CWnd::AssertValid is
> called by AfxAssertValidObject, then by CWnd::CreateDlgIndirect,
> CDialog::CreateIndirect, CDialog::Create (according to stack trace). In the
> debugger I cannot debug MFC source (I don't know why). Any ideas?
> Eric

What type of DLL is it? If its a MFC Regular DLL, you will need to
use AFX_MANAGE_STATE macro to make sure resource is located. It is a
MFC Extension DLL, you should set your resources in the chain or some
other mechanism(AfxSetREsourcehandle).

---
Ajay



From: Palo Misik on
Check if you don't have a same resource ID in your dll and in your exe project.
I had a similar problem and solution was in change number of resource (I
used AfxSetResourceHandle for set correct resources).


Palo Misik

"Ajay Kalra" wrote:

> On Feb 6, 9:45 am, "Eric" <bauersa...(a)kull.ch.cuthere.nospam.me.com>
> wrote:
> > An ASSERT is thrown in wincore.cpp/886 when I call CDialog::Create. I'm
> > compiling a DLL. The problem only happens if I set to use MFC in a Shared
> > DLL. I cannot remember what I've changed since this happens. But when I
> > select static link MFC it works perfectly. The ASSERT is in
> > CWnd::AssertValid, "should be in temp. handle map". CWnd::AssertValid is
> > called by AfxAssertValidObject, then by CWnd::CreateDlgIndirect,
> > CDialog::CreateIndirect, CDialog::Create (according to stack trace). In the
> > debugger I cannot debug MFC source (I don't know why). Any ideas?
> > Eric
>
> What type of DLL is it? If its a MFC Regular DLL, you will need to
> use AFX_MANAGE_STATE macro to make sure resource is located. It is a
> MFC Extension DLL, you should set your resources in the chain or some
> other mechanism(AfxSetREsourcehandle).
>
> ---
> Ajay
>
>
>
>
From: Eric on
Hello Ajay
Thanks for your answer. That's the first thing I thought of too. I've added
this command to the constructor, although the constructor won't be called
directly from extern, but I think a double call to AFX_MANAGE_STATE cannot
do anything wrong. But it didn't help. I've changed to static link to MFC as
a workaround.
Eric



From: Eric on
Hello Palo
Thanks for your contribution.
The exe is Microsoft Outlook, so it's out of my control what resources are
used there. If I open Outlook 2003 and check the resource IDs there, then I
cannot see any conflict, because it's practically empty. Probably Outlook
loads the dialogs etc. some other way.
Eric


"Palo Misik" <PaloMisik(a)discussions.microsoft.com> wrote in message
news:0A7D9833-1790-40DA-A64C-615E55105E8E(a)microsoft.com...
> Check if you don't have a same resource ID in your dll and in your exe
> project.
> I had a similar problem and solution was in change number of resource (I
> used AfxSetResourceHandle for set correct resources).