views:

140

answers:

1

Hi,

i have created an MFC DLL for windows mobile..

i have exposed only a function in MFC DLL... if i try to load DLL in c#,in debug mode it is telling Remote connection lost message box appears and app quits

i have kept the DLL at .exe level only.. how to load ?

Steps i have taken to make project.

1)create smart device MFC DLL 2)choosen win mo 6 pocket PC SDK 3)Regular DLL with statically linked

then i worte a function in DLL like

extern "C" _declspec(dllexport) void Test(CString tetsstr)

add the method " Test" to .dif file ..

in my c# project calling way

[DllImport("Test.dll")]
public static extern void Test(string teststr);

This is the way i have created

Thanks

+3  A: 

The questions here are

  1. What tool are you using
  2. How are you deploying

The WinMo device likely shipped with MFC 4.0 (mfcce400.dll) in ROM. You can check the \Windows folder to verify that. Apps built with Studio target MFC 8.0 or later. This measn that you must deploy the MFC binaries with your application, and they need to match whether the app is a debug or a release build.

It's also worth noting here that Platform Builder doesn't even have an MFC component in it any more. This is a very strong indicator that Microsoft doesn't want you to be using the abomination known as MFC. Microsoft is not working on, fixing or updating MFC and it's got known bugs in it. I certainly would never recommend to anyone starting a new project that they use MFC.

ctacke
Thanks Catacke..really i am fedup with MFC.. ill look into it.. thanks lot..
Shadow