VC中的ActiveX++没有MFC?
我想知道是否可以在不使用VS2010中提供的MFC ActiveX的情况下创建ActiveX控件?我更喜欢完全从头开始编写代码,而不需要任何预定义或生成的内容。所有关于ActiveX的指南都是基于使用MFC,并且所有生成的代码都非常混乱,难以掌握和完全理解。
我也不太习惯 MFC 语法,我正在寻找类似于针对 win32 api 的标准 c++ 的东西。据我了解,ActiveX 组件可以用除 MFC 之外的其他语言开发,例如 C。我想使用标准 C/C++,但我找不到任何关于如何从头开始制作非常简单的 ActiveX 的资源。
希望我说得足够清楚。
谢谢。
I'm wondering if it is possible to create an ActiveX control without using the MFC ActiveX that is provided in VS2010? I prefer to do the code entirely from scratch without any predefined or generated content. All the guides on ActiveX are based on using MFC and all the generated code is quite confusing and hard to get a grasp on and fully understand.
I am also not very used to the MFC syntax, I am looking for something akin to standard c++ against the win32 api. As I understand it, ActiveX components can be developed in other languages aswell apart from MFC, such as C. I would like to use standard C/C++ but I can't find any resources on how to do a very minimal ActiveX from scratch.
Hope I made it clear enough.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
另一种选择是使用 ATL。在没有任何框架的情况下从头开始制作 ActiveX 控件绝非易事。
Another alternative is to use ATL. Making an ActiveX control from scratch without any frameworks is far from trivial.
确实,您不需要 MFC(或任何其他框架)来开发 ActiveX 控件,但您有充分的理由找不到有关如何在没有 MFC 的情况下进行开发的示例。 做到这一点非常困难。我的建议是花时间学习一个支持ActiveX的框架并实现ActiveX控件。你会花很长时间才能摆脱它。
此外,如果你没有,你很快就会发现有多少样板代码涉及。在我看来,仅所有样板就值得使用 MFC 和生成所有脚手架代码的向导。
True, you don't need MFC (or any other framework) to develop ActiveX controls but there's a good reason you're not finding examples on how to do it without. It's incredibly tough to do so. My suggestion is to take the time to learn a framework that supports ActiveX and implement the ActiveX control. It will take you much, much longer to go without.
Besides, if you go without you will soon discover how much boiler plate code is involved. All the boilerplate alone, IMO, is worth using MFC and the wizards that generate all the scaffolding code.
ATL 和 WTL,我喜欢这些框架,没有 MFC 的混乱,可执行文件小而且非常灵活。
ATL and WTL, I love those frameworks, no MFC mess, small executables and very flexible.
旧的 VB 6.0 是我见过的最简单、最好的 Active-X 控件环境。我相信现在也是“免费”的。唯一的问题是它们总是有“表单”或 GUI 存在。所以对于不可见的控件来说有点痛苦。无论如何,请检查这些链接:
ActiveX 控件的基本原理:
Visual Basic 编程示例
The old VB 6.0 was the easiest best environment for Active-X controls I have seen. Also now "free" I believe. The only problem being that they always had a "form" or GUI presence. So for non-visible controls a bit of a pain. Anyway checkout these links:
Basic Principles of ActiveX Controls:
Visual Basic Programming Examples