Solved

Compile error with "oleauto.h"

Posted on 2003-12-08
6
1,728 Views
Last Modified: 2008-08-08
Hi,

I'm new to Visual C++ 6.0.  When I try to compile my code, I get an error message trying to compile this line,

#include "oleauto.h"

It says,

c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : error C2146: syntax error : missing ';' before identifier 'IID_StdOle'
c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

Anyone know what's causing this? I'm using the include as I'm trying to use SAFEARRAYS.

Thanks,
Malcolm
0
Comment
Question by:malramsay
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 24

Expert Comment

by:shivsa
ID: 9901198
u should be using
#include <oleauto.h>
in old C++ convention.

or
#include <oleauto>
in C++ convention.

0
 

Author Comment

by:malramsay
ID: 9901242

Hi, I'd thought of that already (sorry, I probably should have said).  If I change the line to

#include <oleauto.h>

I still get the same error,

c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : error C2146: syntax error : missing ';' before identifier 'IID_StdOle'
c:\program files\microsoft visual studio\vc98\include\oleauto.h(30) : fatal error C1004: unexpected end of file found
Error executing cl.exe.

And if I use, "#include <oleauto>" I get an error about not finding the file,
"fatal error C1083: Cannot open include file: 'oleauto': No such file or directory"

Any other ideas?
0
 
LVL 24

Expert Comment

by:shivsa
ID: 9901271
check your oleauto.h file and check for IID_StdOle, it looks like syntex error in that file.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:malramsay
ID: 9901299
Crap.  I thought you were going to tell me that.  I've checked the file and here's the first 30 lines (as the error is on the 30th line).  I'm a VB not a C++ programmar, so I'm a bit out of my depth.  Does anything look strange to you?  If I can't get this to work can I simply get another oleauto.h file on the web somewhere? Thanks.

//+---------------------------------------------------------------------------
//
//  Microsoft Windows
//  Copyright 1992 - 1998 Microsoft Corporation.
//
//  File:       oleauto.h
//
//  Contents:   Defines Ole Automation support function prototypes, constants
//
//----------------------------------------------------------------------------

#if !defined( _OLEAUTO_H_ )
#define _OLEAUTO_H_

// Set packing to 8 for ISV, and Win95 support
#ifndef RC_INVOKED
#include <pshpack8.h>
#endif // RC_INVOKED

//  Definition of the OLE Automation APIs, and macros.

#ifdef _OLEAUT32_
#define WINOLEAUTAPI        STDAPI
#define WINOLEAUTAPI_(type) STDAPI_(type)
#else
#define WINOLEAUTAPI        EXTERN_C DECLSPEC_IMPORT HRESULT STDAPICALLTYPE
#define WINOLEAUTAPI_(type) EXTERN_C DECLSPEC_IMPORT type STDAPICALLTYPE
#endif

EXTERN_C const IID IID_StdOle;
0
 
LVL 86

Accepted Solution

by:
jkr earned 125 total points
ID: 9901334
Are you using 'oleauto.h' without including any windows headers? Try adding

#include <windows.h>
#include <objbase.h>
0
 

Author Comment

by:malramsay
ID: 9901367

D'oh!  Thanks jkr - I had been using <windows.h> but not <objbase.h> as well.  I thought it might be something easy like that 'cos I'm such a novice!

I'll have to look up what objbase does exactly....

Thanks also shivsa - I'll no doubt be posting more questions over the next couple of days as I try to get my head around this project.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
The viewer will learn how to use the return statement in functions in C++. The video will also teach the user how to pass data to a function and have the function return data back for further processing.
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question