>When I run my main application from the development envirnment or from the exe, I don't have a problem, only when I try to run the form directly in development.
>
>In my form (model) show method, I create a toolbar from my classlib
>
>if !vartype(oNoteBAR)=[O]
> SET CLASSLIB TO schtool addi
> oNoteBar=CREATEOBJECT('NoteBar')
> oNoteBar.visible=.t.
> oNoteBar.dock(0)
>endif
>
>
>It initially display and then after the form is completly loaded, it disappears. Running from my main exe, it doesn't happen but then I have a read events. I want to put code in this toolbar to perform actions that are directly related to the form being displayed.
It seems the variable oNoteBar exists somewhere in your main.prg and stays visible for as long as your app is active. When you run the above code, the variable is created as private, and goes out of scope as soon as this code exits. This makes reference count for your toolbar go to zero, and it gets released.
Just try to create the variable in the command window before you run this form. It should be public then.