Article View: borland.public.cppbuilder.database.multi-tier
Article #404Help! About VARIANT and ADO/COM+ in C++ Builder 6
From: Mountain Lan
Date: Sat, 01 Jun 2002 11:54
Date: Sat, 01 Jun 2002 11:54
36 lines
2594 bytes
2594 bytes
Hello, everyone! I am migrating my program from C++ Builder 5 to version 6. The platform is ADO/COM+. Problem about VARIANT puzzles me. I tried to create a simple server program. I created a ActiveX Library, and then a Transaction Data Module, and then compiled then program, it's Ok. But when any ADO component was added into the data module, the compiler reported an error 'Ambiguity between 'ITransaction' and 'OleDb::ITransaction'. Actually it's a conflict between header files. I had to modified the header file 'comsvcs.h' shipped with C++ Builder, insert '::' prior ITransaction declaration, and then I could compile it. But, another problem emerge, the results of codes below were different! A: Variant v = "abc"; B: Variant A; v = "abc"; Value of variable v in form A was empty, while value in form B were 'abc'. What's wrong?! Maybe I shouldn't modify the source file shipped by the manufacturer. But how can I use ADO and COM+ at the same time?! Another problem is, I am using *VARIANT in type library method to return value to client. In C++ Builder 5, VARIANT in type library is converted to TVariant in the codes generated automatically. While in C++Builder 6, it's converted to VARIANT instead. I found that the server couldn't receive the value sent by the client in parameter *VARIANT, and the value modified by the server can't be got by the client. I set the parameter to be 'in/out' in the type library. My program works smoothly in C++ Builder 6. What's wrong in it? Any comment from you are appreciated! Thanks! Mountain
Technical Details
Message-ID:
<3cf8b620_1@dnews>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!telocity-west!TELOCITY!news-out.spamkiller.net!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!news02.tsnz.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,120e10f931d941ac,start X-Google-Attributes: gidfcd2b,public X-Google-ArrivalTime: 2002-06-01 05:24:03 PST Reply-To: "Mountain Lan" <swatow@sina.com> From: "Mountain Lan" <swatow@sina.com> Newsgroups: borland.public.cppbuilder.database.multi-tier Subject: Help! About VARIANT and ADO/COM+ in C++ Builder 6 Date: Sat, 1 Jun 2002 19:54:54 +0800 Lines: 38 Organization: Ideal Tech X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.50.4522.1200 X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4522.1200 NNTP-Posting-Host: 61.174.49.25 Message-ID: <3cf8b620_1@dnews> X-Trace: dnews 1022932512 61.174.49.25 (1 Jun 2002 04:55:12 -0700) Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-01!sn-xit-04!supernews.com!telocity-west!TELOCITY!news-out.spamkiller.net!propagator2-maxim!propagator-maxim!news-in.spamkiller.net!news02.tsnz.net!newsfeed01.tsnz.net!newsfeeds.ihug.co.nz!ihug.co.nz!dnews