继承自COM类(Inheriting from a COM class)
我在Visual Studio 2005中使用纯粹的非托管项目(C ++)。 我有一个来自第三方的COM类,在OCX文件中。 这个类是一个控件(“小部件”)。 我一直在通过使用Typelib向导的Add Class生成的IDispatch包装类来使用它。
我想以几种方式扩展这个类,公共继承比合成更实用(我希望派生对象公开父类所做的每一个方法)。 派生类也应该可用作COM组件。
我可以这样做吗? 如果是积极的,我该如何做到这一点?
I'm working in Visual Studio 2005 with a pure unmanaged project (C++). I have a COM class, from a third party, in a OCX file. This class is a control ("widget"). I've been using it through a IDispatch wrapper class generated using the Add Class from Typelib Wizard.
I would like to extend this class in a few ways and public inheritance would be way more practical than compositing (I want the derived object to expose every single method that the parent class does). The derived class should also be available as a COM component.
Can I do this? If positive, how can I accomplish this?
原文:https://stackoverflow.com/questions/6903646
最满意答案
我已经解决了这个问题 它是由另一个插件org.apache.cordova.file引起的,它缺少来自Plugins \ org.apache.cordova.file目录的单个File.cs源文件。 我将它从Github复制到我的解决方案中,现在它构建没有任何问题。
I have resolved this. It was caused by another plug-in, org.apache.cordova.file, missing its single File.cs source file from the Plugins\org.apache.cordova.file directory. I copied it from Github into my solution and now it builds without any problem.
相关问答
更多-
Windows Phone 8.0上的Cordova / PhoneGap上传错误(Cordova / PhoneGap Upload Error on Windows Phone 8.0)[2024-03-08]
诀窍是替换“x-wmapp0:/./。” 用空字符串。 The trick is to replace "x-wmapp0:/./." with an empty string. -
不幸的是,不支持iOS和Android。 如果你只想运行它(没有调试),你可以定义例如Grunt任务来执行命令(使用grunt-exec插件 ),该命令在WP上运行Cordova项目并从NetBeans调用该任务(右键单击项目并选择Grunt任务) Unfortunately not, only iOS and Android are supported. If you just want to run it (without debugging), you can define e.g. Grunt ta ...
-
PhoneGap - 在Windows Phone上安装,但应用程序在哪里?(PhoneGap - install on Windows Phone but where is the app?)[2023-07-14]
您首先需要启用应用程序的Sideloading,而不是来自商店。 转到Settings App->Update & Security->For Developers启用选项Sideload Apps 。 现在,将APPX的应用程序文件复制到设备上,双击appx文件中的/ Tab并安装应用程序。 或者您可以在设置应用程序的同一页面上激活设备入口/开发模式 并通过打开您在手机设备门户网站设置页面上看到的地址,从开发人员系统的浏览器进行部署: 并点击“选择文件”(在这里选择你的Appx),如果你有依赖项,通过“添 ... -
Windows SDK未正确安装。 Windows SDK was not properly installed.
-
我已经解决了这个问题 它是由另一个插件org.apache.cordova.file引起的,它缺少来自Plugins \ org.apache.cordova.file目录的单个File.cs源文件。 我将它从Github复制到我的解决方案中,现在它构建没有任何问题。 I have resolved this. It was caused by another plug-in, org.apache.cordova.file, missing its single File.cs source file f ...
-
带有Cordova的Windows Phone(通用)上的文本输入焦点问题(Text input focus issue on Windows Phone (Universal) with Cordova)[2022-01-01]
将Cordova升级到5.0.0版解决了这个问题。 Upgrading Cordova to version 5.0.0 resolved this problem. -
Windows Phone 8 Cordova-无法从WWW文件夹打开文件(Windows Phone 8 Cordova- Unable to open file from WWW folder)[2023-10-03]
你能尝试使用navigatetolocalstreamuri吗? http://blogs.msdn.com/b/wsdevsol/archive/2014/06/20/a-primer-on-webview-navigatetolocalstreamuri.aspx got it resolved.... user relative location url for HTML page. for example, if your page is in folder www/index and page y ... -
当您通过CLI添加android platform ,它应该创建所有必需的文件夹并从主www文件夹中复制您的共享代码(假设您在主www文件夹中有共享代码,而不是在platform/wp8 )。 您的index.html应该进入/www文件夹。 当您添加Android平台或使用CLI工具构建应用程序时,它将被复制到platform/android/assets/www文件夹。 (感谢@MBillau的输入,因为它应该更清楚。) 如果您为WP8应用程序实现了任何本机代码,则可能还需要为您的Android应用程序 ...
-
Cordova文件传输插件:无法插入请求标头Android(Cordova file-transfer plugin: cannot insert request headers Android)[2023-12-20]
好的。 我删除了,图标,飞溅,一些偏好等。这是你可以放回去的东西。 我已将您的编译器版本设置为cli-5.2.0 。 我已将你的android-minSdkVersion设置为14 。 这是因为你正在使用姜饼。 编译器应该设置为该值,但我想确保您的设备正常工作。 我加了一些插件; 你有版本的那些。 我只包括file-transfer ; file-transfer安装它需要的file版本。 (在评论中提交,以防万一。)如果你遇到问题,我将再续半小时。 我已经安装了whitelist插件; 确保在index. ... -
只有手机需要缩放图像,因此将它们全部移动到手机项目中的“资产”文件夹,并在Windows“资产”文件夹中单个副本,而不会在其名称中使用限定符。 这是我收到错误消息的唯一方法。 Solution I had a portable class library that for some reason had the BCL Build Components installed to it when it didn't use them at all. I removed them from the PCL vi ...