🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.pascal.delphi.misc
Article #132

Re: TBitmap in ActiveX

#132
From: R. Annand
Date: Sat, 13 Jun 1998 00:00
39 lines
2605 bytes
In article <6lrp65$v82$1@nnrp1.dejanews.com>, dalalchirag@my-dejanews.com wrote:
>Hi,

>I got one of my components working as ActiveX component... except for one
>thing. The Delphi component uses TBitmap property. How do I map this property
>into an ActiveX component? The default one-click-ActiveX generated code
>neither includes TBitmap property not TStrings property. Is it because the
>way other ActiveX containers might handle bitmaps differently ?

Was just playing around with the ActiveX stuff today, and it essentially seems 
that for any properties that represent Delphi classes, those classes have to 
have an automation type built for them.  The outside OLE world cannot talk 
directly to a TBitmap or a TStrings, because those are simply not valid OLE 
types.

It's not too too bad, though - the two-project example in the 
Demos\Oleauto\Autoserv directory under Delphi seems to illustrate an easy-ish 
way to do this sort of thing.  It's got the IMemoApp interface, which 
represents the interface to the whole MemoEdit application, but it adds an 
interface into the individual memos (which have an IMemoDoc interface 
implemented for them - you'd have to do something similar for the bitmap or 
strings object,s, unless that sort of work has already been done somewhere in 
Delphi for some of the object types) - it gives a property for the MemoCount, 
and an array property called Memos[] which is of type OleVariant, and the 
Get_Memos returns an IMemoDoc for the memo in question.

Takes a little bit of study, but it shouldn't be too hard to come up with a 
minimalist interface to it (a LoadFromFile for the bitmap would be easy, but 
it might be considerably more difficult to try assigning an actual bitmap 
straight across :)

*smile* I'm a neophyte in the area myself, though - but I was terribly pleased 
to be able to make another small project that can order my big project about 
:)

Hope that helps..

  --=- Ritchie Annand
Technical Details
Message-ID: <358220b9.0@news.cadvision.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <6lrp65$v82$1@nnrp1.dejanews.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10baee,e64a356a1bf20ece
X-Google-Attributes: gid10baee,public
X-Google-Thread: 10a296,e64a356a1bf20ece
X-Google-Attributes: gid10a296,public
From: annandr-at@-cadvision-dot.-com (R. Annand)
Subject: Re: TBitmap in ActiveX
Date: 1998/06/13
Message-ID: <358220b9.0@news.cadvision.com>
X-Deja-AN: 362246514
X-NNTP-Posting-Host: elmo.cadvision.com
References: <6lrp65$v82$1@nnrp1.dejanews.com>
Organization: CADVision Development Corporation (http://www.cadvision.com/)
Newsgroups: comp.lang.pascal.delphi.misc,borland.public.delphi.graphics