Solved

Ole Com

Posted on 2002-04-09
4
281 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 200 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

[Webinar] Learn How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

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

For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
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…

691 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