SM
2010-04-30 09:36:51 UTC
Hi,
I have ATL project in VS2008.
I'm trying to initialize the structure as below in the header
file(test.h)
#pragma once
#include "resource.h" // main symbols
#include <atlhost.h>
typedef struct{
int a;
int b;
}TestStructure;
class CTestStructureDialog :
public CAxDialogImpl<CTestStructureDialog>
{
public:
TestStructure *t2={0,1}
};
I'm getting error as below
error C2059: syntax error : '{'
error C2334: unexpected token(s) preceding '{'; skipping apparent
function body
How to initialize the pointer structure?
When i initialise at .cpp file using t2=new TestStructure, it's
working fine, how i can assign default values in new TestStructure
When I tried without initialize and refer the structure in another
class,
Class name :CTest1(file test1.h)
class CTest1 :
public CAxDialogImpl<CTest1>, public CUpdateUI<CTest1>,
public CMessageFilter, public CIdleHandler
{
public:
TestStructure t3; // getting error in this line error C2146: syntax
error : missing ';' before identifier
};
I'm getting error as
error C2146: syntax error : missing ';' before identifier.
The actual code is converted from VC++6.0 to VS2008 using project
conversion wizard in VS2008.
Thanks,
Sony
I have ATL project in VS2008.
I'm trying to initialize the structure as below in the header
file(test.h)
#pragma once
#include "resource.h" // main symbols
#include <atlhost.h>
typedef struct{
int a;
int b;
}TestStructure;
class CTestStructureDialog :
public CAxDialogImpl<CTestStructureDialog>
{
public:
TestStructure *t2={0,1}
};
I'm getting error as below
error C2059: syntax error : '{'
error C2334: unexpected token(s) preceding '{'; skipping apparent
function body
How to initialize the pointer structure?
When i initialise at .cpp file using t2=new TestStructure, it's
working fine, how i can assign default values in new TestStructure
When I tried without initialize and refer the structure in another
class,
Class name :CTest1(file test1.h)
class CTest1 :
public CAxDialogImpl<CTest1>, public CUpdateUI<CTest1>,
public CMessageFilter, public CIdleHandler
{
public:
TestStructure t3; // getting error in this line error C2146: syntax
error : missing ';' before identifier
};
I'm getting error as
error C2146: syntax error : missing ';' before identifier.
The actual code is converted from VC++6.0 to VS2008 using project
conversion wizard in VS2008.
Thanks,
Sony