trouble making drive insertion detection c# -


i trying add drive detection program having bit of difficulty. when try use code specified on code project. using windows project , having trouble getting working.

    namespace project     {         public partial class mainwindow : window         {          other code           private const int wm_devicechange = 0x219;          protected override void wndproc(ref message m)         {              switch (m.msg)             {                 case wm_devicechange:                     // wparam value identifies occurring.                     // n = (int)m.wparam;                     break;             }             base.wndproc(m);         }         }           } 

for wndproc need have using system.windows.forms; have using system.windows.controls; gives me following error

is ambiguous reference between 'system.windows.controls.menuitem' , 'system.windows.forms.menuitem'

for base.wndproc(m); error:'system.windows.window' not contain definition 'wndproc'

and protected override void wndproc(ref message m) gives error: 'project.mainwindow.wndproc(ref system.windows.forms.message)': no suitable method found override

i doing wrong not sure what

i'm not seeing actual menuitem, wherever is, you're referencing both system.windows.controls , system.windows.forms, , you'll have clarify. somewhere it's going like:

private menuitem _mitem; 

and that'll have change to:

private system.windows.forms.menuitem _mitem; 

(or system.windows.control; try 1 , see if breaks!)

the second error accurate: change mainwindow inheriting window inheriting system.windows.forms.form , see if fixes it. alternately, remove override. it's correct system.windows.window has no method wndproc, form does...


Comments

Popular posts from this blog

plot - Remove Objects from Legend When You Have Also Used Fit, Matlab -

java - Why does my date parsing return a weird date? -

Need help in packaging app using TideSDK on Windows -