Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

getting runtime error "this method is not implemented in any class"

751 views
Skip to first unread message

drewex

unread,
Mar 7, 2003, 5:53:43 AM3/7/03
to
Hi I'm trying to disable a pnp device ust like when you disable it from
device manager.
I'm using visual basic
I've got the object to the device.
I'm trying to use setpowerstate method but I get a run time error that "this
method is not implemented in any class" .
But the wmi object browser shows that there is this method,
and when I look the watch for the object there was the method too.
Can anyone help. Thank you for the help.


Daniel Pravat [MSFT]

unread,
Mar 7, 2003, 12:19:12 PM3/7/03
to
You should post a code snippet pertinent to the failure.

--
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"drewex" <dre...@hotmail.com> wrote in message
news:#4aDifJ5...@TK2MSFTNGP11.phx.gbl...

drewex

unread,
Mar 7, 2003, 5:20:10 PM3/7/03
to
ok heres the code
first it get the object then runs the query. That part work.
geting the first item works too. It adds the description but the
setpowerstate doesn't work.
I've tried some other thing like terminating (with "terminate" method) a
process and it worked perfectly. So here it is.... thanks for the help.

Dim Process As Object
Set Process = GetObject("winmgmts://ERSIN01").ExecQuery("SELECT * FROM
Win32_PnPEntity where caption=""Hauppauge WinTV 878/9 WDM Video Driver""")
For Each ddd In Process
List1.AddItem ddd.Description
ddd.setpowerstate (6)
Next
"Daniel Pravat [MSFT]" <dpr...@online.microsoft.com> wrote in message
news:#Zhzx2M5...@TK2MSFTNGP09.phx.gbl...

[MS] Scott McNairy

unread,
Mar 7, 2003, 6:33:03 PM3/7/03
to
This method (setPowerState) isn't implemented it is only defined in the
schema.

So you can see it in the object browser but that doesn't gaurantee that it
will work. This particular method was inherited from the cim class
cim_logicalDevice, which is Win32_PnPEntity's superclass.

--
[MS] Scott McNairy
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.


Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"drewex" <dre...@hotmail.com> wrote in message

news:eOmyIfP5...@TK2MSFTNGP12.phx.gbl...

drewex

unread,
Mar 8, 2003, 7:29:01 AM3/8/03
to
What am I going to then... I have to disable the device somehow ... Can
anyone help me to disable it.

"[MS] Scott McNairy" <sco...@online.microsoft.com> wrote in message
news:3e692c3c$1...@news.microsoft.com...

drewex

unread,
Mar 8, 2003, 10:05:15 AM3/8/03
to
new thing I've founded that in the wmi object browser the
win32_systemdriver.name="hcwbt8xx"" has the methods too. But I'can't disable
or enable from here neither. I't says that

"5 - The requested control code cannot be sent to the service because the
state of the service (Win32_BaseService:State) is equal to 0, 1, or 2"

And I don't know what that means. Is there a nother way to this. Thank for
reading and replying..

"drewex" <dre...@hotmail.com> wrote in message

news:OktPh5W5...@TK2MSFTNGP09.phx.gbl...

[MS] Scott McNairy

unread,
Mar 10, 2003, 1:25:06 PM3/10/03
to
The best thing to do is look at the documentation for this case.
Specifically look for Win32_Service in MSDN and depending on the method you
are executing, you should find what this return code means.

--
[MS] Scott McNairy
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"drewex" <dre...@hotmail.com> wrote in message

news:Os0k0QY5...@TK2MSFTNGP12.phx.gbl...

[MS] Scott McNairy

unread,
Mar 10, 2003, 1:27:32 PM3/10/03
to
The class you should look for is Win32_SystemDriver, not win32_service.

--
[MS] Scott McNairy
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"[MS] Scott McNairy" <sco...@online.microsoft.com> wrote in message

news:3e6c...@news.microsoft.com...

drewex

unread,
Mar 10, 2003, 4:43:10 PM3/10/03
to
Hi I've founded a way and msdn says this is the way to disable a device. BUT
I've tried it and looked at the output. It should return 0 but it return 4
for standing
"4 - The requested control code is not valid, or it is unacceptable to the
service."

I can disable it from the device manager so It should give me this answer.

when I've tried to enable it (where I disabled it from device manager). This
time it gives me

14 - The service has been disabled from the system.

So I'm going little bit mad. I've tried lots of thing can't get a solution.
I've searched msdn for the outputs But nothing.. I really Need HELP on
this. Thank you for reading

and a special thanks to the responders. Thank you for the advises

Private Sub Form_Load()


Dim Process As Object
Set Process = GetObject("winmgmts://ERSIN01").ExecQuery("SELECT * FROM

Win32_SystemDriver WHERE Name=""HCWBT8XX""") 'Win32_PnPEntity where


caption=""Hauppauge WinTV 878/9 WDM Video Driver""")
For Each ddd In Process
List1.AddItem ddd.Description

List1.AddItem ddd.stopservice
List1.AddItem ddd.Interrogateservice
Next

End Sub

"[MS] Scott McNairy" <sco...@online.microsoft.com> wrote in message

news:3e6cd913$1...@news.microsoft.com...

[MS] Scott McNairy

unread,
Mar 10, 2003, 5:04:58 PM3/10/03
to
There is currently no way to disable a device using WMI in the box
providers. No workaround that I am aware of is available either.

--
[MS] Scott McNairy
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm


"drewex" <dre...@hotmail.com> wrote in message

news:upc5T405...@TK2MSFTNGP09.phx.gbl...

drewex

unread,
Mar 11, 2003, 10:05:20 AM3/11/03
to
But I can do this from device manager. There should be a way for this. Isn't
there another way. I'm stuck at this point. And this is really important.

CAn I do this from api programming I'm in to every ways to solve this.
Please someone show me the way I'll do anything for it..


"[MS] Scott McNairy" <sco...@online.microsoft.com> wrote in message

news:3e6d0c0a$1...@news.microsoft.com...

[MS] Scott McNairy

unread,
Mar 11, 2003, 2:48:48 PM3/11/03
to
Not that I can think of... Sorry. Maybe someone else knows how to disable a
device.

--
[MS] Scott McNairy
WMI Test Engineer
This posting is provided "As Is" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm

"drewex" <dre...@hotmail.com> wrote in message

news:eF4gJ$95CHA...@TK2MSFTNGP10.phx.gbl...

Agendum

unread,
Mar 21, 2003, 10:07:49 PM3/21/03
to

Device Manager uses Setup APIs for this. See SetupDi* and CM_* functions on
MSDN.


"[MS] Scott McNairy" <sco...@online.microsoft.com> wrote in message

news:3e6e3da0$1...@news.microsoft.com...

0 new messages