在运行时调用win32 API [英] Calling a win32 API at runtime

查看:95
本文介绍了在运行时调用win32 API的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的应用程序的要求是我需要调用xml文件中提到的win32 API。

The requirement of my application is such that I need to call the win32 API which is mentioned in the xml file.

XMl文件包含Win32 API的名称,输入参数值。 XML中的参数按照MSDN顺序排列。

The XMl file contains the name of the Win32 API, the input parameters values. And parameters in XML are in sequence as per MSDN.

例如CreateFile APII的API名称= CreateFile,Filename = C:\ _sample \\\
otepad.txt等。

like for example CreateFile APII have the API name = CreateFile, Filename = C:\sample\notepad.txt, etc.

现在我需要使用XML文件中存在的参数值来调用此CreateFile API。

Now I need to call this CreateFile API with the argument values present in the XML file.

我需要编写通用代码,以便应用程序应该能够执行XML文件中存在的任何Win32 API。

I need to write the generic code such that the application should be able to execute any Win32 API present in the XML file.

请建议任何教程或指导我。

Please suggest any tutorial or guide me.

我提到http://stackoverflow.com/questions/8696653/dynamically-load-a-function-from-a-dll

i refered http://stackoverflow.com/questions/8696653/dynamically-load-a-function-from-a-dll

但是你还需要根据参数声明函数指针,但是这种方法不会是通用的,而且我也无法添加所有Win32 API的细节。

but there also you need to declare the function pointer as per the perameters, but then this approach wont be generic, and also I cannot add the details for all the Win32 APIs.

请帮助。

先谢谢。

谢谢&问候,Mayank Agarwal

Thanks & Regards, Mayank Agarwal

推荐答案

您是否打算调用任何Win32 API函数,或者您的应用程序应该有一个已定义的函数子集是否可以处理?

$

Is it your intent to call any Win32 API function or is there a defined subset of functions that your application should be able to handle?

在互联网上搜索"脚本化Win32 API函数"。 你会发现这不是一项微不足道的任务。

Do an internet search for "scripting Win32 API functions".  You will find that this will not be a trivial task.


这篇关于在运行时调用win32 API的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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