Warning: "No local application has been provided. You can define it in the Run menu, Parameters "Dynamic DLL Creation problem in C ++ in DEV ++

1

I'm trying to create a DLL with the code that the teacher passed, but it does not compile properly. The warning is appearing:

  

"No local application has been provided, you can set it in the Run menu, Parameters"

  • What would these Parâmetros be?
  • In this case that I want to show HelloWord on the screen, would I have to create a .dll file in a text editor and put HelloWord inside it? And then compile it?
  • The main DLL follows:

     #include <windows.h>
     #include <iostream>
    
     using namespace std;
     typedef void (*MyFunc)(void);
    
     /* run this program using the console pauser or add 
      your own getch, system("pause") or input loop */
    
     int main(int argc, char** argv) {
    
         HINSTANCE hinst;
         MyFunc Hello;
         hinst = LoadLibrary("MyDLL.dll");
         if (!hinst)
         {
             MessageBox(0,"DLL File not found!", "Error", MB_ICONERROR);
             exit(0);
         }
    
         Hello = (MyFunc)GetProcAddress(hinst,"HelloWorld");
         Hello();
         FreeLibrary(hinst);
         exit(0);
    
         return 0;
    }
    

    The following is the DLL of the function:

    #ifndef _DLL_H
    #define _DLL_H
    
    #if BUILDING_DLL
    #define DLLIMPORT _declspec(dllexport)
    #else
    #define DLLIMPORT _declspec(dllimport)
    #endif
    
    DLLIMPORT void HelloWord();
    
    #endif
    
        
    asked by anonymous 04.11.2018 / 15:01

    1 answer

    1

    It looks like you're trying to run the DLL project.

    You need to create two projects:

    • a DLL project where you will put the code for your HelloWorld () function in the dllmain.cpp file
    • and a Console Application project where you will put the main () function code in the main.cpp file.

    Create the projects in the same directory.

        
    06.11.2018 / 14:29