I'm trying to follow this tutorial to create an automation controller to
manipulate the Microsoft PowerPoint object model using MFC, but I'm getting
lots of errors like:
error C2146: syntax error : missing ';' before identifier 'GetRGB'
warning C4183: 'GetRGB': missing return type; assumed to be a member
function returning 'int'
error C2061: syntax error : identifier 'MsoRGBType'
Can anyone pls. help me with this?
Thanks,
Anne
Post the code that produces the error and enough of the surrounding code to
provide context. Without that, it's not likely that anyone will be able to
help.
--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
I am also having the same problem.
Basically i created a dialog based MFC application from scratch. Automation
was checked.
It compiled fine.
Then i added a class to the project by choosing "MFC Class From TypeLib" and
selected "MSPPT.OLB" in the Office folder.
I imported the _Application interface, that gave me "CApplication.h".
Now, i added an instance of that class in the beginning of the dialog box
cpp file, so it looks like this:
#include "stdafx.h"
#include "TestPP.h"
#include "TestPPDlg.h"
#include "DlgProxy.h"
#include "CApplication.h"
_Application app;
When i try to compile it, i get a lot of errors:
1>c:\dev\testpp\testpp\debug\msppt.tlh(414) : error C2371: 'FontPtr' :
redefinition; different basic types
1> c:\program files\microsoft visual studio
8\vc\include\comdef.h(322) : see declaration of 'FontPtr'
1>c:\dev\testpp\testpp\debug\msppt.tlh(1130) : error C2146: syntax error :
missing ';' before identifier 'GetRGB'
1>c:\dev\testpp\testpp\debug\msppt.tlh(1130) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int
1>c:\dev\testpp\testpp\debug\msppt.tlh(1130) : error C4430: missing type
specifier - int assumed. Note: C++ does not support default-int
1>c:\dev\testpp\testpp\debug\msppt.tlh(1130) : warning C4183: 'GetRGB':
missing return type; assumed to be a member function returning 'int'
1>c:\dev\testpp\testpp\debug\msppt.tlh(1132) : error C2061: syntax error :
identifier 'MsoRGBType'
1>c:\dev\testpp\testpp\debug\msppt.tlh(1152) : error C2061: syntax error :
identifier 'MsoRGBType'
1>c:\dev\testpp\testpp\debug\msppt.tlh(1154) : error C2061: syntax error :
identifier 'MsoRGBType'
...
Any ideas why?
Thanx.
I work in VB/VBA, so I can't be of much help here. With luck, someone familiar
with MFC and automation will chime in.