ActiveX Property stdole.Picture/stdole.Font

This forum is for eXpress++ general support.
Message
Author
User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

ActiveX Property stdole.Picture/stdole.Font

#1 Post 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

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: ActiveX Property stdole.Picture/stdole.Font

#2 Post by rdonnay »

Look at the :getIPicture() and :setIPicture() methods of the XbpBitmap() class.
Look at the :getIFont() and :setIFont() methods of the XbpFont() class.
The eXpress train is coming - and it has more cars.

User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Re: ActiveX Property stdole.Picture/stdole.Font

#3 Post 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)
*

User avatar
rdonnay
Site Admin
Posts: 4733
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: ActiveX Property stdole.Picture/stdole.Font

#4 Post by rdonnay »

Is it just the picture that isn't working?

Does it cause an error?
The eXpress train is coming - and it has more cars.

User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Re: ActiveX Property stdole.Picture/stdole.Font

#5 Post 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"

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: ActiveX Property stdole.Picture/stdole.Font

#6 Post by Auge_Ohr »

hi,

did you include

Code: Select all

#PRAGMA LIBRARY( "ASCOM10.LIB" )
greetings by OHR
Jimmy

User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Re: ActiveX Property stdole.Picture/stdole.Font

#7 Post 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

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: ActiveX Property stdole.Picture/stdole.Font

#8 Post 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() ?
greetings by OHR
Jimmy

User avatar
unixkd
Posts: 565
Joined: Thu Feb 11, 2010 1:39 pm

Re: ActiveX Property stdole.Picture/stdole.Font

#9 Post 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.

User avatar
Auge_Ohr
Posts: 1407
Joined: Wed Feb 24, 2010 3:44 pm

Re: ActiveX Property stdole.Picture/stdole.Font

#10 Post 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
greetings by OHR
Jimmy

Post Reply