Let a dll call a .exe function by sending a pointer [duplicate]
问题 This question already has answers here : letting a DLL call a exe function with function pointer (2 answers) Closed 6 years ago . This question looks like one I asked before, except that I now know that you can't call the main function from a global object. So this code doesn't work with main. But why does it fail with other functions as well? This is the code. .exe main.cpp #include "dll_class.h" #include <iostream> int my_main(void) { std::cout << "Enter the my_main code.\n"; std::getchar()