01_DllZZ.cpp

1、

// DllZZ.cpp : Defines the entry point for the DLL application.
//

#include "stdafx.h"
#include <windows.h>

BOOL APIENTRY DllMain( HANDLE hModule, 
                       DWORD  ul_reason_for_call, 
                       LPVOID lpReserved)
{
    // Perform actions based on the reason for calling.
    switch( ul_reason_for_call ) 
    { 
        case DLL_PROCESS_ATTACH:
         // Initialize once for each new process.
         // Return FALSE to fail DLL load.
            ::MessageBox(0, "DLL_PROCESS_ATTACH", "DLL_PROCESS_ATTACH", 0);
            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.
            ::MessageBox(0, "DLL_PROCESS_DETACH", "DLL_PROCESS_DETACH", 0);
            break;
    }
    return TRUE;  // Successful DLL_PROCESS_ATTACH.
}

__declspec(dllexport) void __stdcall AA()
{
    ::MessageBox(0, "AA", "AA", 0);
}

 

2、

 

posted @ 2016-04-26 20:37  CppSkill  阅读(165)  评论(0编辑  收藏  举报