billskeen68
asked on
Use fopen() from c#
I have a 'c' dll that requires a FILE * fileHandle to be passed into a function. I want to use c# to do the fopen() or whatever from C#, then trough DLLIMPORT, call the 'c' function with the fileHandle created. Same applies for fclose().
Thanks,
Bill
Thanks,
Bill
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
The fopen()/fclose() work okay from C#, but the passinig IntPtr down doesn't work. Don't I need to create some type of structure for FILE?
Bill
Bill
Please show your code and describe what error you have.
iam not able to open a file using fopen in windows DDK , inspite of setting the MSVCRT=1 the sources file, do i have to set any other variable for the file operations to work?
Thank you
FILE *fp;
fp= fopen("ubl_davinci_nor.BIN ", "r");
sources
Thank you
FILE *fp;
fp= fopen("ubl_davinci_nor.BIN
sources
Think about using managed C++, which has better interoperability features than C# and allows to call C++ functions and classes directly.