vs2005下Windows Shell扩展编程完全指南例子一中的问题解决

GDI+ 编译问题 当写一个gdi+的程序时,如果编译的过程中出现一大堆的错误,如: 1>c:\program files\microsoft sdks\windows\v6.0a\include\gdiplusimaging.h(74) : error C4430: 缺少类型说明符 - 假定为 int。注意: C++ 不支持默认 int 1>c:\program files\microsoft sdks\w 阅读详情

最近开始用vs2005学习Windows Shell扩展 编程,主要参考codeproject的几个经典例子 ,这几个经典例子 以前都是在vc6的环境下跑的,后来作者更新到vc7,网上还有好多教程是老版本的基于vc6环境的教程。vs2005属于vc8和vc7还是略有区别不过区别不大,现在把这两天学习的内容列下来,仅供参考。
1. 按照方法生成项目,系统会自动生成两个项目SimpleExt和SimpleExtPS,SimpleExtPS项目可以整个删掉,对结果没有什么影响。
2. 按照方法拷贝代码过来时,记得将教程中的GUID修改为自己的GUID,就是中括号中包含好多字符的那个。这个GUID可以在idl文件的“library SimpleExtLib”项下面找到。

3. 编译后出现错误提示:
error C2787: “IContextMenu”: 没有与该对象关联的 GUID
error C2440: “初始化”: 无法从“DWORD_PTR”转换为“const IID *”
1> 从整型转换为指针类型要求 reinterpret_cast、C 样式转换或函数样式转换
error C2440: “初始化”: 无法从“ATL::_ATL_CREATORARGFUNC (__stdcall *)”转换为“DWORD_PTR”
1> 没有使该转换得以执行的上下文

这个简单的用网上说的将包含文件PlatformSDK/include目录放在include目录前不适合vs2005,不能解决问题,倒是另一种方法可以解决,就是在SimpleShlExt.h文件中增加一行代码:
struct __declspec(uuid(“000214E4-0000-0000-C000-000000000046″)) IContextMenu;
若使用IQueryInfo的话要加入:
struct __declspec(uuid(“00021500-0000-0000-C000-000000000046″)) IQueryInfo;
4. 编译后出现错误提示:
1>正在注册输出…
1>Project : error PRJ0050: 未能注册输出。请确保您有修改注册表的相应权限。
1>生成日志保存在file://e:/project/shell/SimpleExt/SimpleExt/Debug/BuildLog.htm

这个问题需要在属性->配置属性->连接器->常规->注册输出项将“是”改为“否”即可。
5. 在项目的属性->自定义生成步骤->常规中设置命令行为:
regsvr32 /s /c “$(TargetPath)”
echo regsvr32 exec. time > “$(OutDir)/regsvr32.trg”
可自动注册dll,极为方便。
以上几个步骤基本可以保证实现预定功能。

原创文章,转载请注明: 转载自 袖子的博客

本文链接地址: vs2005下Windows Shell扩展编程完全指南例子一中的问题解决

自己动手写一个简单的Windows shell扩展程序 阅读详情

相关推荐

Shell扩展编程一:添加windos右键菜单---win10 64位+VS2008

参考资料: 《Windows-Shell扩展编程完全指南》 《如何编程实现扩展右键菜单之一:增加自己的菜单项》https://blog.youkuaiyun.com/chen_wei_d/article/details/5462378 《Windows Shell编程实现右键菜单-VS2005,Win7 32位》https://blog.youkuaiyun.com/zaishaoyi/article/details/38475553 配置环境:win10+vs2008 实现效果: ...

duopuledemao的博客 2123

MFC error LNK 链接错误

