I have a question about invoke function in C++ dll, please help! [modified]
-
hi, I want to invoke a function from a C++ dll in C#, the function prototype as follows: void F(Matrix &H,double (*ptr)[2]); the prototype of Matrix as follows: typedef struct { double array[3][3]; } Matrix; How to pass the parameter Matrix &H and double (*ptr)[2] to F? Any help will be appreciated!
modified on Thursday, April 3, 2008 5:40 AM
-
hi, I want to invoke a function from a C++ dll in C#, the function prototype as follows: void F(Matrix &H,double (*ptr)[2]); the prototype of Matrix as follows: typedef struct { double array[3][3]; } Matrix; How to pass the parameter Matrix &H and double (*ptr)[2] to F? Any help will be appreciated!
modified on Thursday, April 3, 2008 5:40 AM
you are looking for P/Invoke , you must use dllimport (and many more) look it up on google and msdn , good luck with this you will need it . you must declere the functions as static using dllimport attribute dll function [DllImport("SectionDBEngine.dll", EntryPoint = "getHeadersByIndex")] public static extern int getHeadersByIndex([In, Out] CSectionHeader[] headers, int size); http://msdn2.microsoft.com/en-us/library/aa288468.aspx[^]
f(yf) = yf
-
hi, I want to invoke a function from a C++ dll in C#, the function prototype as follows: void F(Matrix &H,double (*ptr)[2]); the prototype of Matrix as follows: typedef struct { double array[3][3]; } Matrix; How to pass the parameter Matrix &H and double (*ptr)[2] to F? Any help will be appreciated!
modified on Thursday, April 3, 2008 5:40 AM