Click here to Skip to main content
15,888,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
hello

i try to load a DLL at runtime in my c#.net 2.0 cf app for a wm 6.1 device. See the following code

//full dll path
string dllPath = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) + "\\" + SymbolKeyboardDLL;
  
//load dll
System.Reflection.Assembly asm = System.Reflection.Assembly.LoadFrom(dllPath);
  
//get type
Type keyPadType = asm.GetType("Symbol.Keyboard.KeyPad, Symbol.Keyboard, 1.6.1.7, Culture=neutral, PublicKeyToken=null"
);

//try to create instance (Exception occurs here)
Object pad = Activator.CreateInstance(keyPadType);


here are the exception details:
Symbol.Exceptions.OperationFailureException: RegisterKeyStateNotication failed
at v.h()
at Symbol.Keyboard.KeyPad..ctor()
at System.Reflection.RuntimeConstructorInfo.InternalInvoke()
at System.Reflection.RuntimeConstructorInfo.Invoke()
at System.Reflection.ConstructorInfo.Invoke()
at System.Activator.CreateInstance()
at ButtonCheck.Form1..ctor()
at ButtonCheck.Program.Main()



does anybody why the exception occurs ?

thanks for any help!
Posted

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