Show console since dl using mingw

The dll will be:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// dllmain.cpp : Defines the entry point for the DLL application.
    #include "stdafx.h"
    
    extern "C" __declspec (dllexport) void __cdecl HelloWorld()
    {
    	//Show a message box with the text "Hello World"
    	MessageBox(NULL, TEXT("Hello World"), TEXT("In a DLL"), MB_OK);
    }
    
    
    BOOL APIENTRY DllMain( HMODULE hModule,
                           DWORD  ul_reason_for_call,
                           LPVOID lpReserved
    					 )
    {
    	//Different behaviors depending on the reason why DllMain is called
    	switch (ul_reason_for_call) {
    		case DLL_PROCESS_ATTACH:
    			HelloWorld();
    			break;
    		case DLL_PROCESS_DETACH:
    			HelloWorld();
    			break;
    		case DLL_THREAD_ATTACH:
    			break;
    		case DLL_THREAD_DETACH:
    			break;
    	}
    
    	return TRUE;
    }

The compiler will be `MINGW`. I'm having difficulty because i want that the `DLL` will be able to show the console. Thanks..
Last edited on
DLL's don't interact with the console. You have to link to them.
Last edited on
How i can link the console to my dll??????
Topic archived. No new replies allowed.