创建Windows本机DLL的程序 [英] Program that creates windows native DLL

查看:142
本文介绍了创建Windows本机DLL的程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我来请求帮助。



我有 Win32窗口有一个按钮



如果我点击按钮,程序自动通过Microsoft或其他编译器(例如Ming)创建本机窗口DLL。



DLL将从文件 MyDLL.cpp 格式创建。



这是否正确?



SHELLEXECUTEINFO ShExecInfo;

ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);

ShExecInfo.fMask = NULL;

ShExecInfo.hwnd = hWnd;

ShExecInfo.lpVerb = NULL;

ShExecInfo.lpFile =C:\\Program Files( x86)\\ Microsoft Visual Studio 12.0 \\Common7 \\Tools \\VsDevCmd.bat;

ShExecInfo.lpParameters =cl.exe / D_USRDLL / D_WINDLL C :\\MyDLL.cpp C:\\MyDLL.def / link / DLL /OUT:MyDLL.dll;

ShExecInfo.lpDirectory = NULL;

ShExecInfo.nShow = SW_MAXIMIZE;

ShExecInfo.hInstApp = NULL;



ShellExecuteEx(& ShExecInfo);



谢谢!

Hi, let me to ask for help.

I have a Win32 window that has a button.

If I click on the button the program automatically creates native window DLL via Microsoft or another compiler like for example Ming.

The DLL will be created from a file MyDLL.cpp format.

Is this below correct ?

SHELLEXECUTEINFO ShExecInfo;
ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO);
ShExecInfo.fMask = NULL;
ShExecInfo.hwnd = hWnd;
ShExecInfo.lpVerb = NULL;
ShExecInfo.lpFile = "C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\Common7\\Tools\\VsDevCmd.bat";
ShExecInfo.lpParameters = "cl.exe /D_USRDLL /D_WINDLL C:\\MyDLL.cpp C:\\MyDLL.def /link /DLL /OUT:MyDLL.dll";
ShExecInfo.lpDirectory = NULL;
ShExecInfo.nShow = SW_MAXIMIZE;
ShExecInfo.hInstApp = NULL;

ShellExecuteEx(&ShExecInfo);

Thank you !

推荐答案

你误解了dll的概念。它是一个提供某些功能的二进制文件。为此,你编写的代码进入dll并由dll加载app执行。



在这里阅读一些Microsoft 关于dll的文档



如果你想批量构建一个dll项目,你可以深入了解这个平台微软的工具。
You misunderstood the concept of a dll. It is a binaries which provides some functionality. For that you write code which gets in the dll and is executed by dll loading app.

Read here some Microsoft documentation about dll.

If you want to batch build a dll project you take a dive into the platform tools of Microsoft.


几件事。



1)什么是标准窗口DLL - 如果你的意思是原生DLL文件,然后就是使用命令行编译并将源链接到DLL的情况。



2)为什么要从TXT创建任何东西文件?如果有编译问题会发生什么?



3)最后,它不是那样的工作。

我们不做你的工作。

如果你想让别人写你的代码,你必须支付 - 我建议你去Freelancer.com并在那里问。但要注意:你得到你付出的代价。支付花生,买猴子。
Couple of things.

1) What is a "standard window DLL" - if you mean a native DLL file, then that's just a case of using the command line to compile and link your source to a DLL.

2) Why would anything be created from a TXT file? What happens if there are compilation problems?

3) And finally, it doesn't quite work like that.
We do not do your work for you.
If you want someone to write your code, you have to pay - I suggest you go to Freelancer.com and ask there. But be aware: you get what you pay for. Pay peanuts, get monkeys.


这篇关于创建Windows本机DLL的程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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