Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #6996 > unrolled thread

Strange problem with export variable in ShellWindow

Started byGeorge Tritsos <GeorgeTritsos@yahoo.gr>
First post2014-06-24 14:09 -0700
Last post2014-06-25 11:30 +0200
Articles 8 — 4 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Strange problem with export variable in ShellWindow George Tritsos <GeorgeTritsos@yahoo.gr> - 2014-06-24 14:09 -0700
    Re: Strange problem with export variable in ShellWindow Carlos Rocha <FreeTheMusic@ascap.com> - 2014-06-25 00:01 +0100
      Re: Strange problem with export variable in ShellWindow George Tritsos <GeorgeTritsos@yahoo.gr> - 2014-06-24 22:03 -0700
        Re: Strange problem with export variable in ShellWindow Carlos Rocha <FreeTheMusic@ascap.com> - 2014-06-25 15:13 +0100
          Re: Strange problem with export variable in ShellWindow George Tritsos <GeorgeTritsos@yahoo.gr> - 2014-06-25 09:51 -0700
            Re: Strange problem with export variable in ShellWindow Carlos Rocha <FreeTheMusic@ascap.com> - 2014-06-25 18:55 +0100
      Re: Strange problem with export variable in ShellWindow Malcolm G <malcolm-news2012delete@delete.jobstream.com> - 2014-06-25 09:28 +0100
        Re: Strange problem with export variable in ShellWindow Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2014-06-25 11:30 +0200

#6996 — Strange problem with export variable in ShellWindow

FromGeorge Tritsos <GeorgeTritsos@yahoo.gr>
Date2014-06-24 14:09 -0700
SubjectStrange problem with export variable in ShellWindow
Message-ID<47e62f60-27f6-4915-a649-ed19d356f311@googlegroups.com>
I take the follow error for no exported variable. The variable oCB is exported.
Thanks in advance
George

Little code:
METHOD Start() CLASS App
	LOCAL oMainWindow AS WTameio
	oMainWindow := WTameio{SELF}
	oMainWindow:Show(SHOWZOOMED)
	SELF:Exec()

METHOD MenuCommand(oMenuCommandEvent) CLASS WTameio
	SUPER:MenuCommand(oMenuCommandEvent)
	//Put your changes here
	IF oMenuCommandEvent:HyperLabel:Caption == "ÁíáæÞôçóç"
		SELF:Find()
	ENDIF
	RETURN NIL
METHOD PostInit(oParent,uExtra) CLASS WTameio
	LOCAL oMenu	AS menu
	LOCAL Epil	AS INT
	oMenu:=WTMenu2{}
	Epil:=2
	SELF:ShellWithCentredBitMap("tameiako")
	SELF:MakeSearch(Epil,oMenu)
	RETURN NIL

CLASS WTameio INHERIT SHELLWINDOW
  EXPORT oCB	AS SearchLineEdit
