关于dll导出.. [英] About dll exporting ..

查看:76
本文介绍了关于dll导出..的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从dll中获取值.
我制作了一个应用程序(在WIN32 C ++中),并用它制作了Dll.
我喜欢这样的"int"值或类似的东西,
从dll到应用程序.

感谢您的帮助:)

从解决方案复制:
OK,所以我有Application,DLL和Loader.
当我加载装载程序时,它会加载弹球游戏.
借助dll,它可以制作控制台并在弹球游戏中写入当前得分的得分.
(Codecave)

我的问题是:
如何从dll中获取当前分数并将其发送到应用程序?

我制作了一个简单的"int"变量,其值为60.
并将其发送到应用程序.
但是我需要知道如何一直更新它吗?
因为它卡在了我输入的第一个值中.
我希望使用DLL的得分值实时更新.

I''m trying to get a value from my dll.
I made a application (In WIN32 C++) and Dll with it.
And I like to take some ''int'' value or soneting like that,
from the dll to the application.

Thans for help :)

Copied from solution:
OK, So I have Application, DLL and Loader.
When I''m load the Loader, Its load the Pinball game.
And with the dll, its makes console and write the score of the current score in the pinball game.
(Codecave)

My Question is:
How I can get the current score from the dll, and send it to the application ?

I made a simple ''int'' varible, with the value 60.
and send it to the application.
But I need to know how I can update it all the time ?
Because its stuck in the first value I typed.
I want its update in real time with the dll''s score value.

推荐答案

__declspec( dllexport) int score;



上面的代码可以导出dll的变量.



above of code can export a varible of dll.

HMODULE hDLL = LoadLibrary("test.dll");
int score = (int)GetProcAddress(hDLL,"score");


这篇关于关于dll导出..的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