Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
General
 MetaMatica Forum : General
Subject Topic: Integration into legacy application Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
MartyMed
Newbie
Newbie


Joined: 06 December 2008
Online Status: Offline
Posts: 3
Posted: 06 December 2008 at 3:45pm | IP Logged Quote MartyMed

Wanting to use MetaReport with a C/C++ application. Downloaded the developer kit expecting to find some documentation on how to do this but could not find any. Could not even find a DLL with the ActiveX controls.

How is this done. Any pointers to documentation or tips on how to do this. Does the trial MetaReport Developer Kit include everything needed to trial an integration.

Cheers

Back to Top View MartyMed's Profile Search for other posts by MartyMed
 
administrator
Admin Group
Admin Group
Avatar

Joined: 01 October 2003
Online Status: Offline
Posts: 46
Posted: 07 December 2008 at 4:05am | IP Logged Quote administrator

Unfortunately installation package doesm't contain the example for C/C++. We'll add this in next release.
Quote:
Does the trial MetaReport Developer Kit include everything needed to trial an integration.
Yes of course. See into "Redistributable files" folder. By default it is "C:\Program Files\MetaReport\deploy". This contains:
MetaReportRuntime.exe - runtime module and COM server
UnzDll.dll, ZipDll.dll - secondary DLL-s

MetaReportRuntime.exe is self registering server. You can find the information how to use this in help files.

See the example below how to use it in C++ programs.
COM object is corresponding to help file. But you have to add prefix Get in order to get value from the property and Put in order to put value into properties. VC workbench will help you to use correct syntax

CPP example:

#include "stdafx.h"

#import "C:\Program Files\MetaReport\deploy\MetaReportRuntime.exe" no_namespace


struct InitOle {
    InitOle() { ::CoInitialize(NULL); }
    ~InitOle() { ::CoUninitialize();   }
} _init_InitOle_;       // Global Instance to force load/unload of OLE

int APIENTRY WinMain(HINSTANCE hInstance,
                         HINSTANCE hPrevInstance,
                         LPSTR     lpCmdLine,
                           int       nCmdShow)
{
      // TODO: Place code here.
     
     IAppPtr obj;
     int i;

     try
     {
             obj.CreateInstance("{BD4714B3-9941-4EF5-9DD6-126 B97F7B6DD}") ;

             //obj->Init("sdfsdfsdfsdfds");
              MessageBox(0,obj->GetProjectsPath(),"ca pt",0);
              obj->About();
             for (i=0; i < obj->ReportCount; i++)
             {
                  MessageBox(0,obj-& gt;GetReport ID(i), "qqq",0);
             }

             obj->StartReport("Demo Report (ado)");

             obj = 0;
     }
    catch( _com_error &e){
        _bstr_t bstrSource(e.Source());
        _bstr_t bs = _bstr_t(" Error: ") + _bstr_t(e.Error()) + _bstr_t(" Msg: ")
               + _bstr_t(e.ErrorMessage()) + _bstr_t(" Description: ")
               + _bstr_t(e.Description());
       
        MessageBox(0,bs,bstrSource, MB_OK);
     }      ;  ;     


     return 0;
}



Edited by administrator on 07 December 2008 at 4:09am


__________________
Oleg Yershov
Back to Top View administrator's Profile Search for other posts by administrator Visit administrator's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.91
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.0781 seconds.