Page 1 of 2

ActiveX Property stdole.Picture/stdole.Font

Posted: Thu Jun 06, 2013 3:31 am
by unixkd
Hi all,

I am working on an activex control and need to assign a bitmap object to the stdole.picture property of the activex. Similarly I want to assign a Font object to the stdole.font property of the activex.

Thanks

Joe

Re: ActiveX Property stdole.Picture/stdole.Font

Posted: Thu Jun 06, 2013 6:50 am
by rdonnay
Look at the :getIPicture() and :setIPicture() methods of the XbpBitmap() class.
Look at the :getIFont() and :setIFont() methods of the XbpFont() class.

Re: ActiveX Property stdole.Picture/stdole.Font

Posted: Thu Jun 06, 2013 7:27 am
by unixkd
Hi Roger

Below is the activex I am evaluating, its call Teebo PopupNotify.

Here is my code, NOT working.

FUNCTION PPSNotify()
Local oNotify := ActiveXObject():create( "tssCPopupNotifyDemo.CPopupNotifyDLL" )
Local oFoto := DC_GetBitmap("C:\PPS\MetaLink-Taxi.BMP")
oNotify:AllowAnimation := .t.
oNotify:AutoSize := .t.
oNotify:ShowCloseButton := .t.
oNotify:Picture := oFoto:GetIPicture()
oNotify:TimeOut := -1
//oNotify:Text := "RESIZE DCGUI_RESIZE_RESIZEONLY CLSID cCLSID REGISTER"
oNotify:Show()
Return(oNotify)
*

Re: ActiveX Property stdole.Picture/stdole.Font

Posted: Thu Jun 06, 2013 7:58 am
by rdonnay
Is it just the picture that isn't working?

Does it cause an error?

Re: ActiveX Property stdole.Picture/stdole.Font

Posted: Thu Jun 06, 2013 8:44 am
by unixkd
Thanks Roger.

For now only the picture appear not to be working. For the FONT I use CJ_Font() like oNotify:Font := CJ_Font("26.Arial.Bold") and it works perfectly.

The picture gives error "Type mismatch parameter has a wrong data type"

Re: ActiveX Property stdole.Picture/stdole.Font

Posted: Thu Jun 06, 2013 12:12 pm
by Auge_Ohr
hi,

did you include

Code: Select all

#PRAGMA LIBRARY( "ASCOM10.LIB" )

Re: ActiveX Property stdole.Picture/stdole.Font

Posted: Thu Jun 06, 2013 10:50 pm
by unixkd
Yes I included the "#Pragma ..."

The COM actually initialized properly and working when I comment-out the .picture property.

Has anybody used the :GetIPicture() method for any activex component, and what is the experience like ?

Joe

Re: ActiveX Property stdole.Picture/stdole.Font

Posted: Fri Jun 07, 2013 10:22 am
by Auge_Ohr
unixkd wrote:Has anybody used the :GetIPicture() method for any activex component, and what is the experience like ?
are you using XbpStatusbar() or XbpIcon() ? both include GetIPicture() to work proper.

try other Image ... Size ... Colors ...

btw. did you try Icon/GetIPicture() ?

Re: ActiveX Property stdole.Picture/stdole.Font

Posted: Fri Jun 07, 2013 10:36 am
by unixkd
Hi Jimmy

I am using xbpBitmap, see my code above. I also want to assign a color property. The documentation of the control for FONT, COLOR, and PICTURE are provided as follows:

COLOR
=====

Description

Specifies a color to use for the background

Syntax

object.BackColor1 [ = oColor ]
The syntax of the BackColor1 property has these parts:
Part Description
object - An instance of a PopupNotify object
oColor - An OLE_COLOR value to be used for the caption

Remarks

This specifies the first gradient color when used in gradient modes. When using a solid background, this color is used.
This property has no effect when eBorderStyle is eBorderOfficeXP or eBorderOffice2003.

FONT
====
Description

Specifies a font to use when drawing the text

Syntax

object.Font [ = oFnt ]
The syntax of the Font property has these parts:

Part Description
object - An instance of a PopupNotify object
oFnt - A StdFont object to use as the new font

PICTURE
======
Description

Specifies the picture used in the popup notification.

Syntax

object.Picture [ = oPic ]

The syntax of the Picture property has these parts:
Part Description
object - An instance of a PopupNotify object
oPic - A StdPicture object


Remarks

If oPic is equal to Nothing, no image will be visible in the popup notification. If eBorderStyle is eBorderPhoto, the picture will be resized to fill the content area.

FONT works well but PICTURE and COLOR not working.

Re: ActiveX Property stdole.Picture/stdole.Font

Posted: Fri Jun 07, 2013 11:23 am
by Auge_Ohr
unixkd wrote:FONT works well but PICTURE and COLOR not working.
Xbase++ "translate" FONT right ;)

COLOR : did you try AutomationTranslateColor() for OLE_Color

PICTURE : hm ... it might mean "Handle" of Image ?

you can try to use

Code: Select all

STATIC DLLFUNCTION LoadImageA( hMod, nId, uType, nX, nY, fuLoad )                 ;
       USING STDCALL                                                              ;
       FROM  USER32.DLL
to get "Handle" of Image

or use XbpBitmap() PDR 6009 Workaround and GetHandle() -> "Handle"
http://www.alaska-software.com/scripts/ ... PDRID=6009