Loading ...
Sorry, an error occurred while loading the content.
 

Re: Adding WTL to an existing ATL project

Expand Messages
  • bcorfman
    Hi, I m not sure that anyone has fully scoped out this problem yet. Nenad has said that the ATL 7/WTL 7 interaction issues aren t straightforward in an earlier
    Message 1 of 4 , Aug 1, 2002
      Hi,

      I'm not sure that anyone has fully scoped out this problem yet. Nenad
      has said that the ATL 7/WTL 7 interaction issues aren't
      straightforward in an earlier post. I'm still trying to determine how
      much damage is done when switching from WTL 3.1/ATL 3.0 to WTL 7.0/ATL
      7.0. Like you, I started the switch with the suggested
      recommendations, but my code broke badly. There are a number of issues
      to investigate, but I'm tied up with other development at the moment.

      Bottom line is if anyone's done more investigation on conversion
      issues, I'd be interested to hear them too.

      Brandon


      --- In wtl@y..., "cardsharque2000" <cgouldie@p...> wrote:
      > I read another post from a while back on the same problem.
      >
      > The recommendation was to use the following #define:
      >
      > #define _Module (*_pModule)
      >
      > This works fine as long as you don't have a COM object in your
      > application. However, if you do, the compiler craps out on the
      > following macro:
      >
      > DECLARE_REGISTRY_RESOURCEID(X)
      >
      > where X is the ID of your resource.
      >
      > I copied the macro into my source, and got the com object to compile
      > and register. However, the object crashed in the ATL code because
      > _pAtlModule was undefined.
      >
      > Seems like a dead-end.
      >
      > Is it really impossible to use WTL with an App-Wiz generated ATL
      > project? My code works fine if I hack MFC into the project, but I
      > don't want to do that.
      >
      > Sigh
      >
      > --- In wtl@y..., "cardsharque2000" <cgouldie@p...> wrote:
      > > I have had no luck adding WTL to an existing ATL project (exe
      > server,
      > > Visual C++ 7).
      > >
      > > If I add the following to stdafx.h:
      > >
      > > #include <atlmisc.h>
      > >
      > > I get compiler errors along the lines of "_Module not defined"
      > >
      > > I looked around and the answer seems to be to define _Module in one
      > > of your cpp files. However, if I add the following to stdafx.h
      > >
      > > extern CComModule _Module;
      > >
      > > and I add the following to one of my source files:
      > >
      > > CComModule _Module;
      > >
      > > then I get an Assert during the registration
      > >
      > > Expression: _pAtlModule == NULL
      > >
      > > I've traced into the code, and it looks like _Module is conflicting
      > > with something else.
      > >
      > > Can anyone solve this problem? I have looked everywhere, high and
      > low
      > > for a solution, and noone seems to know.
      > >
      > > If anyone can create an ATL exe project, and add <atlmisc.h> to it,
      > > and tell me how they did it, I would be very, very happy. :)
      > >
      > > Please reply here, or at cgouldie@p...
      > > Thanks,
      > >
      > > Christopher Gouldie
    • sleepygakko
      Just #undef _Module after including the WTL files, and before the DECLARE... macro. ... compile ... one ... conflicting ... it,
      Message 2 of 4 , Aug 5, 2002
        Just #undef _Module after including the WTL files, and before the
        DECLARE... macro.

        --- In wtl@y..., "cardsharque2000" <cgouldie@p...> wrote:
        > I read another post from a while back on the same problem.
        >
        > The recommendation was to use the following #define:
        >
        > #define _Module (*_pModule)
        >
        > This works fine as long as you don't have a COM object in your
        > application. However, if you do, the compiler craps out on the
        > following macro:
        >
        > DECLARE_REGISTRY_RESOURCEID(X)
        >
        > where X is the ID of your resource.
        >
        > I copied the macro into my source, and got the com object to
        compile
        > and register. However, the object crashed in the ATL code because
        > _pAtlModule was undefined.
        >
        > Seems like a dead-end.
        >
        > Is it really impossible to use WTL with an App-Wiz generated ATL
        > project? My code works fine if I hack MFC into the project, but I
        > don't want to do that.
        >
        > Sigh
        >
        > --- In wtl@y..., "cardsharque2000" <cgouldie@p...> wrote:
        > > I have had no luck adding WTL to an existing ATL project (exe
        > server,
        > > Visual C++ 7).
        > >
        > > If I add the following to stdafx.h:
        > >
        > > #include <atlmisc.h>
        > >
        > > I get compiler errors along the lines of "_Module not defined"
        > >
        > > I looked around and the answer seems to be to define _Module in
        one
        > > of your cpp files. However, if I add the following to stdafx.h
        > >
        > > extern CComModule _Module;
        > >
        > > and I add the following to one of my source files:
        > >
        > > CComModule _Module;
        > >
        > > then I get an Assert during the registration
        > >
        > > Expression: _pAtlModule == NULL
        > >
        > > I've traced into the code, and it looks like _Module is
        conflicting
        > > with something else.
        > >
        > > Can anyone solve this problem? I have looked everywhere, high and
        > low
        > > for a solution, and noone seems to know.
        > >
        > > If anyone can create an ATL exe project, and add <atlmisc.h> to
        it,
        > > and tell me how they did it, I would be very, very happy. :)
        > >
        > > Please reply here, or at cgouldie@p...
        > > Thanks,
        > >
        > > Christopher Gouldie
      Your message has been successfully submitted and would be delivered to recipients shortly.