Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VFP6 - removing classes

Status
Not open for further replies.

eric43

Programmer
Apr 29, 2005
94
AU
I have the following form I use to show locations from a database use My problem is that the form 'hangs around' and shows as an outline when I go back for the next person.
How do I kill it please?

Code:
PARAMETERS   line1,line2,line3,line4,line5

lAddr2 = line1
lAddr3 = line2
lState = line3
lPc = line4
lDB = line5


PUBLIC oForm
oForm = CreateObject("mapclass")
oForm.show

DEFINE CLASS mapclass AS form

	Height = 573
	Width = 741
	DoCreate = .T.
	Name = "form"
	ControlBox = .f.
	Caption = "Map form"

*!*	label_cmdG006
	ADD OBJECT cmdexit AS commandbutton WITH ;
		
		Name = "cmdExit"

	ADD OBJECT oweb AS olecontrol WITH ;
		
		Name = "oWeb", ;
		OleClass = "Shell.Explorer.2"



	ADD OBJECT cmdfind AS commandbutton WITH ;
		
		Name = "cmdFind"

	ADD OBJECT label4 AS label WITH ;
		
		Name = "Label4"


	PROCEDURE Load
	SYS(2333,1)

ENDPROC

	PROCEDURE Init
	thisform.label4.CAPTION = my lines

ENDPROC

	PROCEDURE cmdexit.Click

	USE IN SELECT("MyCursor")

	CLEAR CLASS mapclass 

	thisform.Release()

ENDPROC


	PROCEDURE cmdfind.Click
	PUBLIC  lcURL
	LOCAL lcStartPostCode
	lcURL=""
	lcURL = "[URL unfurl="true"]http://www.multimap.com/map/places.cgi?client=public"[/URL]
	NB  - my locAtion variables here
	lcURL = lcURL + mylocationvariables
	this.Parent.label4.CAPTION = lcURL


	this.Parent.oweb.Navigate(lcURL)
ENDPROC


ENDDEFINE

Anyone have any ideas how to kill the form completely?

Thanks

Eric
 
I'd get rid of the CLEAR CLASS command in the Click method. Other than that, I don't see anything.

Tamar
 
Hi Tamar

WellI put that line in to try and get rid of it!
Thanks.

Eric
 
I can be more specific I think - it appears that it is the frame created by ADD OBJECT oweb AS olecontrol that is not being destroyed by the form.release method.

Any more ideas anyone - this is killing the use of mapping in the app.

Thanks Eric
 

Eric,

My first thought would be to put REMOVEOBJECT(oWeb) in the form's Destroy. But I don't understand why you would need to do that.

Another possibility -- a bit of a long shot -- is to put SYS(2333,0) in the Destroy.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My Visual FoxPro site: www.ml-consult.co.uk
 
Thanks Mike - I find this is prolly related to the other problem I mentioned - the 'invisible' form in the debugger.

I moved the map functionality to another form coming from earlier in the steps of the app and the problem appears to have gone away.

Seems VFP couldn't see the first form thus couldn't release the second.

C'est la vie.

Regards

Eric
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top