Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot run form from toolbar class
Message
From
22/05/2002 09:14:40
 
 
To
21/05/2002 19:06:26
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00659647
Message ID:
00659858
Views:
25
This message has been marked as the solution to the initial question of the thread.
Hi!

No dorect way indeed by using DO FORM command. The best approach I know is creating a procedure like below:
* runs a form from main EXE module. Usage:
* Result = RunForm("{Form Name}", "{Parameters}", {.T. or .F., when .T. - form returns result})
* parameters are comma-separated parameters in form of string. Do not pass local variables
* there - convert them to constants.
procedure RunForm
lparameters pcForm, pcParams, plRetVal
  local lcAddOns, llResult
  m.llResult = .T. 

  if vartype(m.pcParams) == "C" AND !empty(m.pcParams)
    lcAddOns = "WITH " + m.pcParams
  endif

  if m.plRetVal
    lcAddOns = "TO llResult"
  endif

  DO FORM (m.pcForm) &lcAddOns

  return m.llResult
endproc
In the VCX file use this procedure to run form from toolbar, when form in compiled into the EXE. The RunForm procedure should be loaded into the memory and should be part of the EXE (compiled into the EXE). To make it loaded in memory, put it in the main (startup) program that contains READ EVENTS, or just put it in the PRG file and use SET PROCEDURE ... ADDITIVE command to load it into memory.

Because procedure is part of the EXE, it will be capable to open forms from inside of that EXE.

Hope this helps.

>Hi,
>
>I have my utils class with my classes inside. One of them is mine toolbar class. VCX is exluded from project. Problem is following:
>
>When I try this code in toolbar's button click event:
>
>DO FROM someform WITH param TO retVal
>
>
>I get the message when starting program's EXE and clicking on that toolbar button:
>
>Cannot find ........../someform.scx.
>
>How to reference mine projects forms in other menner.
>
>Vladimir.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Reply
Map
View

Click here to load this message in the networking platform