DECLARE_REGISTRY_RESOURCEID行上的编译错误 [英] Compile Errors on line DECLARE_REGISTRY_RESOURCEID

查看:154
本文介绍了DECLARE_REGISTRY_RESOURCEID行上的编译错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好.

我想知道是否有人可以帮助我.我正在升级最初用C ++ 6.0构建的项目.
由于宏是一个Microsoft宏,我怀疑它应该可以正常工作,因此我不敢理会这些问题.

这是我遇到的错误:

Hi there.

I wonder if someone can help me. I am upgrading a project that was originally built in C++ 6.0.
I am left scratching my head on these ones as the macro is a microsoft macro that I suspect should just work!

Here are the errors I am getting:

1>d:\code\applications\opc\opcserversdebug\dlfrontieropcserver\frontieropcserver.h(44): error C2760: syntax error : expected '{' not '*'
1>d:\code\applications\opc\opcserversdebug\dlfrontieropcserver\frontieropcserver.h(44): error C2059: syntax error : ')'
1>d:\code\applications\opc\opcserversdebug\dlfrontieropcserver\frontieropcserver.h(44): error C2059: syntax error : ')'
1>d:\code\applications\opc\opcserversdebug\dlfrontieropcserver\frontieropcserver.h(44): error C2143: syntax error : missing ';' before '{'
1>d:\code\applications\opc\opcserversdebug\dlfrontieropcserver\frontieropcserver.h(44): error C2760: syntax error : expected 'identifier' not '('
1>d:\code\applications\opc\opcserversdebug\dlfrontieropcserver\frontieropcserver.h(44): error C2760: syntax error : expected '{' not '*'
1>d:\code\applications\opc\opcserversdebug\dlfrontieropcserver\frontieropcserver.h(44): error C2059: syntax error : ')'
1>d:\code\applications\opc\opcserversdebug\dlfrontieropcserver\frontieropcserver.h(44): error C2059: syntax error : ')'
1>d:\code\applications\opc\opcserversdebug\dlfrontieropcserver\frontieropcserver.h(44): error C2143: syntax error : missing ';' before '{'


之前
这是有问题的类的代码:



Here is the code for the class in question:

#ifndef __FRONTIEROPCSERVER_H_
#define __FRONTIEROPCSERVER_H_

#pragma warning(disable:4786)

#include "resource.h"       // main symbols

#include "OPCServer.h"
#include "OPCMemoryAS.h"
#include "OPCScanner.h"
#include "OPCComponent.h"
#include "FrontierOPCMemoryAS.h"

/////////////////////////////////////////////////////////////////////////////
// CFrontierOPCServer

class CFrontierOPCServer : 
	public COPCServer,
	public CComCoClass<CFrontierOPCServer, &CLSID_FrontierOPCServer>

{
public:

DECLARE_REGISTRY_RESOURCEID(IDR_FRONTIEROPCSERVER)
DECLARE_NOT_AGGREGATABLE(CFrontierOPCServer)

BEGIN_CATEGORY_MAP(CFrontierOPCServer)
	IMPLEMENTED_CATEGORY(CATID_OPCDAServer10)
	IMPLEMENTED_CATEGORY(CATID_OPCDAServer20)
END_CATEGORY_MAP()

};

typedef CComObject<CFrontierOPCServer> CFrontierOPCServerObject;

#endif //__FRONTIEROPCSERVER_H_


产生所有这些错误的行是:


The line that is generating all these errors is:

DECLARE_REGISTRY_RESOURCEID(IDR_FRONTIEROPCSERVER)



如果有人可以帮助,将不胜感激.

在此先感谢您.



If anyone could help it would be greatly appreciated.

Thanks in advance.

推荐答案

如果您要升级ATL,则我的建议一次通过此链接ATL教程-> [
If you are upgrading an ATL than my suggestion is once go through this link ATL tutorial ->[^]

As far as I know, It is not possible to directly update ActiveX from 6.0 to later version... (VS2008).I am not aware of VS2005.
you have to create another project with same guid (Manually change the guid) and follow the steps that is used in ATL tutorial and copy your code in this new ATL tutorial...


错误c2760 [
error c2760[^] is a casting error, not likely to be thrown for DECLARE_REGISTRY_RESOURCEID, maybe its an error with the public CComCoClass<> template inheritance.

If you comment out the line before compiling, do you get the same error? That would tell you for sure it that''s the line causing the error (you may get other errors).


这个项目是一个复杂的项目.您确定这是方法吗?除了这一行以外,其他所有内容似乎都可以在编译器中使用.
This project is a complicated one. Are you sure this is the way? Everything else appears to be working with the compile except for this one line.


这篇关于DECLARE_REGISTRY_RESOURCEID行上的编译错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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