?
Solved

Ole Com

Posted on 2002-04-09
4
Medium Priority
?
282 Views
Last Modified: 2013-12-03
Hello Experts...
Did any one hear about Mapinfo?.

Well.... The provide the following file: "mapinfow.h"

It looks something like this...

class DMapInfo : public COleDispatchDriver
{
// Attributes
public:

// Operations
public:
     // method 'QueryInterface' not emitted because of invalid return type
     // method 'AddRef' not emitted because of invalid return type
     // method 'Release' not emitted because of invalid return type
     LPDISPATCH GetApplication();
     LPDISPATCH GetParent();
     CString GetName();
     CString GetFullName();
     CString GetVersion();
     BOOL GetVisible();
     void SetVisible(BOOL bNewValue);
     long GetLastErrorCode();
     void SetLastErrorCode(long nNewValue);
     CString GetLastErrorMessage();
     LPDISPATCH GetMBApplications();
     void Do(LPCTSTR command);
     CString Eval(LPCTSTR expression);
     void RunCommand(LPCTSTR command);
     void RunMenuCommand(short id);
     LPUNKNOWN DataObject(long windowID);
     void SetCallback(LPDISPATCH callbackobject);
};

There are some other classes defined...
The problem is that they are classes derived from MFC....
And I am not using (And I refuse to :-) MFC.

Can any one tell me how to create an object like this but not using MFC?....

Thankks
0
Comment
Question by:Marsc
[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
4 Comments
 
LVL 7

Accepted Solution

by:
peterchen092700 earned 800 total points
ID: 6940392
>> The provide the following file
you mean "The clazz wizard provides..:" ?

You can use the #import directive to import the type library, doesn't require MFC, and the generated wrapper classes are much better IMO. However, you need to be proficient with exception handling.

#import "typelibrary.tlb/dll/whatever" rename_namespace("nsMyTypeLib")

try {
  nsMyTypeLib::IMapInfoPtr pMI; // Interface name + "Ptr"
  pMI.CreateInstance(__uuidof(MapInfo/* Co Class Name */));
  pMI->Method();
}
catch (_com_error ce) {
  ce.ReportError(); // or whatever to handle the error
}
0

Featured Post

Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

Question has a verified solution.

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

This article describes how to programmatically preset the "Pages per Sheet" option that's available with most printer drivers.   This setting lets you do "n-Up" printing, where two, four, or more pages are printed on each sheet of paper. If your …
If you have ever found yourself doing a repetitive action with the mouse and keyboard, and if you have even a little programming experience, there is a good chance that you can use a text editor to whip together a sort of macro to automate the proce…
The purpose of this video is to demonstrate how to set up the WordPress backend so that each page automatically generates a Mailchimp signup form in the sidebar. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…

764 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