CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008

    CreateInstanceEnum fails with error c0000005

    Hi !

    I am writing a management app for our company. I am using visual studio 2005 and VC++. Its a

    client server architecture. One of the services provided by the server is setting of static IP for

    NIC's. I am using WMI class Win32_NetworkAdapterConfiguration and EnableStatic method. I

    am using IWbemServices::CreateInstanceEnum method to enumerate instances of Adapters with a particular interfaceindex. All the WMI code is inside the function SetAdapterIpAddress

    which i made into a dll and the server links to this dll to provide the service. The first time the

    server executes the function conatining the code it succeeds, but the subsequent calls to this

    function fails...the point of failure is the line containing the function CreateInstanceEnum....the

    return code is c0000005. please help me. thank you.

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Hanover Germany

    Re: CreateInstanceEnum fails with error c0000005

    Well, MSDN clearly tells you that:
    Return Values
    This method returns an HRESULT object that indicates the status of the method call.

    WBEM_E_FAILED ....
    WBEM_S_NO_ERROR ....

    On failure, you can obtain any available information from the COM function GetErrorInfo.
    So what you have to do is to compare the return code with one of these values and then look for the error meaning in MSDN.
    And don't forget GetErrorInfo!
    Victor Nijegorodov

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

On-Demand Webinars (sponsored)

We have made updates to our Privacy Policy to reflect the implementation of the General Data Protection Regulation.