Powerpoint Automation in MFC

L

Lannie

Tutorial Link: http://support.microsoft.com/kb/169505

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
 
S

Steve Rindsberg

Tutorial Link: http://support.microsoft.com/kb/169505

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?

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.
 
M

msbox

Hi,

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.
 
Ç

绿豆狂潮

Me too...
It seems there is no quite sure answer for thie problem?
 
C

Cameron_C

I am having the same issue, but from what I have been able to dig out, the
knowledgebase article applies specifically to MFC 6.0.
I am running VS2008, and I need Excel.h and Excel.cpp which are not created
by following the specified steps.
I will try to create the files using C++6/0 and see what happens.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top