Click here to Skip to main content
15,884,099 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I got the code below from the bitmapmixer sample (DirectShow.NET) and i tried to reimplement it. The original sample works fine. In my version when I try to compile i get errors.
private void AddHandlers()
    {
        // Add handlers for VMR purpose
        this.Paint += new PaintEventHandler(Form1_Paint); // for WM_PAINT
        this.Resize += new EventHandler(Form1_ResizeMove); // for WM_SIZE
        this.Move += new EventHandler(Form1_ResizeMove); // for WM_MOVE
        SystemEvents.DisplaySettingsChanged += new EventHandler(SystemEvents_DisplaySettingsChanged); // for WM_DISPLAYCHANGE
        handlersAdded = true;
    }

    private void RemoveHandlers()
    {
        // remove handlers when they are no more needed
        handlersAdded = false;
        this.Paint -= new PaintEventHandler(Form1_Paint);
        this.Resize -= new EventHandler(Form1_ResizeMove);
        this.Move -= new EventHandler(Form1_ResizeMove);
        SystemEvents.DisplaySettingsChanged -= new EventHandler(SystemEvents_DisplaySettingsChanged);
    }



ERRORs

Error 1 The name 'Marshal' does not exist in the current context Form1.cs
Error 2 The name 'Marshal' does not exist in the current context Form1.cs
Error 3 The name 'Form1_ResizeMove' does not exist in the current context Form1.cs
Error 4 The name 'Form1_Paint' does not exist in the current context Form1.cs
Error 5 The name 'Form1_ResizeMove' does not exist in the current context Form1.cs
Error 6 The name 'Form1_ResizeMove' does not exist in the current context Form1.cs
Error 7 The name 'SystemEvents_DisplaySettingsChanged' does not exist in the current context Form1.cs
Error 10 The name 'Form1_ResizeMove' does not exist in the current context Form1.cs
Error 11 The name 'SystemEvents_DisplaySettingsChanged' does not exist in the current context Form1.cs

Any help is appreciated.

Thanks.
Posted

1 solution

Your previous question already covered the problem.
All the methods and/or names present in the error messages need to be reachable by the compiler either through definition in your code or by reference to the assembly and namespace.

Cheers
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900