Click here to Skip to main content
15,884,836 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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:
C++
#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.
Posted
Updated 3-May-11 4:28am
v2

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...
 
Share this answer
 
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).
 
Share this answer
 
v2
Comments
flippydeflippydebop 14-May-11 8:26am    
Hi there. Thats a good idea. I followed your advice and commented out the line and now get these errors:

error C2039: 'UpdateRegistry' : is not a member of 'CFrontierOPCServer'
error C2065: 'UpdateRegistry' : undeclared identifier

Does this tell me there is something wrong with the local class. Should I be defining this function?
Albert Holguin 15-May-11 22:20pm    
this is probably a function from that inheritance... i get the feeling you don't understand inheritance?
flippydeflippydebop 19-May-11 11:54am    
I do understand inheritance. Its just that it wasnt defined in the original code. I dont know if Microsoft have changed the definition in the VS2010 sdk for the client developer to have to wire that up! - Like I say this project compiled cleanly in VS6
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.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900