Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

AfxOleInit

Posted on 2001-08-28
4
Medium Priority
?
336 Views
Last Modified: 2008-03-17
can I use AfxOleInit in a plain old console app if I include afxdisp.h?


what's up with that.

it keeps giving me errors.
0
Comment
Question by:bebonham
  • 2
4 Comments
 

Expert Comment

by:Kevin_Elrod
ID: 6433115
I don't think so.  The "Afx" prefix usually means MFC land and takes you out of console app into Windows land.
0
 
LVL 86

Accepted Solution

by:
jkr earned 200 total points
ID: 6433153
It is possible, but that requires a lot of work (see e.g. http://support.microsoft.com/support/kb/articles/Q152/6/96.asp which describes this for DB classes, but it's mainly the same for OLE support).

But, as this function does nothing but initialize the OLE libraries, why don't you use 'OleInitialize()'? That would give the same result...
0
 
LVL 8

Author Comment

by:bebonham
ID: 6433229
I am trying to take a SDK written in MFC type stuff and use it in my C++ console program.

I am probably only prolonging my suffering to continue to try...maybe I should give up and try an MFC only approach.

Thanks, I will try.

Bob
0
 
LVL 8

Author Comment

by:bebonham
ID: 6433260
it is still giving errors...

this mfc stuff is really frustrating!!!

Since the SDK uses COleDispatchDriver....maybe that is why I have to use MFC?
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Question has a verified solution.

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

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…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
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 be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
Suggested Courses
Course of the Month12 days, 14 hours left to enroll

971 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