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 Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating and SCX outside the form designer

Status
Not open for further replies.

cj001

Programmer
Oct 3, 2001
145
US
Hello

How do I do this?

I now understand how to create a UNIQUEID.
I have a table that has the PLATFORM, UNIQUEID, etc....
I looks the same as one created with the form designer.
I rename it to scx and the sct extensions.


But when I DO FORM it receive the following error:
"Error loading file - record number 4. text1<or one of its members>.Parent : Object class is invalid for this container"


What am I doing wrong?


Thanks!
CJ
 
cj001

I wonder what you trying to achieve. Why bother trying to recreate what VFP goes trough to give you a visual tool to create a form? If you really want to code something, use code.
Code:
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
DEFINE CLASS form1 AS form
	DoCreate = .T.
	Caption = "Form1"
	Name = "Form1"
	ADD OBJECT command1 AS commandbutton WITH ;
		Top = 36, ;
		Left = 36, ;
		Height = 27, ;
		Width = 84, ;
		Caption = "Command1", ;
		Name = "Command1"
	ADD OBJECT text1 AS textbox WITH ;
		Height = 23, ;
		Left = 192, ;
		Top = 36, ;
		Width = 100, ;
		Name = "Text1"
	ADD OBJECT combo1 AS combobox WITH ;
		Height = 24, ;
		Left = 96, ;
		Top = 108, ;
		Width = 100, ;
		Name = "Combo1"
ENDDEFINE





Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
Mike Gagnon,

Thanks for the code and I agree that using the designer is better way to go. That's why I'm trying to do what I did.

I want to save time in recreating over 1,500 prgs written with a 4th gl (using foxpro as the generator) that need to be come SCX files. I have all the information about the fields, databases and objects that appear on each form.

So by creating the SCX files outside the designer I could have a program that creates the bunch of them and then go in to the designer and make changes and what ever else needs to be done.

How do I do what I would like to do? Is it possible?

CJ
 

How do I do what I would like to do? Is it possible?

As far as I know there no utility to do what you need. I'm not sure if creating a table with the right structure would give you an actual working form. Normally a translation from one platform to another is a lot less headache by using the 'total rewrite' approach rather than trying to "cut corners". I would think that if such tool existed (It may, as I said I cannot think of one), it would be widely available. I'm not sure with your technique how you would incorporate methods etc...


Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
I believe that if you created the .PRG files like above, that the UT ( has a way to convert the .PRG to a .SCX. I'm not sure if there is code available - it's been a long time since I looked at this. Note: It may actually be .PRG to .VCX, but this is (virtually) the same as a .SCX!

Rick
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top