Solved

IMPLEMENT_OLECREATE & Automation

Posted on 2006-12-01
4
835 Views
Last Modified: 2013-11-20
Hi,

I am trying to enable OLE automation in one of my applications.  I want to use the IMPLEMENT_OLECREATE macro, however i am having difficulty.

this is the macro as mentioned on the msdn website.

IMPLEMENT_OLECREATE(class_name, external_name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8 )

I have several questions.

1.  class_name - What class  my CWinApp Derived class?
2. i understand the " l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8 " part is the clsid of the application.  How do i find out what my clsid for my app is?

thanks, also if you can point me in the direction of a good how to do on this that would appreciated
0
Comment
Question by:wdhough
[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
4 Comments
 
LVL 22

Accepted Solution

by:
mahesh1402 earned 250 total points
ID: 18055170
Look here : http://msdn2.microsoft.com/en-us/library/ms861541.aspx

IMPLEMENT_OLECREATE macro, which allows instances of a CCmdTarget-derived class to be created by Automation clients.

The Guidgen.exe GUID generator is supplied with the Microsoft Visual C++ development system.

-MAHESH
0
 

Author Comment

by:wdhough
ID: 18068330
Mahesh,

Thanks for your response.  I have managed to do that. but when compiling now it says

c:\test\apps\MyApp.cpp(54): error C2039: 'factory' : is not a member of 'MyApp'
c:\test\apps\MyApp.cpp(54): error C2039: 'guid' : is not a member of 'MyApp'
c:\test\apps\MyApp.h(7) : see declaration of 'MyApp'
c:\test\apps\MyApp.cpp(54): error C2065: 'guid' : undeclared identifier
c:\test\apps\MyApp.cpp(54): error C2039: 'guid' : is not a member of 'MyApp'
c:\test\apps\MyApp.h(7) : see declaration of 'MyApp'
c:\test\apps\MyApp.cpp(54): error C2373: 'guid' : redefinition; different type modifiers
0
 

Author Comment

by:wdhough
ID: 18068501
Aplogies,

I left out the DECLARE_OLECREATE(name) in the .h file.

0
 

Author Comment

by:wdhough
ID: 18070140
Mahesh,  I know have most of the application up and running (so to speak).  My application is an Exe that has interfaces in it that external applications can access and use for automation.  I have added a new interface for my new class.  I have written a quick app (in c#), litterally a form with a button on it, that when clicked should instantiate my application object.

The problem i am receiving is

An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in WindowsApplication1.exe
 Additional information: COM object with CLSID {157A834E-77AD-4012-8437-3BB3C9007E2E} is either not valid or not registered.

I have checked through the object browser and it can see the object i am trying to instantiate, i have taken this project over from someone else who set up the other interfaces and i dont know how they "registered" them.  Any ideas

Many thanks

Will
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ODBC Connection Logging, ADO.NET 6 73
while loop over for loop 7 119
matchUp  challenge 6 82
My project did see openJDK that I installed. What could be the problem 7 169
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to use Hyena, from SystemTools Software, to update 100 user accounts from an external text file. View in 1080p for best video quality.

738 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