Solved

Compile error with "oleauto.h"

Posted on 2003-12-08
6
1,672 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
  • 3
  • 2
6 Comments
 
LVL 24

Expert Comment

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

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

0
 

Author Comment

by:malramsay
Comment Utility

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
Comment Utility
check your oleauto.h file and check for IID_StdOle, it looks like syntex error in that file.
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 

Author Comment

by:malramsay
Comment Utility
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
Comment Utility
Are you using 'oleauto.h' without including any windows headers? Try adding

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

Author Comment

by:malramsay
Comment Utility

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
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 pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now