November 19th, 2008, 02:30 AM
CreateInstanceEnum fails with error c0000005
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.
November 19th, 2008, 05:05 AM
Re: CreateInstanceEnum fails with error c0000005
Well, MSDN clearly tells you that:
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.
This method returns an HRESULT object that indicates the status of the method call.
On failure, you can obtain any available information from the COM function GetErrorInfo
And don't forget GetErrorInfo!
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a Codeguru.com survey!