Project1
标题:
CallBackFunction...
[打印本页]
作者:
yangff
时间:
2011-7-13 14:03
标题:
CallBackFunction...
// dllmain.cpp : 定义 DLL 应用程序的入口点。
#include "stdafx.h"
BOOL APIENTRY DllMain( HMODULE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
typedef int haha(int a,int b,int c);
int test(haha *acfun) //我继续自重去 = =
{
acfun(50,555,59);
return 1;
}heihe...
复制代码
#你终于发现我在坑爹了么= = 晚了啊嫂年!
require 'dl'
require 'dl/callback'
require 'dl/func'
require 'Win32API'
#以下代码我自重= = |
include DL
avfun=Win32API.new("RubyCBPTest.dll","test","l","l") #= =
handle=set_cdecl_callback(DL::TYPE_LONG,3 ){|a,b,c| print "callback#{[a.to_i,b.to_i,c.to_i]}" ;0} #回掉函数a ,b ,c是CInt...
avfun.call(handle.to_i) #API= =
复制代码
作者:
英顺的马甲
时间:
2011-7-13 14:22
什么来的?
作者:
Losses
时间:
2011-7-13 16:16
haha= =! lz坏掉了
作者:
link006007
时间:
2011-7-13 16:20
cdecl callback 不是1.9.2才有的吗。。。
欢迎光临 Project1 (https://rpg.blue/)
Powered by Discuz! X3.1