Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Powerpoint Automation in MFC

170 views
Skip to first unread message

Lannie

unread,
Jun 29, 2008, 6:52:00 AM6/29/08
to
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

Steve Rindsberg

unread,
Jun 29, 2008, 11:53:28 AM6/29/08
to

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
================================================

msbox

unread,
Jul 21, 2008, 3:35:01 PM7/21/08
to
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.

Steve Rindsberg

unread,
Jul 22, 2008, 10:27:07 AM7/22/08
to

> Any ideas why?

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.

绿豆狂潮

unread,
Sep 25, 2008, 2:26:01 AM9/25/08
to
Me too...
It seems there is no quite sure answer for thie problem?

Cameron_C

unread,
Dec 5, 2008, 4:04:11 PM12/5/08
to
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.
0 new messages