Hmm... Only problem I can see offhand (and I tested it to be sure just in case) was that you didn't use: extern
In your C function definitions which left the function calls decorated. By adding that everything seemed to work fine using:
[DllImport(@"c:\test.exe", EntryPoint =
If I left the extern "C" off and used the decorated name (via dumpbin) that also worked.
[DllImport(@"C:\test.exe", EntryPoint = "?myText@@YAXPAD@Z")]
So it looks like your problem was more in the decorated names in C++ than anything.
You can read more about it here: