Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am using C++(MFC) dll in my C# application. My application getting closed when i tried to access fstream() function (from DLL )with different specifier. sample code is given here:
1) fscanf(fp,"%1c",&colon); :this works fine
2) fscanf(fp,"%2x",&byte_count); : My application got closed.

But it will work fine if i execute my C++ application individually, and not able to call it if i use through dll in my c# application. It is not throwing any error or exception(since the method is in DLL).But simply getting closed. Can anybody give the solution?? or any idea to figure out the log file generated to find out the errors??

thanks,

Vinod
Posted
Comments
Richard MacCutchan 8-Dec-14 8:51am    
As Griff says: why? There are plenty of native C# methods to read input streams.

Probably, it's down to your DLLImport statements and the actual parameters you pass in from the C# code - which we can't see, but you should look at.

But why would you want to call fscanf from C#?
 
Share this answer
 
actually i need to convert C++ code for one ST board into C#. instead i just making use of the C++ dll. The C++ code is available in the following site. Solution name 'DfuSe'. http://www.st.com/web/en/catalog/tools/FM147/CL1794/SC961/SS1533/PF257916[^]
 
Share this answer
 
v2
Comments
Richard MacCutchan 8-Dec-14 11:42am    
This is not a Solution. If you have extra information then please edit your question and add it there. Posting it here means people will ignore the question, thinking it has been solved.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900