METHOD Init(oParent,uExtra) CLASS WTameio 
SELF:PreInit(oParent,uExtra)
SUPER:Init(oParent,uExtra)
SELF:Caption := ""
SELF:Icon := AASIMA{}
SELF:IconSm := AASIMA{}
SELF:HyperLabel := HyperLabel{#WTameio,NULL_STRING,NULL_STRING,NULL_STRING}
SELF:Origin := Point{13, 433}
SELF:Size := Dimension{648, 300}
SELF:PostInit(oParent,uExtra)
RETURN SELF

METHOD Find() CLASS WTameio
	LOCAL cSearch
	cSearch:=SELF:Owner:oCB:TextValue /// Here i take the error.
METHOD MakeSearch(nEpil,oWMenu) CLASS Wtameio
	LOCAL oTB	AS ToolBar
	SELF:Menu:=oWMenu
	IF nEpil==1
		oTB:=SELF:ToolBar
		oCB := SearchLineEdit{SELF:Toolbar, 4711, Point{255, 4},Dimension{40,20} }
		oTB:AddBand(#FFind, oCB, -1, 121, 25,"ÁíáæÞôçóç:")
		oTB:AppendSubItem(IDT_FIND,IDT_FIND,IDM_WTmenu1_ÂïÞèåéá_ÁíáæÞôçóç_ID,,,,,,,#FFind)
		oTB:AddSubToolBarBand(#Find,, 25)
		oTB:AppendSubItem(#Find,IDT_FIND,IDM_WTmenu1_ÂïÞèåéá_ÁíáæÞôçóç_ID)
		oTB:AddTipText(IDT_FIND,IDM_WTmenu1_ÂïÞèåéá_ÁíáæÞôçóç_ID,"ÁíáæÞôçóç")
	ELSEIF nEpil==2
		oTB:=SELF:ToolBar
		oCB := SearchLineEdit{SELF:Toolbar, 4711, Point{255, 4},Dimension{40,20} }
		oTB:AddBand(#FFind, oCB, -1, 121, 25,"ÁíáæÞôçóç:")
		oTB:AppendSubItem(IDT_FIND,IDT_FIND,IDM_WTMenu2_ÂïÞèåéá_ÁíáæÞôçóç_ID,,,,,,,#FFind)
		oTB:AddSubToolBarBand(#Find,, 25)
		oTB:AppendSubItem(#Find,IDT_FIND,IDM_WTMenu2_ÂïÞèåéá_ÁíáæÞôçóç_ID)
		oTB:AddTipText(IDT_FIND,IDM_WTMenu2_ÂïÞèåéá_ÁíáæÞôçóç_ID,"ÁíáæÞôçóç")
	ENDIF
RETURN NIL
CLASS SearchLineEdit INHERIT SingleLineEdit
METHOD Init(oOwner, xID, oPoint, oDimension, kStyle) CLASS SearchLineEdit
 SUPER:Init( oOwner, xID, oPoint, oDimension, kStyle)
 SELF:OverRide()
METHOD ShellWithGradient(cString) CLASS Wtameio

	LOCAL hWnd AS PTR
	
	IF IsNil( cString )
		cString := ""
	ENDIF

	hWnd := SELF:Handle(4)
	
	// Set up the replacement WndProc for the shell
	SubClassWindow(  hWnd, @MdiClientWinProc() )

	// Send the following message to set up the MdiClientWndProc
	SendMessage( hWnd, WM_USER + 1, 0, LONG( _CAST, cString))  //String2Psz( cString ) ) )

	// If they choose, repaint it
	InvalidateRect( hWnd, NULL_PTR, TRUE )

RETURN( SELF )

Error Message:
--------------
SubSystem: BASE
Operation: 
Function: IVARGET
Argument: OCB
CallStack:
WTAMEIO:FIND (Line:4)
WTAMEIO:MENUCOMMAND (Line:5)
APP:START (Line:8)

Error Object created:
--------------------
SubSystem       :BASE
SubCode         :         0
GenCode         :No exported variable
OsCode          :         0
Severity        :         0
CanDefault      :.F.
CanRetry        :.F.
CanSubstitute   :.T.
Operation       :
Description     :
FileName        :
Tries           :         0
FuncSym         :IVARGET
FileHandle      :         0
ArgNum          :         0
FuncPtr         :0x00000000
SubCodeText     :
Arg             :OCB
ArgType         :NIL
ArgTypeReq      :NIL
MaxSize         :         0
SubstituteType  :NIL
CallFuncSym     :
--------------------

[toc] | [next] | [standalone]


#6997

FromCarlos Rocha <FreeTheMusic@ascap.com>
Date2014-06-25 00:01 +0100
Message-ID<lod000$771$1@news.albasani.net>
In reply to#6996
>
> CLASS WTameio INHERIT SHELLWINDOW
>   EXPORT oCB	AS SearchLineEdit

>
> METHOD Find() CLASS WTameio
> 	LOCAL cSearch
> 	cSearch:=SELF:Owner:oCB:TextValue /// Here i take the error.

It's not SELF:Owner:oCB, it's SELF:oCB

-- 
Carlos Rocha

---
Este email está livre de vírus e malware porque a proteção avast! Antivirus está ativa.
http://www.avast.com

[toc] | [prev] | [next] | [standalone]


#6998

FromGeorge Tritsos <GeorgeTritsos@yahoo.gr>
Date2014-06-24 22:03 -0700
Message-ID<3cec2218-0330-4382-b216-9c4fcce59129@googlegroups.com>
In reply to#6997
Hi Carlos

   Look in METHOD SearchMake
oTB:=SELF:ToolBar 
oCB := SearchLineEdit{SELF:Toolbar, 4711, Point{255, 4},Dimension{40,20} } 
oTB:AddBand(#FFind, oCB, -1, 121, 25,"ÁíáæÞôçóç:")            oTB:AppendSubItem(IDT_FIND,IDT_FIND,IDM_WTMenu2_ÂïÞèåéá_ÁíáæÞôçóç_ID,,,,,,,#FFind) 
oTB:AddSubToolBarBand(#Find,, 25) 
oTB:AppendSubItem(#Find,IDT_FIND,IDM_WTMenu2_ÂïÞèåéá_ÁíáæÞôçóç_ID)             oTB:AddTipText(IDT_FIND,IDM_WTMenu2_ÂïÞèåéá_ÁíáæÞôçóç_ID,"ÁíáæÞôçóç")

George

[toc] | [prev] | [next] | [standalone]


#7001

FromCarlos Rocha <FreeTheMusic@ascap.com>
Date2014-06-25 15:13 +0100
Message-ID<loelep$kfh$1@news.albasani.net>
In reply to#6998
I don't know what you want me to see.
oCB is a property of WTameio, not his owner (App). SELF:Owner 
translates into App, and App:oCB doesn't exist, so the error.

>
>    Look in METHOD SearchMake
> oTB:=SELF:ToolBar 
> oCB := SearchLineEdit{SELF:Toolbar, 4711, Point{255, 4},Dimension{40,20} } 
> oTB:AddBand(#FFind, oCB, -1, 121, 25,"ÁíáæÞôçóç:")            
> oTB:AppendSubItem(IDT_FIND,IDT_FIND,IDM_WTMenu2_ÂïÞèåéá_ÁíáæÞôçóç_ID,,,,,,,#FFind) 
>  oTB:AddSubToolBarBand(#Find,, 25)  
> oTB:AppendSubItem(#Find,IDT_FIND,IDM_WTMenu2_ÂïÞèåéá_ÁíáæÞôçóç_ID)            
>  oTB:AddTipText(IDT_FIND,IDM_WTMenu2_ÂïÞèåéá_ÁíáæÞôçóç_ID,"ÁíáæÞôçóç")
>
> George

-- 
Carlos Rocha

---
Este email está livre de vírus e malware porque a proteção avast! Antivirus está ativa.
http://www.avast.com

[toc] | [prev] | [next] | [standalone]


#7002

FromGeorge Tritsos <GeorgeTritsos@yahoo.gr>
Date2014-06-25 09:51 -0700
Message-ID<263a38af-f421-4857-8bc6-fc9127115137@googlegroups.com>
In reply to#7001
Carlos,
In the VOPAD sample there is the same techique without problem. The only different is oCB as ComboBoxEX.

George

From VOPAD:
METHOD Start() CLASS App
	LOCAL oMainWindow AS PadShellWindow
  LOCAL cParam AS STRING
	LOCAL nStart AS INT
	
  cParam := _GetCmdLine()
	nStart := At(" ", Trim(cParam))
	oMainWindow := PadShellWindow{SELF}
	
	IF nStart != 0
		oMainWindow:NewEditWindow(SubStr(cParam, nStart + 1))
	ELSE	
		oMainWindow:FileNew()
	ENDIF	

	oMainWindow:Show(SHOWCENTERED)
	SELF:Exec()
CLASS SearchBox INHERIT ComboBoxEx
	PROTECT	oOwnerWindow	AS  OBJECT
 	PROTECT aHistory		AS ARRAY	
	PROTECT dwLastMessage	AS DWORD

METHOD Dispatch(e) CLASS SearchBox
	
   IF e:uMSg == wM_KEYDOWN .or.  e:uMSg == wM_KEYUP
   	Tone(440,2)
   ELSEIF e:uMSg == wM_CHAR
   	Tone(440,12)
   ENDIF	
	 RETURN SUPER:Dispatch(e)
METHOD Init(oOW, oOwner, xID, oPoint, oDimension, kComboType, kStyle) CLASS SearchBox
	SUPER:Init( oOwner, xID, oPoint, oDimension, kComboType, kStyle)
	oOwnerWindow := oOW
CLASS PadShellWindow INHERIT ShellWindow
	EXPORT aChildWindows AS ARRAY
	EXPORT cFName AS STRING	
	EXPORT oCB AS ComboBoxEx  //SearchBox
METHOD Init( oOwnerApp ) CLASS PadShellWindow
	LOCAL oSB AS StatusBar
	LOCAL oTB AS ToolBar
	
	SUPER:Init( oOwnerApp )
	
  SELF:EnableDragDropClient()

	oSB := SELF:EnableStatusBar()
	oSB:DisplayTime()

	SELF:Icon 	:= Icon{ResourceID{IDI_VOPADICON, _GetInst()}}
	SELF:IconSm := Icon{ResourceID{IDI_VOPADICON, _GetInst()}}
	
	SELF:Caption := "VOPad"


	SELF:Menu := StandardPadMenu{SELF}
	
	oTB := SELF:ToolBar	
	
 	oCB := SearchBox{SELF, SELF:Toolbar, 4711, Point{0, 0}, Dimension{50,152}, BOXDROPDOWN	}
 	oTB:AddBand(#FFIND, oCB, -1, 150, 25,"Search")
  oTB:AppendSubItem(IDT_FIND,IDM_StandardPadMenu_Edit_Find_ID,,,,,,,#FFIND)					
	
	oTB:AddSubToolBarBand(#Find, , 50)
	oTB:AppendSubItem(#Find,IDT_FIND,IDM_StandardPadMenu_Edit_Find_ID)
	oTB:AddTipText(IDT_FIND,IDM_StandardPadMenu_Edit_Find_ID,"Find")
	oTB:AppendSubItem(#Find,IDT_NEXTREC,IDM_StandardPadMenu_Edit_Find_Next_ID)
	oTB:AddTipText(IDT_NEXTREC,IDM_StandardPadMenu_Edit_Find_Next_ID,"Find Next")

	RETURN SELF

[toc] | [prev] | [next] | [standalone]


#7003

FromCarlos Rocha <FreeTheMusic@ascap.com>
Date2014-06-25 18:55 +0100
Message-ID<lof2en$ig5$1@news.albasani.net>
In reply to#7002
George,

You didn't post the Find() method. If VOPAD calls SELF:Owner:oCB it 
doesn't work either. I'm pretty sure it doesn't, tho.

-- 
Carlos Rocha

---
Este email está livre de vírus e malware porque a proteção avast! Antivirus está ativa.
http://www.avast.com

[toc] | [prev] | [next] | [standalone]


#6999

FromMalcolm G <malcolm-news2012delete@delete.jobstream.com>
Date2014-06-25 09:28 +0100
Message-ID<UKvqv.87498$7q3.68151@fx12.am4>
In reply to#6997
On 25/06/2014 00:01, Carlos Rocha wrote:
>>
>> CLASS WTameio INHERIT SHELLWINDOW
>>   EXPORT oCB	AS SearchLineEdit
> 
>>
>> METHOD Find() CLASS WTameio
>> 	LOCAL cSearch
>> 	cSearch:=SELF:Owner:oCB:TextValue /// Here i take the error.
> 
> It's not SELF:Owner:oCB, it's SELF:oCB
> 

Agreed -  self owner will be the app object I think.

[toc] | [prev] | [next] | [standalone]


#7000

FromKarl Faller <mail_withoutthat_@_drei-f_andthat_.de>
Date2014-06-25 11:30 +0200
Message-ID<gj5lq95iulum7vgg14hjbs4upl39quishu@4ax.com>
In reply to#6999
Malcolm,
>Agreed -  self owner will be the app object I think.
yes - interesting, i had a look and saw i never ever gave the Shell an
owner, possibly it gets filled in behind the scene, if not explicit
given (as i never saw a problem from this)...

Karl

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web