Hi,
i made a DLL from a Class Library project in C# and i am trying to use it using DllImport but i keep getting:
Error RegConfig.exe MissingMethodException Can't find an entry point 'IntProg' in a PInvoke DLL 'ClassLibraryWinCe.dll' at RegConfig.Program.Main()
when i try to run the program.
MyWinCeClasses:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Win32;
using System.Runtime.InteropServices;
using System.Collections;
using System.Threading;
using System.Security;
using System.Reflection;
namespace ClassLibraryWinCe
{
public class MyWinCeClasses
{
public static void InitProg(string Location)
{
RegistryKey reg = Registry.LocalMachine.OpenSubKey(@"Init", true);
reg.SetValue("Launch53", Location, RegistryValueKind.String);
reg.SetValue("Depend53", new byte[] { 0x14, 0x00 }, RegistryValueKind.Binary);
reg.Flush();
reg.Close();
Console.WriteLine("registry set!");
}
}
}
RegConfig:
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Win32;
using System.Runtime.InteropServices;
using System.Collections;
using System.Threading;
using System.Security;
using System.Reflection;
using ClassLibraryWinCe;
namespace RegConfig
{
class Program
{
[DllImport("ClassLibraryWinCe.dll")]
public static extern void InitProg(string Location);
static void Main(string[] args)
{
InitProg("\\Storage Card\\OpenIntApp\\OpenIntApp\\bin\\Release\\OpenIntApp.exe");
}
}
}