Guidance
指路人
g.yi.org
software / rapidq / Examples / Win32API & DLL / dllevent / DLLevent.c

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
#include <windows.h>
#include <windowsx.h>
#include <commctrl.h>
#include <string.h>
#include <conio.h>


 

HINSTANCE  hInstDLL;
typedef long (*tipoFuncion)(int a);
//tipoFuncion fs[2];
/****************************/
/*   Standard Prototypes    */
/****************************/


/****************************/
/*     User's Prototypes    */
/****************************/


/****************************/
/*     Entrada en la DLL    */
/****************************/
BOOL WINAPI __declspec(dllexport) LibMain(HINSTANCE hDLLInst, DWORD fdwReason, LPVOID lpvReserved)
{
    switch (fdwReason)
    {
        case DLL_PROCESS_ATTACH:
            // The DLL is being loaded for the first time by a given process.
            // Perform per-process initialization here.  If the initialization
            // is successful, return TRUE; if unsuccessful, return FALSE.
			hInstDLL = hDLLInst;


            break;
        case DLL_PROCESS_DETACH:
            // The DLL is being unloaded by a given process.  Do any
            // per-process clean up here, such as undoing what was done in
            // DLL_PROCESS_ATTACH.  The return value is ignored.

//		UnregisterClass("mdidllWndClass",hDLLInst);

            break;
        case DLL_THREAD_ATTACH:
            // A thread is being created in a process that has already loaded
            // this DLL.  Perform any per-thread initialization here.  The
            // return value is ignored.

            break;
        case DLL_THREAD_DETACH:
            // A thread is exiting cleanly in a process that has already
            // loaded this DLL.  Perform any per-thread clean up here.  The
            // return value is ignored.

            break;
    }
    return TRUE;
}


/*void APIENTRY __declspec(dllexport)
aevent(void (*a_minus)(long), void (*a_mayus)(long))
{
    fs[0] =  a_minus;
    fs[1] =  a_mayus;
} */

void  APIENTRY __declspec(dllexport)
Llamar(tipoFuncion f, int a )
{
long b;
//     		 MessageBox(0, "Llamando a funcion", "hemos llamado",
//		         MB_ICONEXCLAMATION | MB_OK);
     b = (*f)(a);
}

/****************************/
/*    Run Time Functions    */
/****************************/
  

                          

掌柜推荐
 
 
¥289.00 ·
 
 
¥1,080.00 ·
 
 
¥1,380.00 ·
 
 
¥638.00 ·
 
 
¥1,290.00 ·
 
 
¥1,420.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2013-06-19 07:51:21