Article View: borland.public.cppbuilder.database.multi-tier
Article #419How to return a VARIANT value from remote COM object in BCB6?
From: Mountain Lan
Date: Sun, 07 Jul 2002 16:26
Date: Sun, 07 Jul 2002 16:26
43 lines
2888 bytes
2888 bytes
Hi, guys,
I am migrating my program from BCB5 to BCB6. My program is a multi-tier one.
I am using COM+ as the middle-ware. Because DCOM can't work in many networks
having firewall, I am using socket connection instead. So I can't use the
method 'CreateRemote' to create a remote COM object. The only way to access
remote COM object is through 'AppServer' property of 'TDispatchConnection'.
My problems are:
1. I can't get any type of value return via TVariant if I use AppServer to
invoke RPC.
A:
TVariant Value1;
TVariant Value2;
ITestDisp TestServer = (ITest*)(IDispatch*)SocketConnection1->AppServer;
TestServer.GetValue(&Value1, &Value2);
Unfortunately, Value1 and Value2 remain the same after calling.
B:
TVariant Value1;
TVariant Value2;
TCOMITest TestServer = CoTest::CreateRemote(ServerName);
TestServer.GetValue(&Value1, &Value2);
Value1 and Value2 can be fetched from the server.
A and B are using the same COM object, but the results are different!
2. I can't get 'OleVariant' value return via TVariant even if I using the
method A above.
If I just want to return a String value to the client, I can use BSTR. But
the true is that, I have to return a OleVariant from the server sometimes,
for example, a OleVariant containing a data set.My program work normally in
BCB5, and I've try to write it in Delphi6, it works well too. I am puzzled.
Is it a 'bug' in BCB6? If it is, how can I eliminate it? Such problems have
derived me mad! I've tried to get the answer from Borland branch in our
company. Weeks have gone. I am waiting for your help!
Best regards!
Mountain Lan
Technical Details
Message-ID:
<3d286bdb_2@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!supernews.com!feed.textport.net!news-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!dca6-feed2.news.algx.net!sfo2-feed1.news.algx.net!allegiance!news-out.spamkiller.net!propagator2-la!propagator-la!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnewsShow Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcd2b,70e859c1567fbe60,start X-Google-Attributes: gidfcd2b,public X-Google-ArrivalTime: 2002-07-07 09:32:13 PST Reply-To: "Mountain Lan" <swatow@sina.com> From: "Mountain Lan" <swatow@sina.com> Newsgroups: borland.public.cppbuilder.database.multi-tier Subject: How to return a VARIANT value from remote COM object in BCB6? Date: Mon, 8 Jul 2002 00:26:04 +0800 Lines: 46 Organization: Ideal Tech 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: 61.153.104.4 Message-ID: <3d286bdb_2@dnews> X-Trace: dnews 1026059227 61.153.104.4 (7 Jul 2002 09:27:07 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!sn-xit-01!supernews.com!feed.textport.net!news-out.nuthinbutnews.com!propagator-sterling!news-in.nuthinbutnews.com!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed1.cidera.com!Cidera!dca6-feed2.news.algx.net!sfo2-feed1.news.algx.net!allegiance!news-out.spamkiller.net!propagator2-la!propagator-la!news-in.superfeed.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews