ObjectARX
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Debug & Release ObjectArx versions

4 REPLIES 4
Reply
Message 1 of 5
Anonymous
419 Views, 4 Replies

Debug & Release ObjectArx versions

hi,

When i create project using objectarx wizard (.net) i'v got 2 configurations
debug and release.
But both of them uses Multithread DLL. Why Debug version is not using Debug
Multithread DLL?
vI try tio switch and autopcad complains aboaut his MFC is release and mine
is debug. But if a have workaround in mine stdafx.h like i pasted below why
Autocad still complains???

#if defined( _DEBUG) && !defined(DEBUG_AUTOCAD)
// #pragma message("Building debug PavirsiausModeliavimas.arx to be used
with release AutoCAD")
#define _DEBUG_THIS_ONLY
#undef _DEBUG
#endif
#include // MFC core and standard components
#include // MFC extensions
#include //Common Control
//#include "adslib.h"

// Turn on the _DEBUG symbol if it was defined, before including
// non-MFC header files.
//
#ifdef _DEBUG_THIS_ONLY
#define _DEBUG
#undef _DEBUG_THIS_ONLY
#endif
4 REPLIES 4
Message 2 of 5
Anonymous
in reply to: Anonymous

The reason is because AutoCAD itself uses the multithreaded MFC dll, and you
can't link AutoCAD do a DLL that uses different version of the MFC library.

Jon



"Mindaugas Bliudzius" wrote in message
news:52A4C2D953A97A4421DAF4990CD713D3@in.WebX.maYIadrTaRb...
> hi,
>
> When i create project using objectarx wizard (.net) i'v got 2
configurations
> debug and release.
> But both of them uses Multithread DLL. Why Debug version is not using
Debug
> Multithread DLL?
> vI try tio switch and autopcad complains aboaut his MFC is release and
mine
> is debug. But if a have workaround in mine stdafx.h like i pasted below
why
> Autocad still complains???
>
> #if defined( _DEBUG) && !defined(DEBUG_AUTOCAD)
> // #pragma message("Building debug PavirsiausModeliavimas.arx to be used
> with release AutoCAD")
> #define _DEBUG_THIS_ONLY
> #undef _DEBUG
> #endif
> #include // MFC core and standard components
> #include // MFC extensions
> #include //Common Control
> //#include "adslib.h"
>
> // Turn on the _DEBUG symbol if it was defined, before including
> // non-MFC header files.
> //
> #ifdef _DEBUG_THIS_ONLY
> #define _DEBUG
> #undef _DEBUG_THIS_ONLY
> #endif
>
>
Message 3 of 5
Anonymous
in reply to: Anonymous

So if we use release MFC always (in project settings) why we still need that
workaround(in code)?

"Jon Rizzo" wrote in message
news:09974A1018BDAC078070F33D39949935@in.WebX.maYIadrTaRb...
> The reason is because AutoCAD itself uses the multithreaded MFC dll, and
you
> can't link AutoCAD do a DLL that uses different version of the MFC
library.
>
> Jon
>
>
>
> "Mindaugas Bliudzius" wrote in message
> news:52A4C2D953A97A4421DAF4990CD713D3@in.WebX.maYIadrTaRb...
> > hi,
> >
> > When i create project using objectarx wizard (.net) i'v got 2
> configurations
> > debug and release.
> > But both of them uses Multithread DLL. Why Debug version is not using
> Debug
> > Multithread DLL?
> > vI try tio switch and autopcad complains aboaut his MFC is release and
> mine
> > is debug. But if a have workaround in mine stdafx.h like i pasted below
> why
> > Autocad still complains???
> >
> > #if defined( _DEBUG) && !defined(DEBUG_AUTOCAD)
> > // #pragma message("Building debug PavirsiausModeliavimas.arx to be used
> > with release AutoCAD")
> > #define _DEBUG_THIS_ONLY
> > #undef _DEBUG
> > #endif
> > #include // MFC core and standard components
> > #include // MFC extensions
> > #include //Common Control
> > //#include "adslib.h"
> >
> > // Turn on the _DEBUG symbol if it was defined, before including
> > // non-MFC header files.
> > //
> > #ifdef _DEBUG_THIS_ONLY
> > #define _DEBUG
> > #undef _DEBUG_THIS_ONLY
> > #endif
> >
> >
>
>
Message 4 of 5
Anonymous
in reply to: Anonymous

> So if we use release MFC always (in project settings) why we still need
> that workaround(in code)?

If you don't use the 'workaround', the MFC headers will produce MFC code
that expects to link with the debug library. This code will fail to link
with the release MFC library because of all the missing debug-specific
symbols that are not included in the release library. Actually it won't
fail to link, because the MFC headers use a #pragma comment to force the
debug libraries to be included in the link when they are required -- but
then it won't run because AutoCAD doesn't load the debug MFC runtime. 🙂
--
Owen Wengerd
President, ManuSoft ==> http://www.manusoft.com
VP Americas, CADLock, Inc. ==> http://www.cadlock.com
Message 4 of 5
Anonymous
in reply to: Anonymous

You don't, but if you try to debug your application, you're going to have
problems.


"Mindaugas Bliudzius" wrote in message
news:6542F2A15CAEE4F003D41624185FFB8D@in.WebX.maYIadrTaRb...
> So if we use release MFC always (in project settings) why we still need
that
> workaround(in code)?
>
> "Jon Rizzo" wrote in message
> news:09974A1018BDAC078070F33D39949935@in.WebX.maYIadrTaRb...
> > The reason is because AutoCAD itself uses the multithreaded MFC dll, and
> you
> > can't link AutoCAD do a DLL that uses different version of the MFC
> library.
> >
> > Jon
> >
> >
> >
> > "Mindaugas Bliudzius" wrote in message
> > news:52A4C2D953A97A4421DAF4990CD713D3@in.WebX.maYIadrTaRb...
> > > hi,
> > >
> > > When i create project using objectarx wizard (.net) i'v got 2
> > configurations
> > > debug and release.
> > > But both of them uses Multithread DLL. Why Debug version is not using
> > Debug
> > > Multithread DLL?
> > > vI try tio switch and autopcad complains aboaut his MFC is release and
> > mine
> > > is debug. But if a have workaround in mine stdafx.h like i pasted
below
> > why
> > > Autocad still complains???
> > >
> > > #if defined( _DEBUG) && !defined(DEBUG_AUTOCAD)
> > > // #pragma message("Building debug PavirsiausModeliavimas.arx to be
used
> > > with release AutoCAD")
> > > #define _DEBUG_THIS_ONLY
> > > #undef _DEBUG
> > > #endif
> > > #include // MFC core and standard components
> > > #include // MFC extensions
> > > #include //Common Control
> > > //#include "adslib.h"
> > >
> > > // Turn on the _DEBUG symbol if it was defined, before including
> > > // non-MFC header files.
> > > //
> > > #ifdef _DEBUG_THIS_ONLY
> > > #define _DEBUG
> > > #undef _DEBUG_THIS_ONLY
> > > #endif
> > >
> > >
> >
> >
>
>

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost