Alaska Software Inc. - :hide() / :show() Error with activeX ?
Username: Password:
AuthorTopic: :hide() / :show() Error with activeX ?
AUGE_OHR:hide() / :show() Error with activeX ?
on Sun, 29 Aug 2010 16:24:43 +0200
hi,
i do not understand this Error :

FEHLERPROTOKOLL von "D:\ALASKA\SPLIT\1\BUGDEMO.EXE" Datum: 29.08.10 16:05:13
Xbase++ Version     : Xbase++ (R) Version 1.90.355
Betriebssystem      : Windows XP 05.01 Build 02600 Service Pack 3
------------------------------------------------------------------------------
oError:args         :
oError:canDefault   : J
oError:canRetry     : N
oError:canSubstitute: J
oError:cargo        : NIL
oError:description  : Component is no ActiveX control
oError:filename     : NIL
oError:genCode      :       6502
oError:operation    : XBPACTIVEXCONTROL:CREATEHANDLE
oError:osCode       : NIL
oError:severity     :          2
oError:subCode      :       6500
oError:subSystem    : Automation
oError:thread       :          2
oError:tries        : NIL
------------------------------------------------------------------------------
CALLSTACK:
------------------------------------------------------------------------------
(EVM Ereignis-Dispatcher)

attached the full running Demo, NEED MsComCtl.OCX !!!

greetungs by OHR
Jimmy

*** Code ***

#include "Xbp.ch"
#include "Appevent.ch"
#include "GRA.ch"

#PRAGMA LIBRARY( "ASCOM10.LIB" )

PROCEDURE AppSys()
RETURN

PROCEDURE Main
LOCAL nEvent, mp1, mp2
LOCAL oApp, oXbp, drawingArea
LOCAL oStat
LOCAL oView
LOCAL lOnOff := .T.

   oApp := XbpDialog():New(AppDeskTop(), , {0,0}, {600,400}, , .F.)
   oApp:taskList     := .T.
   oApp:title        := "Demo"
*   oApp:ClipChildren := .T.
*   oApp:DrawingArea:ClipChildren := .T.
   oApp:create()

   drawingArea := oApp:drawingArea
   drawingArea:setFontCompoundName( "10.Arial" )
   drawingArea:setcolorBG(GRA_CLR_WHITE)

   oStat := XbpStatic():New( drawingArea,,{0,0},drawingArea:currentsize()  )
   oStat:Caption := "bitte warten ..."
   oStat:options := XBPSTATIC_TEXT_CENTER+XBPSTATIC_TEXT_VCENTER
   oStat:create()
   oStat:setFontCompoundName( "24.Arial" )
   oStat:setcolorFG(GRA_CLR_RED)
   oStat:setcolorBG(GRA_CLR_WHITE)

   oView := XbpListView():new( oStat,,{0,0},oStat:currentsize(),,.F. )
   oView:create()
   oView:setFontCompoundName( "10.Arial" )
   oView:setcolorFG(GRA_CLR_BLACK)
   oView:setcolorBG(GRA_CLR_WHITE)

   oView:view := 3        lvwReport
   AddHeaders(oView)

   oApp:show()
   oView:show()           here it work

   
    wait to "see" that all is ok
   
   SLEEP(100*3)

   nEvent := xbe_None
   DO WHILE nEvent <> xbeP_Close
      nEvent := AppEvent( @mp1, @mp2, @oXbp,100 )
      DO CASE
         CASE nEvent = xbe_None
            IF lOnOff == .T.
               lOnOff := .F.
               oView:hide()
            ELSE
               lOnOff := .T.
               msgbox("why now Error activeX ?!")
               oView:show()
            ENDIF
      OTHERWISE
         oXbp:handleEvent( nEvent, mp1, mp2 )
      ENDCASE
   ENDDO

RETURN


#define lvwColumnLeft   0
#define lvwColumnRight  1

Procedure AddHeaders(oView)
/*************************************************************************

Index       An integer that uniquely identifies a member of an object 
collection.
Key         A unique string expression that can be used to access a member 
of the collection.
Text        The text to display in the column header.
Width       The initial width of the column header.
Alignment   An integer that determines the alignment of text in the column 
header.
Icon        The index value of the image to display in the column header.

*************************************************************************/
LOCAL oHeader

   oHeader := oView:ColumnHeaders:Add(,,'Name',150,lvwColumnLeft ,)  ; 
