I’m trying to compile a DLL in vc++ and use it in C# for Smart Device.
Is it possible and how?
I’m trying to compile a DLL in vc++ and use it in C# for
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You have to use PInvoke, and you probably need to expose the call from your unmanaged dll as extern “C”. Have a look here. What you have to consider is that generally you can’t use the classes you created in your C++ dll directly, but you need some
extern "C"facade inside the C++ dll that helps you to interoperate. In order to ensure exporting the entry points needed from the dll you should ensure proper export is done: http://msdn.microsoft.com/en-us/library/3y1sfaz2.aspx. As an helpful tool to discover what entry points the dll actually export you can use dumpbin. I never used it on compact framework, but this blog seems talk about it: http://geekswithblogs.net/BruceEitman/archive/2009/02/25/windows-ce-dumpbin.aspx. Basically with dumpbin you can have a drop of the names exposed from the dll to help you in PInvoke declaration.