markus.essmayr wrote: ↑
30 Dec 2019, 16:55
could you please also post the code how the function is defined in the DLL?
It's really important that all parameter types match exactly and also that the correct calling convention is used (I think it was stdcall
I have function in a cfint32.dll which look like this : nInitInstance(HWND hwnd, UINT nMessage );
herewith i have attached screenshot how i define function, please find it
please assist me How should I set the parameters to succesfully call this function from my APP.
One of my client provide this dll to integrate into my application, I tried to call cfint32.dll functions from c#.i had successfully reached target what i want..
I used following pieces of code in C#.
public class Form1 : System.Windows.Forms.Form
public static extern int LoadLibrary(string lpLibFileName);
public static extern int FreeLibrary(int hLibModule);
public static extern int nInitInstance (int WindowHandle, int EventMessage);
public static extern int nWritePacket (string InPacket, int Instance);
public static extern string sReadPacket (int Instance);
public static extern int nReleaseInstance (int Instance);
public const int CustomWindowMessage = 1025;
public int Codefinder;
public int DLLInstance;
/* Call this function */
private void Form1_Load(object sender, System.EventArgs e)
objKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\3M\\HIS\\Interface", false);
dllPath = objKey.GetValue("CfInt32DllPath").ToString();
DLLInstance = LoadLibrary(dllPath);
Codefinder = nInitInstance(this.Handle.ToInt32(), CustomWindowMessage);
You do not have the required permissions to view the files attached to this post.