Click here to Skip to main content
16,014,816 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: CreateWindow from DLL [corrected] Pin
Joaquín M López Muñoz4-Apr-02 9:58
Joaquín M López Muñoz4-Apr-02 9:58 
GeneralRe: CreateWindow from DLL [corrected] Pin
User 66584-Apr-02 10:02
User 66584-Apr-02 10:02 
GeneralRe: CreateWindow from DLL [corrected] Pin
Joaquín M López Muñoz4-Apr-02 10:07
Joaquín M López Muñoz4-Apr-02 10:07 
GeneralRe: CreateWindow from DLL [corrected] Pin
User 66584-Apr-02 10:12
User 66584-Apr-02 10:12 
GeneralRe: CreateWindow from DLL [corrected] Pin
Joaquín M López Muñoz4-Apr-02 10:18
Joaquín M López Muñoz4-Apr-02 10:18 
GeneralRe: CreateWindow from DLL [corrected] Pin
User 66584-Apr-02 10:22
User 66584-Apr-02 10:22 
GeneralRe: CreateWindow from DLL [corrected] Pin
Joaquín M López Muñoz4-Apr-02 10:25
Joaquín M López Muñoz4-Apr-02 10:25 
GeneralRe: CreateWindow from DLL Pin
Jeremy Falcon4-Apr-02 9:39
professionalJeremy Falcon4-Apr-02 9:39 
You need a DLLMain (entry point) function for the DLL. Here's an example pulled from MSDN...

BOOL WINAPI DllMain(
    HINSTANCE hinstDLL,  // handle to DLL module
    DWORD fdwReason,     // reason for calling function
    LPVOID lpReserved )  // reserved
{
    // Perform actions based on the reason for calling.
    switch( fdwReason ) 
    { 
        case DLL_PROCESS_ATTACH:
         // Initialize once for each new process.
         // Return FALSE to fail DLL load.
            break;

        case DLL_THREAD_ATTACH:
         // Do thread-specific initialization.
            break;

        case DLL_THREAD_DETACH:
         // Do thread-specific cleanup.
            break;

        case DLL_PROCESS_DETACH:
         // Perform any necessary cleanup.
            break;
    }
    return TRUE;  // Successful DLL_PROCESS_ATTACH.
}


Take the instance param from that function and pass it to your CreateLogWindow() function. Use that instanace in the window's class. This is the done the same way you would use WinMain in an executable.

Also, don't forget to specify the entry point to the linker when compiling the DLL -- this has to be done.

Jeremy L. Falcon
"The One Who Said, 'The One Who Said...'"
<nobr>
Homepage : Feature Article : Sonork = 100.16311

GeneralRe: CreateWindow from DLL Pin
User 66584-Apr-02 9:46
User 66584-Apr-02 9:46 
GeneralRe: CreateWindow from DLL Pin
Jeremy Falcon4-Apr-02 10:12
professionalJeremy Falcon4-Apr-02 10:12 
GeneralRe: CreateWindow from DLL Pin
Tim Smith4-Apr-02 10:19
Tim Smith4-Apr-02 10:19 
GeneralRe: CreateWindow from DLL Pin
User 66584-Apr-02 10:16
User 66584-Apr-02 10:16 
GeneralRe: CreateWindow from DLL Pin
Tomasz Sowinski4-Apr-02 10:21
Tomasz Sowinski4-Apr-02 10:21 
GeneralRe: CreateWindow from DLL Pin
User 66584-Apr-02 10:26
User 66584-Apr-02 10:26 
GeneralRe: CreateWindow from DLL Pin
Joaquín M López Muñoz4-Apr-02 10:23
Joaquín M López Muñoz4-Apr-02 10:23 
GeneralRe: CreateWindow from DLL Pin
Jeremy Falcon4-Apr-02 10:23
professionalJeremy Falcon4-Apr-02 10:23 
GeneralRe: CreateWindow from DLL Pin
Tim Smith4-Apr-02 11:53
Tim Smith4-Apr-02 11:53 
GeneralCImageList + BitBlt Pin
4-Apr-02 8:15
suss4-Apr-02 8:15 
GeneralRe: CImageList + BitBlt Pin
Shog94-Apr-02 9:15
sitebuilderShog94-Apr-02 9:15 
GeneralRe: CImageList + BitBlt Pin
4-Apr-02 9:39
suss4-Apr-02 9:39 
GeneralCPrintDialog Pin
Rick Crone4-Apr-02 8:14
Rick Crone4-Apr-02 8:14 
GeneralRe: CPrintDialog Pin
Shog94-Apr-02 9:42
sitebuilderShog94-Apr-02 9:42 
GeneralRe: CPrintDialog Pin
Rick Crone4-Apr-02 11:28
Rick Crone4-Apr-02 11:28 
GeneralRe: CPrintDialog Pin
Shog94-Apr-02 12:26
sitebuilderShog94-Apr-02 12:26 
GeneralRe: CPrintDialog Pin
Rick Crone9-Apr-02 4:13
Rick Crone9-Apr-02 4:13 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.