Atl in WinForms app

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Maxim

    #1

    Atl in WinForms app

    Hello everybody,

    I have problems with using atl classes inside a WinForms application. I've
    already posted a message here. I've tried different approaches with no
    success.
    Maybe somebody could show me a simple WinForms project that uses for example
    CComBstr class.

    PS. I'm using C++/CLI and VS2005.

    Thanks in avance.


  • Jochen Kalmbach [MVP]

    #2
    Re: Atl in WinForms app

    Hi Maxim!
    I have problems with using atl classes inside a WinForms application. I've
    already posted a message here. I've tried different approaches with no
    success.
    Maybe somebody could show me a simple WinForms project that uses for example
    CComBstr class.
    - Create a new Windows-Forms Applikation
    - Open Project-Settings
    - Change "Configurat ion-Properties|Gene ral":
    - "Use of ATL" to "Dynamic Link to ATL"
    - "Common language runtime support" to "Common Language Runtime Support
    (/clr)"

    --
    Greetings
    Jochen

    My blog about Win32 and .NET

    Comment

    • Jochen Kalmbach [MVP]

      #3
      Re: Atl in WinForms app

      Hi Maxim!
      I have problems with using atl classes inside a WinForms application. I've
      already posted a message here. I've tried different approaches with no
      success.
      Maybe somebody could show me a simple WinForms project that uses for example
      CComBstr class.
      Sorry... I forgot one:

      - and place
      #include <atlbase.h>
      - right after "#pragma once" in "stdafx.h"

      --
      Greetings
      Jochen

      My blog about Win32 and .NET

      Comment

      • Maxim

        #4
        Re: Atl in WinForms app

        Hi Jochen,

        Thanks for reply.

        Well I've done that like a million times before. But I'm getting the debug
        assertion whenever I include atlbase.h in my project. I've tried different
        workarounds but nothing worked for me. So I asked for a simple project here
        because I think that there is probably something wrong with my configuration
        or something.
        Have you tried to run this simple project yourself? If it works for you,
        then could you post the project code here please.

        And thanks again.
        Maxim

        "Jochen Kalmbach [MVP]" <nospam-Jochen.Kalmbach @holzma.dewrote in message
        news:eDe02g8mHH A.1216@TK2MSFTN GP03.phx.gbl...
        Hi Maxim!
        >
        >I have problems with using atl classes inside a WinForms application.
        >I've already posted a message here. I've tried different approaches with
        >no success.
        >Maybe somebody could show me a simple WinForms project that uses for
        >example CComBstr class.
        >
        Sorry... I forgot one:
        >
        - and place
        #include <atlbase.h>
        - right after "#pragma once" in "stdafx.h"
        >
        --
        Greetings
        Jochen
        >
        My blog about Win32 and .NET
        http://blog.kalmbachnet.de/

        Comment

        Working...