dbTalk Databases Forums  

C++ - DSO - ReportProgress

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss C++ - DSO - ReportProgress in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Bogdan
 
Posts: n/a

Default C++ - DSO - ReportProgress - 12-01-2004 , 02:55 PM






Hello All,

Can anyone help me with an example written in C++ that shows how to create customized callbacks to monitor the progress of a
cube processing. While I was able to find some samples they were written in Visual Basic or C#. My program looks like this:


#import "C:\Program Files\Common Files\System\ADO\msado21.tlb" no_namespace rename( "EOF", "adoEOF" )
#import "C:\Program Files\Common Files\Microsoft Shared\DSO\msmddo80.dll" \
no_namespace named_guids \
rename ("GetObject", "dsoGetObject") \
rename ("Command", "dsoCommand") \
rename ("_Command", "_dsoCommand") \
rename ("Properties", "dsoProperties") \
rename ("Property", "dsoProperty")


int main(int /* a_argc */, char** /* a_argv */ )

{
// Initialize the OLE Library...
CoInitialize(NULL);

_ServerPtr pServer(CLSID_Server);
pServer->Connect("localhost");

_DatabasePtr pNewDb = pServer->GetMDStores()->Item(_variant_t(0));

// ...
_CubePtr pCube = pNewDb->GetCubes()->AddNew("TestCube",sbclsRegular);

// ... Define the cube

pCube->Update();
pCube->Process(processFull); // _I would like to be able to cancel this if the processing takes too long

pServer->CloseServer();
// Close the OLE Library...
CoUninitialize();
return 0;

}


I have seen in the associated msmddo80.tli file the functions
inline HRESULT _IDatabaseEvents::RaiseReportProgress ( IDispatch * * obj, short * Action, long * Counter, BSTR * Message ) {

HRESULT _hr = raw_RaiseReportProgress(obj, Action, Counter, Message);

if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));

return _hr;

}

But I do not know how to overwrite it and register it with pNewDb.

Thanks in advance,

Bogdan


Reply With Quote
  #2  
Old   
 
Posts: n/a

Default Re: C++ - DSO - ReportProgress - 12-02-2004 , 10:51 AM






oh, don't worry, Microsoft expects us to change programming languages every
2 years

LoL
I dont think that Microsoft is doing a very good job with their VB
developers; either.. It seems like they have this newfangled C#, and there
was one benchmark once that showed that code could be written so that it
runs faster in C# than VB.net-- so now everyone is climbing on the C#
bandwagon while everyone else gets screwed.

I mean-- Microsoft has C# fever; and they're screwing all their other
developers basically.

It's like-- www.sqlmag.com just came out with a survey that lists the most
popular languages; and VB was the four highest categories (like VB6, VBS,
VB.net, VBA or something ridiculous) were the 4 most popular languages..

And somehow Microsoft expects us all to _change_ how we write code just
because some beancounter came out with a new marketing term.

It just blows me away, the arrogance that this company has.

SUPPORT YOUR LANGUAGES FOR 50 YEARS MICROSOFT!!!






"Bogdan" <bogdan (AT) adexa (DOT) com(no spam)> wrote

Hello All,

Can anyone help me with an example written in C++ that shows how to create
customized callbacks to monitor the progress of a
cube processing. While I was able to find some samples they were written in
Visual Basic or C#. My program looks like this:


#import "C:\Program Files\Common Files\System\ADO\msado21.tlb" no_namespace
rename( "EOF", "adoEOF" )
#import "C:\Program Files\Common Files\Microsoft Shared\DSO\msmddo80.dll" \
no_namespace named_guids \
rename ("GetObject", "dsoGetObject") \
rename ("Command", "dsoCommand") \
rename ("_Command", "_dsoCommand") \
rename ("Properties", "dsoProperties") \
rename ("Property", "dsoProperty")


int main(int /* a_argc */, char** /* a_argv */ )

{
// Initialize the OLE Library...
CoInitialize(NULL);

_ServerPtr pServer(CLSID_Server);
pServer->Connect("localhost");

_DatabasePtr pNewDb = pServer->GetMDStores()->Item(_variant_t(0));

// ...
_CubePtr pCube = pNewDb->GetCubes()->AddNew("TestCube",sbclsRegular);

// ... Define the cube

pCube->Update();
pCube->Process(processFull); // _I would like to be able to cancel this if
the processing takes too long

pServer->CloseServer();
// Close the OLE Library...
CoUninitialize();
return 0;

}


I have seen in the associated msmddo80.tli file the functions
inline HRESULT _IDatabaseEvents::RaiseReportProgress ( IDispatch * * obj,
short * Action, long * Counter, BSTR * Message ) {
HRESULT _hr = raw_RaiseReportProgress(obj, Action, Counter, Message);
if (FAILED(_hr)) _com_issue_errorex(_hr, this, __uuidof(this));
return _hr;
}
But I do not know how to overwrite it and register it with pNewDb.

Thanks in advance,

Bogdan



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.