Click to See Complete Forum and Search --> : Ref Class referencing ref class


jjones7947
September 30th, 2009, 04:40 PM
Started a Windows Service project in C++ with VS2008. It set up the project as a managed one, so I continued the theme. Was able to get all the functions filled in. And it compiled fine. Then I introduced a new ref class for logging it has a default constructor and 3 functions. However, when I tried to instantiate it in the main class, I get errors that the Logger class is not found. It is in the project namespace and the file itself compiles now, when writing it I got compiler errors when I had errors in the code so I know the compiler can "see" it. The error I get is C2146 syntax error : missing ';' before identifier 'logger'. The line in question is

Logger^ logger;

Possibles
1. Need a header file?
2. Some other syntax?

Thanks,
Jim

Alex F
October 1st, 2009, 02:17 AM
Is Logger.h included?

jjones7947
October 1st, 2009, 07:45 AM
No, was trying to figure out whether I could do #include. Seem to have missed that in the hoopla about managed code. Thought is was more like the C# dotnet. Thanks, worked fine.
Jim