Article View: borland.public.cppbuilder.database.multi-tier
Article #271MIDAS METHODS - THREAD
From: Carlos F. Quijano
Date: Mon, 26 Aug 2002 14:43
Date: Mon, 26 Aug 2002 14:43
62 lines
2542 bytes
2542 bytes
Hi!
I need to use a Midas server from a thread with the following
considerations:
-. The server was created in the principal process so that the thread
doesn't begin it every time that is started.
-. I need to have access to several methods in the Midas server from my
Thread - Execute method.
-. I found the following code that it seeks retrieve data from a Midas to
Client DataSet but no works, neither it compiles! that is the code (I
suppose that to call a method is something similar) :
void PACKAGE __fastcall tctOpenCDS::Execute() // PACKAGE
????????????
{
bFIsRunning = true;
IProvider *Provider;
GUID iid = StringToGUID("{6E644935-51F7-11D0-8D41-00A0248E4B9A}");
//FreeOnTerminate = true;
FCount = FCDS->PacketRecords;
//Get the provider;
Provider = FCDS->Provider; // ??????????????????????????
try
{
OleCheck(CoInitialize(NULL));
//Marshall the provider interface into the stream...
OleCheck(CoMarshalInterThreadInterfaceInStream(iid, Provider,
&FStream));
int RecsOut;
//Get the marshalled interface
OleCheck(CoGetInterfaceAndReleaseStream(FStream, iid, (void **)
&Provider));
FHitEOF = false;
Provider->GetRecords(0, RecsOut, FNewData);
Synchronize(UpdateCDS);
while(FHitEOF == false)
{
Provider->GetRecords(FCount, RecsOut, FNewData);
FHitEOF = (RecsOut != FCount);
//Update the CDS
Synchronize(UpdateCDS);
}
}
__finally
{
CoUninitialize();
bFIsRunning = false;
}
}
Thanks for your help.
Carlos Quijano
Technical Details
Message-ID:
<3d6a3e39@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!logbridge.uoregon.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcd2b,b01dcbc98d515086,start X-Google-Attributes: gidfcd2b,public X-Google-ArrivalTime: 2002-08-26 07:51:16 PST From: "Carlos F. Quijano" <cquijanot@cable.net.co> Newsgroups: borland.public.cppbuilder.database.multi-tier Subject: MIDAS METHODS - THREAD Date: Mon, 26 Aug 2002 09:43:28 -0500 Lines: 68 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 NNTP-Posting-Host: 200.24.81.132 Message-ID: <3d6a3e39@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1030372921 200.24.81.132 (26 Aug 2002 07:42:01 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!news.maxwell.syr.edu!logbridge.uoregon.edu!nntp-relay.ihug.net!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail