Question : How do I call another dll function from within a C# DLL?

I'm wanting to move my code from a class to a C# / C++ DLL.

In my C# DLL project, I have the below code.    When I attempt to compile, i get two errors: "LowLevelKeyboardProc" not found ...

and

type or namespace 'DllImport'  could not be found. Are you missng a using directive or asembly reference?

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace KBH
{

        public class KeyboardHook
        {
            [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
            private static extern IntPtr SetWindowsHookEx(int idHook, LowLevelKeyboardProc lpfn, IntPtr hMod, uint dwThreadId);

            [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
            private static extern bool UnhookWindowsHookEx(LowLevelKeyboardProc hook);


            [DllImport("kernel32.dll", CharSet = CharSet.Auto, SetLastError = true)]
            private static extern IntPtr GetModuleHandle(string lpModuleName);

            [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
            private static extern IntPtr CallNextHookEx(IntPtr hhk, int nCode, IntPtr wParam, IntPtr lParam);

           


            public static IntPtr SetHook(LowLevelKeyboardProc proc)
            {
                using (Process curProcess = Process.GetCurrentProcess())

                using (ProcessModule curModule = curProcess.MainModule)
                {
                    return SetWindowsHookEx(WH_KEYBOARD_LL, proc,
                        GetModuleHandle(curModule.ModuleName), 0);
                }



            } // end Set Hook

            public static void DeleteHook(LowLevelKeyboard proc)
            {
                UnhookWindowsHookEx(_proc);
            }

        }
   


    /***********************************************************************
     * SetHook
     * *********************************************************************/


}

Answer : How do I call another dll function from within a C# DLL?

If I understand correctly, I think he already verified that he will be using 192.168.1.1 for his router. His question was concerning configuring the AP once the router was in place. As I said, access the access point's configuration, enter your wireless connection information, give it an ip (192.168.1.2), once it's connected users will see nothing different when trying to connect to your wireless network. The AP has just extended the signal, no extra setup necessary. Hope this helps.
Random Solutions  
 
programming4us programming4us