Home > Archive > FoxPro Setup > April 2005 > MS VFP Framework Startup Problems









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author MS VFP Framework Startup Problems
Mike Shull

2005-04-18, 3:24 am

All I want to do is run a few lines of code at startup and I'm getting all
kinds of grief from VFP8.

I'm writing an app (HouseCallCID is the app) and I want it to creat a few
public objects, set some public variables, etc.

I'm using the VFP8 app wizard to create the folders, etc. It creates a
main app called housecallcid_app which does some stuff I can't seem to wrap
my brain around without reading tons of pre-generated source code.

Here's the question:

Where can I run my startup() procedure that sets up all my variables, etc.

When I get it to work by putting it in the init() of the application
object, I get "goapp is not an object" when I shut down.

I get various errors when I try to put it in the housecallcid_app program
depending on where I put it.

This shouldn't be this hard. The one thing that MS sorely fails in is
documenting their included objects, etc. (especially the framework it
comes with).

Is there a site somewhere that can give me a better understanding than
msdn.microsoft.com (sux 4 framework)?

--Mike Shull
Dummy Newgroup name

2005-04-18, 7:24 am

In fact "MS 'framework' sux".

The great thing about frameworks is that they do a lot for you. The
not so great other side of the coin is that you need to learn
something else, ie how they work.

If you're getting "goApp is not an object" you've inserted your call
before it's being created. One of the things to knowing where things
happen is that you've got to put in a lot of "DoDefault", certainly
into the app init, and (usually) put your own code afterwards.

I'm sorry, I gave up using the (MS) app builder too long ago to be
able to remember what's where, have a poke around to find out where
it's happening. Not very helpful I know 8-(

Regards
Mark

Mike Pratt

2005-04-18, 11:24 am

Hi Mike,

Any variable created in the init that aren't declared public are
destroyed when the init finishes. Create goapp in the main.prg that
loads the main form.

Regards,

Mike

On Mon, 18 Apr 2005 02:16:59 -0000, Mike Shull <mike.shull@gmail.com>
wrote:

>All I want to do is run a few lines of code at startup and I'm getting all
>kinds of grief from VFP8.
>
>I'm writing an app (HouseCallCID is the app) and I want it to creat a few
>public objects, set some public variables, etc.
>
>I'm using the VFP8 app wizard to create the folders, etc. It creates a
>main app called housecallcid_app which does some stuff I can't seem to wrap
>my brain around without reading tons of pre-generated source code.
>
>Here's the question:
>
>Where can I run my startup() procedure that sets up all my variables, etc.
>
>When I get it to work by putting it in the init() of the application
>object, I get "goapp is not an object" when I shut down.
>
>I get various errors when I try to put it in the housecallcid_app program
>depending on where I put it.
>
>This shouldn't be this hard. The one thing that MS sorely fails in is
>documenting their included objects, etc. (especially the framework it
>comes with).
>
>Is there a site somewhere that can give me a better understanding than
>msdn.microsoft.com (sux 4 framework)?
>
>--Mike Shull


Cindy Winegarden

2005-04-18, 8:25 pm

Hi Mike,

The VFP wizard framework is probably overkill for what you're trying to do.
For an example of a simple app have a look at the one you can download from
TakeNote Technologies (www.takenote.com, create a registration for yourself
and go to the downloads section).

Any objects or variables you create in your Main program will be visible to
the rest of the app.

--
Cindy Winegarden MCSD, Microsoft Visual Foxpro MVP
cindy_winegarden@msn
.com www.cindywinegarden.com
Blog: http://spaces.msn.com/members/cindywinegarden


"Mike Shull" <mike.shull@gmail.com> wrote in message
news:Xns963BD87EC3B3
Dmikeshullgmailcom@2
16.168.3.44...
> All I want to do is run a few lines of code at startup and I'm getting all
> kinds of grief from VFP8.....



Mike Shull

2005-04-20, 3:24 am

Actually, I left the main prg as the one the wizard created. The goapp
object is created there, and my code is definitely after the createobject
() command. Depending on where I put it, it either never runs or causes
errors. I'm thinking of abandoning the app wizard as a convoluted bit of
code whose only purpose is to complicate things and slow down the app
(runtime and development time).

--Mike

mspratt@losethis.xmission.com (Mike Pratt) wrote in
news:4264e05c.8198498@207.46.248.16:

> Hi Mike,
>
> Any variable created in the init that aren't declared public are
> destroyed when the init finishes. Create goapp in the main.prg that
> loads the main form.
>
> Regards,
>
> Mike
>
> On Mon, 18 Apr 2005 02:16:59 -0000, Mike Shull <mike.shull@gmail.com>
> wrote:
>
>
>


Mike Pratt

2005-04-20, 11:24 am

Hi Mike,

I feel your pain. In my lurking here I have learned: never use wizards
or formsets, and the framework is a learning tool. I've used it too,
an all you have to do is change 1 or 2 little properties ant the app
breaks.

Try this:

In the Program Manager Code tab under Programs should be a main. If
you don't have a Program manager showing click on new and select the
button that doesn't show a wizard.

In Program->main (New if it's not there) add two lines:
DO FORM myForm
READ EVENTS
Close and save it as main. If it's not in bold right click on it as
choose Set as Main.

Create a form (not with the wiz) and add a command button with
thisform.release() in its click event. Add CLEAR EVENTS in it's
destroy event.Set it's ShowWindow property as = 2 (As Top Level Form)
Save it as myForm.

Go back to the program and highlight main and choose the run button.

Regards,

Mike

On Wed, 20 Apr 2005 08:29:10 -0000, Mike Shull <mike.shull@gmail.com>
wrote:
[color=darkred]
>Actually, I left the main prg as the one the wizard created. The goapp
>object is created there, and my code is definitely after the createobject
>() command. Depending on where I put it, it either never runs or causes
>errors. I'm thinking of abandoning the app wizard as a convoluted bit of
>code whose only purpose is to complicate things and slow down the app
>(runtime and development time).
>
>--Mike
>
>mspratt@losethis.xmission.com (Mike Pratt) wrote in
>news:4264e05c.8198498@207.46.248.16:
>

Dummy Newgroup name

2005-04-20, 8:25 pm

The framework (in general, not the MicroSoft rubbish one) is a very
useful and powerful tool.

However, it doesn't come without cost, and that cost is one that many
people don't wish to pay. It doesn't make a framework a bad idea
though.

Mark

Mike Pratt

2005-04-21, 11:25 am

Hi Mark,

I agree about Frameworks, but the Framework supplied with VFP was a
learning tool that was never meant to be used for production apps. The
one I have most recently used is Codebook. For more info go to
http://www.leafe.com , Codebook itself is available at
sourceforge.net.

Regards,

Mike

On Wed, 20 Apr 2005 21:19:42 +0100, Dummy Newgroup name
<nospam@nospam.org> wrote:

>The framework (in general, not the MicroSoft rubbish one) is a very
>useful and powerful tool.
>
>However, it doesn't come without cost, and that cost is one that many
>people don't wish to pay. It doesn't make a framework a bad idea
>though.
>
>Mark


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com