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. COM
  4. Exposing an external interface

Exposing an external interface

Scheduled Pinned Locked Moved COM
comhelpquestionannouncement
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.
  • R Offline
    R Offline
    RChin
    wrote on last edited by
    #1

    This is really getting up my nose now. How do you, using ATL7 in VS7.1, expose an external COM interface to your COM implementation? If I import the type library (xxx.tlb), it complains of type definition. This is a snippet of what's in my header file. The error code generated is listed below Test.tlb is an external type library. #import "Test.tlb" no_namespace // ITestPlugin [ object, uuid("121574AA-841A-4FE0-871C-19A3C8C3C82F"), dual, pointer_default(unique) ] __interface ITestPlugin : IDispatch { [id(1) HRESULT Process(LONG val, [out,retval] LONG* retval); [id(2) HRESULT RegisterSource(ITestSrv* source); // <<<< Error points here }; // CTestPlugin [ coclass, threading("apartment"), vi_progid("Plug.TestPlugin"), progid("Plug.TestPlugin.1"), version(1.0), uuid("45D39585-BD2D-4F61-B0C7-A992F8CD8EF4"), helpstring("TestPlugin Class") ] .. .. The error code is:

    c:\temp\code\chincb\chinplug\testplugin.h(19) : error MIDL2025 : syntax error : expecting a type specification near "ITestSrv"
    c:\temp\code\chincb\chinplug\testplugin.h(19) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation
    LINK : fatal error LNK1240: failed to compile IDL content

    I'm scratching my hair out!


    I Dream of Absolute Zero

    F 1 Reply Last reply
    0
    • R RChin

      This is really getting up my nose now. How do you, using ATL7 in VS7.1, expose an external COM interface to your COM implementation? If I import the type library (xxx.tlb), it complains of type definition. This is a snippet of what's in my header file. The error code generated is listed below Test.tlb is an external type library. #import "Test.tlb" no_namespace // ITestPlugin [ object, uuid("121574AA-841A-4FE0-871C-19A3C8C3C82F"), dual, pointer_default(unique) ] __interface ITestPlugin : IDispatch { [id(1) HRESULT Process(LONG val, [out,retval] LONG* retval); [id(2) HRESULT RegisterSource(ITestSrv* source); // <<<< Error points here }; // CTestPlugin [ coclass, threading("apartment"), vi_progid("Plug.TestPlugin"), progid("Plug.TestPlugin.1"), version(1.0), uuid("45D39585-BD2D-4F61-B0C7-A992F8CD8EF4"), helpstring("TestPlugin Class") ] .. .. The error code is:

      c:\temp\code\chincb\chinplug\testplugin.h(19) : error MIDL2025 : syntax error : expecting a type specification near "ITestSrv"
      c:\temp\code\chincb\chinplug\testplugin.h(19) : error MIDL2026 : cannot recover from earlier syntax errors; aborting compilation
      LINK : fatal error LNK1240: failed to compile IDL content

      I'm scratching my hair out!


      I Dream of Absolute Zero

      F Offline
      F Offline
      FearlessBurner
      wrote on last edited by
      #2

      Although I do not know what is in the imported test.tlb, the error message means that the interface ITestSrv has not been defined. I would check where ITestSrv exists and is defined, and make sure that your header file can see the definition.

      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