Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. ATL / WTL / STL
  4. how to export an enum type in an ATL prject

how to export an enum type in an ATL prject

Scheduled Pinned Locked Moved ATL / WTL / STL
c++helptutorialquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    astupidboy
    wrote on last edited by
    #1

    my code:

    class ATL_NO_VTABLE CSysLog :
    .....
    {
    public:
    [export]
    enum EnumLogLevel
    {
    LogNone = 0,
    LogError = 1,
    LogWarning = 2,
    LogInfo = 3,
    LogDebug = 4,
    LogDebug1 = 5,
    LogDebug2 = 6,
    LogDebug3 = 7,
    LogDebug4,
    };
    ......

    it takes errors likes: c1xx : error C3174: .... LINK : fatal error LNK1250: ... how to correct it?

    J 1 Reply Last reply
    0
    • A astupidboy

      my code:

      class ATL_NO_VTABLE CSysLog :
      .....
      {
      public:
      [export]
      enum EnumLogLevel
      {
      LogNone = 0,
      LogError = 1,
      LogWarning = 2,
      LogInfo = 3,
      LogDebug = 4,
      LogDebug1 = 5,
      LogDebug2 = 6,
      LogDebug3 = 7,
      LogDebug4,
      };
      ......

      it takes errors likes: c1xx : error C3174: .... LINK : fatal error LNK1250: ... how to correct it?

      J Offline
      J Offline
      Jonathan Davies
      wrote on last edited by
      #2

      Declare it in IDL e.g.

      typedef [v1_enum] enum LogLevel // These are the possible levels of log
      {
      None = 1,
      Error = 2,
      Warning = 3
      }LogLevel;

      Use it in an interface parameter if you need to export a method:

      interface IMyErrors : IDispatch {
      HRESULT GetCurrentError(LogLevel udtLevel,...
      ...

      Compile and and export as a type library or .dll or import the IDL into a .h file

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups