Hey,
On Thu, Jan 7, 2010 at 7:13 PM, F8R <[email protected]> wrote:
> [DllImport("License.dll")]
> public static extern void CheckLicense(string code);
>
> Can someone give me example code for it?
> And do I have to set PInvokeInfo property for that method to ?
Pseudo code:
var module = assembly.MainModule;
var module_ref = new ModuleReference ("License.dll");
module.ModuleReferences.Add (module_ref);
var method = new MethodDefinition ("CheckLicense",
MethodAttributes.Public | MethodAttributes.Static) { IsPInvokeImpl =
true };
method.PInvokeInfo = new PInvokeInfo (method) { EntryPoint =
"CheckLicense", Module = module_ref };
type.Methods.Add (method);
--
Jb Evain <[email protected]>
--
--
mono-cecil