AADD(oView:aHeader,oHeader)
   oHeader := oView:ColumnHeaders:Add(,,'Size',100,lvwColumnRight,)  ; 
AADD(oView:aHeader,oHeader)
   oHeader := oView:ColumnHeaders:Add(,,'Date', 56,lvwColumnLeft ,)  ; 
AADD(oView:aHeader,oHeader)
   oHeader := oView:ColumnHeaders:Add(,,'Time', 56,lvwColumnLeft ,)  ; 
AADD(oView:aHeader,oHeader)
   oHeader := oView:ColumnHeaders:Add(,,'A'   , 20,lvwColumnLeft ,)  ; 
AADD(oView:aHeader,oHeader)

RETURN

CLASS XbpListView FROM XbpActiveXControl
   EXPORTED:
      METHOD init
      METHOD create

ENDCLASS

METHOD XbpListView:init( oParent, oOwner, aPos, aSize, aPP, lVisible )

   ::XbpActiveXControl:Init( oParent, oOwner, aPos, aSize, aPP, lVisible )

*  ::CLSID   := "{BDD1F04B-858B-11D1-B16A-00C0F0283628}"
   ::CLSID   := "MSComctlLib.ListViewCtrl.2"
   ::License := "9368265E-85FE-11d1-8BE3-0000F8754DA1"

   ::TabStop := .T.
RETURN self

METHOD XbpListView:create( oParent, oOwner, aPos, aSize, aPP, lVisible )
   ::XbpActiveXControl:Create(oParent,oOwner,aPos,aSize,aPP,lVisible )
RETURN self

**** Eof ***
Andreas Gehrs-Pahl
Re: :hide() / :show() Error with activeX ?
on Mon, 30 Aug 2010 16:40:37 -0400
Jimmy,

>oError:operation: XBPACTIVEXCONTROL:CREATEHANDLE

I have struggled with this, too. The solution is to use the undocumented
iVar "ReCreateHandle" before creating the Active-X object. I would also
explicitly set "UserEvents" and "UseGuiThread". So, with those three
instance variables set in your code before oView:Create(), the program
will works as expected.

oView := XbpListView():New(oStat, , {0, 0}, oStat:CurrentSize(), , .f.)
oView:UserEvents     := .t.
oView:UseGuiThread   := .f.
oView:ReCreateHandle := .f.
oView:Create()

Hope that helps.

Andreas

Andreas Gehrs-Pahl
EJustice OnSite Product Manager
EJustice Solutions, LLC

phone: (989) 723-9927
web:   http://www.EJusticeSolutions.com/EJS_OnSite/
email: Andreas_Gehrs-Pahl@EJusticeSolutions.com
       Andreas@DDPSoftware.com
       GPahl@CharterMI.net
AUGE_OHRRe: :hide() / :show() Error with activeX ?
on Mon, 30 Aug 2010 23:00:57 +0200
hi,

> I have struggled with this, too. The solution is to use the undocumented
> iVar "ReCreateHandle" before creating the Active-X object. I would also
> explicitly set "UserEvents" and "UseGuiThread". So, with those three
> instance variables set in your code before oView:Create(), the program
> will works as expected.
>
> oView := XbpListView():New(oStat, , {0, 0}, oStat:CurrentSize(), , .f.)
> oView:UserEvents     := .t.
> oView:UseGuiThread   := .f.
> oView:ReCreateHandle := .f.
> oView:Create()
>
> Hope that helps.

Wow !!! Yes it do.

"undocumented" iVar "ReCreateHandle" ... please Alaska do documented it.

greetings by OHR
Jimmy
Peter AlderliestenRe: :hide() / :show() Error with activeX ?
on Fri, 08 Oct 2010 14:00:27 +0200
Jimmy,

> "undocumented" iVar "ReCreateHandle" ... please Alaska do documented it.

I suppose it's undocumented because Alaska thinks this has to be fixed some
time. Better ask for a version that does not need this undocumented
variable.

Peter