Re: Problems porting application from VS6 to VS.NET

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Carl Daniel [VC++ MVP] (cpdaniel_remove_this_and_nospam_at_mvps.org.nospam)
Date: 07/27/04


Date: Tue, 27 Jul 2004 08:29:08 -0700


Øystein Skotheim wrote:
> Hello. I am experiencing problems with my application when I try to
> compile it with Visual C++ .NET.
>
> It consists of a main program which loads an MFC extension DLL with
> its own dialog box and some ActiveX controls.
>
> The program runs without errors when compiled with VC++ 6.0.
>
> There appeared to be no problems in converting the project and
> compiling it on VC++ .NET. However, the application immideately
> terminates with the following message:
>
> Debug Assertion Failed!
> File: occmgr.cpp
> Line: 410
>
> I can see from the call stack that it is the following two lines of
> code inside the extension DLL that trigger the error:
>
> g_pActiveMilCamera = new CActiveMilCamera();
> g_pActiveMilCamera->Create(IDD_ACTIVEMIL);
>
> CActiveMilCamera is a CDialog based class with some ActiveX controls
> from Matrox Imaging Library (MIL Lite 7.5). It is the "Create" call
> (which is inherited from CDialog) which causes the error.
>
> The same error appears if either the extension DLL or the main
> program is compiled with VC++ .NET. However, it does not appear if
> both of the programs are compiled with VC++ 6.0.
>
> Does anyone have a clue what might cause the problem?

Questions:

Are you using VC7.1 (VS.NET 2003) or VC7 (VS.NET 2002)?

Are you mixing a VC6 DLL with a VC7.1 EXE? If so, don't - unless the DLL
was specifically designed for this scenario, you'll have problems (binary
incompatibilities in MFC between VC6 and VC7.1).

Are you building everything with /MD? If you're not, then do so, otherwise
you have multiple CRT implementations in memory at once. The same argument
goes for MFC - everything should use the DLL version of MFC if you're using
MFC in the DLL and the EXE.

Have you checked with Matrox to determine if MIL is compatible with VC7.1?

-cd



Relevant Pages

  • Re: CreateDialog in MFC Extension DLL
    ... So oo provide the user with an indication of each processes state I want to create a dialog (used to feedback progress) using a template. ... This, or a variation of it, would then produce two identical dialogs on the screen, each of which would show a differing state of progress. ... This being an MFC newsgroup, and your DLL being an MFC extension DLL, have you considered using MFC? ...
    (microsoft.public.vc.mfc)
  • Re: calls to unmanaged dll to create a socket result in debug assertio
    ... You have selected an extension DLL and then used AFX_MANAGE_STATE, ... An MFC Extension DLL can *only* be used with an MFC application, not a C# application, ... Use a regular DLL. ... One of the functions in the unmanaged dll creates a new CAsyncSocket, ...
    (microsoft.public.vc.mfc)
  • Re: Determine if Regular DLL or Extension DLL
    ... depends) is not a reliable method for determining if it's an extension DLL ... Regular DLLs can have MFC dependencies. ... functions thus leaving inspection of exports an unreliable means of ...
    (microsoft.public.vc.mfc)
  • Re: Linking to an existing MFC DLL
    ... You need to provide full MFC support to your project. ... >I have a VC++ 6.0 project where I need to link an ATL exe server to an MFC ... > Extension DLL that performs some image capture functions. ... I get other compile errors too numerous to list here. ...
    (microsoft.public.vc.atl)
  • Re: Problems porting application from VS6 to VS.NET
    ... > code inside the extension DLL that trigger the error: ... > CActiveMilCamera is a CDialog based class with some ActiveX controls ... > (which is inherited from CDialog) which causes the error. ... incompatibilities in MFC between VC6 and VC7.1). ...
    (microsoft.public.vc.mfc)