做课设,遇到各种错误。 说实话,个人最讨厌链接错误了,真的很难发现。下面给一些链接错误的情况,希望有帮助。 1. error LNK2001: 无法解析的外部符号  bighomeDlg.obj : error LNK2001: 无法解析的外部符号 ((类名): static  (后面跟一个变量名)) Debug/*.exe : fatal error LNK1120: 1

yunfanfighting的专栏 933

带挂牵引车倒车运动模型推导及仿真实现

半挂牵引车在倒车时,由于鞍座主销的连接限制,其运动方式与乘用车有显著差异。例如,乘用车在右侧倒车入库时,只需确定泊车起点并将方向盘向右打死。相反,牵引车在倒车时需要先向左转方向盘,当铰接角达到防折叠的临界值时,再将方向盘向右转回,以调整牵引车与挂车至直线状态,完成泊车入库。本研究旨在建立一个基于牵引车带挂车倒车运动学模型,该模型基于以下假设: 道路在车辆行驶过程中保持平坦,无凹凸不平; 车辆以低速行驶,且在运行过程中车身不发生侧倾或俯仰; 行驶过程中,轮胎无变形,无侧向滑动,且不产

jianmo的博客 2697

winsock 错误多的真爽啊

Windows平台下用C++做网络开发很多时候都会同时包含这两个头文件,如若顺序不当(windows.h先于winsock2.h)就会出现很多莫名其妙的错误。诸如: c:\program files (x86)\microsoft sdks\windows\v7.0a\include\ws2def.h(91): warning C4005: “AF_IPX”: 宏重定义 1>

Tyrion Lannister's Special column 1万+

海康威视Web3.0插件实战:快速部署摄像头实时预览方案

本文详细介绍了海康威视Web3.0插件的实战应用,包括快速部署摄像头实时预览方案的完整流程。从插件下载安装到摄像头连接配置,再到浏览器兼容性解决方案,帮助开发者和IT人员高效实现网页端监控功能。特别针对预览功能调优和多摄像头管理等高级应用提供了实用技巧。

weixin_29266679的博客 346

基于卷积神经网络的遥感图像地物分类

AI:89-基于卷积神经网络的遥感图像地物分类 基于卷积神经网络的遥感图像地物分类是一个令人兴奋的领域,它在环境监测、城市规划、农业、国防等领域具有广泛的应用。深度学习技术为我们提供了更准确、高效的工具,有望在未来进一步提高分类性能。在本文中,我们探讨了卷积神经网络的工作原理、数据准备、模型构建、训练和评估过程,并提供了多个代码示例。此外,我们讨论了地物分类的应用和挑战,以及未来的发展趋势。

一键难忘的博客 2717

cast 变成了整数_错误:从整型转换为指针类型需要reinterpret_cast,C风格转换或函数风格转换...

我正在使用变量RockElem获得转换错误。该变量是在一个类中定义的,其他变量是整数。这个变量被定义为const。错误:从整型转换为指针类型需要reinterpret_cast,C风格转换或函数风格转换if(resistivitySolve)fileName << "_resist";else if(dynamic_cast< const Water* >(fluid) !...

weixin_39979215的博客 699

《深入掌握MongoDB数据库》 - 专栏介绍和目录

本专栏系统讲解MongoDB从基础到高级的全栈知识,涵盖安装配置、核心操作、性能优化、安全运维等核心内容。基础部分包括CRUD操作、数据类型、查询语法等入门知识;进阶部分深入索引优化、聚合查询、事务处理等高级特性;核心原理解析存储引擎与数据格式;安全运维则聚焦访问控制、认证机制、审计日志等企业级实践。通过实战案例与最佳实践,帮助开发者全面掌握MongoDB在不同场景下的应用,适合各层次技术人员系统学习。

数据知道的博客 2996

错误 C2440

错误 C2440错误 C2440 “初始化”: 无法从“char”转换为“char *” 错误 C2440 “初始化”: 无法从“char”转换为“char *” 从整型强制转换为指针类型要求 reinterpret_cast、C 样式强制转换或函数样式强制转换 错误 C2440 “初始化”: 无法从“char”转换为“char *” 修改方案: 将 “符合模式选项” 改为 “否” ...

鷝翗的博客 1万+

【CSP-S 提高组】考试大纲集合

【CSP-S提高组】考试大纲集合

weixin_42596089的博客 7255

使用OpenGL加载和显示DXF格式的3D模型文件编程

这样,我们就完成了使用OpenGL加载和显示DXF格式的3D模型文件的编程。通过实现加载函数和绘制回调函数,我们能够读取DXF文件的数据并使用OpenGL绘制出来。请注意,这只是一个简单的例子,仅涵盖了基本的加载和显示功能。在本文中,我们将探讨如何使用OpenGL编程加载和显示DXF(Drawing Exchange Format)格式的3D模型文件。DXF是一种通用的CAD(计算机辅助设计)文件格式,常用于存储和交换2D和3D图形数据。使用OpenGL加载和显示DXF格式的3D模型文件编程。

2301_79331421的博客 413

Windows 右键扩展菜单实现中遇到的问题

Windows 右键扩展菜单实现中遇到的问题   1. 右键扩展实现目标   实现效果如下:       对于文本文件点击右键,在右键菜单中出现“SimpleShlExt Text Item”菜单项。   2. 开发环境     Windows7  32位     VS2005      3. 教程与参考资料

xiaoqiangXX的专栏 1529

ESP32-S3模组上兼容SCCB总线与I2C总线的解决方案(1)

ESP32-S3模组上兼容SCCB总线与I2C总线的解决方案(1)

phmatthaus的专栏 775

一个简单的Windows shell扩展程序

    关于什么叫Windowsshell扩展程序,这里不作介绍,不懂的同学请google之。                                                              一.Shell程序编写            这里采用的开发环境为WindowsXP+sp3, VS 2005 + sp1 (应该支持VS 2005以上的VS版本,VC 6.0估计不...

qq_41786318的博客 7082

老版QQ原生表情gif动态

这是老版的QQ表情,不过全是动态的的,Windows照片查看器是不会动的,可以右击用浏览器打开查看,再说一遍是老版的,只是分享给宁愿用老版也要动态的人。

lwip-2.0.3

lwip是瑞典计算机科学院(SICS)的Adam Dunkels 开发的一个小型开源的TCP/IP协议栈。实现的重点是在保持TCP协议主要功能的基础上减少对RAM 的占用。

Windows Shell编程实现右键菜单-VS2005,Win7 32位

参考资料: windows右键菜单开发--with vs2008(2005) or vc9(vc8) 前言:其实最近一直在看微软的刻录函数 imapi2,发现大量的接口函数,不过com没怎么接触过,上手比较困难。但是以前给自己的一个程序做过一个右键菜单,是通过windows的shell接口来实现的,所以在这里回忆总结一下,顺便与大家分享下经验。(其实网上google下能

zaishaoyi的专栏 5764

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

VS2005创建一个WinCE的应用程序

首先要确认以下条件必须满足: (1)有可用的SDK   (2)  VS2005(也可以使用EVC,只要安装了对应版本的SDK就行) (3)在新建的project中选择正确的SDK。 创建步骤: (1)打开VS2005;File->new->project...          出现 New Project 对话框          在project types中选择Smart De

wk_sky的专栏 2571

假人有限元模型

假人模型,车辆碰撞假人有限元模型,适合做乘员安全的研究者利用

'IContextMenu' : no GUID has been associated with this object问题的解决

作者:朱金灿来源:http://blog.youkuaiyun.com/clever101             在Win XP环境下使用VS 2005编译一个shell扩展工程,出现一些编译错误:error   C2787:   'IContextMenu '   :  no   GUID   has  been   associated   with  this   objecterror   C244

clever101的专栏 3835

Qt5.12 + VS2017 环境配置踩坑记:手把手解决shell32.lib和windows.h报错

本文详细解析了Qt5.12与VS2017环境配置中常见的shell32.lib和windows.h报错问题,提供了从Windows SDK路径优化到项目级环境变量配置的完整解决方案。通过精准设置包含目录和库目录,帮助开发者彻底解决这些棘手的配置问题,提升开发效率。

weixin_30908941的博客 306

1、VS2005(c/c++)外壳扩展编程之windows右键菜单(1)

第一部分 SHELL基本概念     Windows外壳扩展(Windows Shell Extension),是一类特殊的COM对象,在这类COM对象中用户可以加入自己的特殊功能,而Windows外壳扩展最终都会被Windows Explorer所引用[1]。     A shell extension is a COM object that adds some kind of functio...

weixin_34217773的博客 266

2、VS2005(c/c++)外壳扩展编程之windows右键菜单(2)

第二部分 Windows SHELL编程 There are many types of shell extensions, each type being invoked when different events happen. Here are a few of the more common types, and the situations in which they are i...

weixin_30563917的博客 103
上一篇: 动态绑定:父类析构函数不声明为虚析构函数的灾难。。。。
下一篇: OPENFILENAME打开文件对话框选择多个文件的问题解决
chishui2
博客等级 码龄20年 7粉丝 12原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值