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. Access Denied in VC++ COM

Access Denied in VC++ COM

Scheduled Pinned Locked Moved COM
helpc++comsysadminperformance
21 Posts 3 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 Roger Stoltz

    RevathiRamakumar wrote:

    HRESULT Of ::CoCreateInstance() returned 0 and the interface pointer points a valid address..But, again Access Denied while calling the server method...

    That's odd... If you're able to successfully create the server and get a valid pointer to the interface, I cannot see how you could get an access violation making the call. It feels like there's some kind of mismatch between the server, typelib and client. If you have changed from an IDispatch-derived interface to an IUnknown-derived, the virtual table the client tries to use may be out of sync. That's why I suggested that you should unregister all and rebuild from scratch. How is your interface declared in the IDL-file? It should be something like this:

    [
    object,
    uuid( xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx ),
    oleautomation,
    helpstring( "IGetStatus interface" ),
    ]
    interface IGetStatus : IUnknown
    {
    HRESULT GetBeat( [out] BSTR* pbstrTheBeat );
    HRESULT GetCPU( [out] unsigned long* pulCpuLoad );
    HRESULT GetMemory( [out] unsigned long* pulMemory );
    };

    Also make sure in the client that the IGetStatus interface, declared in the complier generated header file, only contains QueryInterface(), AddRef(), Release(), GetBeat(), GetCPU() and GetMemory(). Try using one of the other interface functions since it's more straight forward with integer values and you don't have to worry about string obscurities. When you get that working you can continue with IGetStatus::GetBeat().

    "It's supposed to be hard, otherwise anybody could do it!" - selfquote
    "High speed never compensates for wrong direction!" - unknown

    R Offline
    R Offline
    RevathiRamakumar
    wrote on last edited by
    #21

    Hi Mr.Roger I got it working after changing the Authentication level to NONE in dcomcnfg...Initially it was dEFAULT after changing it to NONE its working fine.. Thank u... :)

    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