Navigation:  DPLOTLIB Functions >

DPlot_Start function

Print this Topic Previous pageReturn to chapter overviewNext page

HWND DPlot_Start(int Hide, int *was_active);

Parameters

Hide

If non-zero, DPlot will be invisible to the user. This is the same state used by DPlot_PlotBitmap and DPlot_PlotToRect if DPlot is not already running when those functions are called. If 0, DPlot is started normally (if it is not already running).

*was_active

Address of an integer value that receives 1 if DPlot was already running and 0 if it was not. If this parameter is set to NULL, no value is returned.

Return Values

 0

Could not start DPlot, or found that the wrong version number is installed on the user's system. In the latter case the user will be presented with a dialog explaining the problem.

>0

Window handle of the main DPlot application window.

Remarks

It is never mandatory to call DPlot_Start, since all routines that interact with DPlot will start it if it is not already running. However, two routines (DPlot_PlotBitmap and DPlot_PlotToRect) will shut DPlot down when finished if DPlot was not already active. If your application uses either of these routines then performance will be improved considerably if you call DPlot_Start when your application is first activated.

DPlot_Start first checks the minimum version criteria. The minimum version can be set with a call to DPlot_MinVersion. If DPlot_MinVersion is not first called, the minimum required for this version of DPLOTLIB.DLL (2.0.0.3) is used. If DPlot Jr is installed and meets this minimum version requirement but the full version does not, then DPlot Jr will be used regardless of whether the full version of DPlot is installed or running. If neither DPlot Jr nor the full version of DPlot meet the minimum version requirement, an error message similar to that shown below will be presented.

If you do not want this error message to be displayed to your users, you should first call DPlot_MinVersion. and handle the situation within your own program if that function returns 0.

If the full version of DPlot meets the version criteria and it is running, the full version of DPlot will be used. Otherwise if DPlot Jr meets the version criteria and it is running, DPlot Jr will be used. If neither program is currently open DPlot_Start looks in the registry first for the full version (assuming the version criteria is met), and if unfound then looks for DPlot Jr (again, assuming it meets the version criteria).

If you want to be able to test DPlot Jr (because, for example, you have not paid for redistributing the full version and want to only distribute DPlot Jr to your end users) and also have the full version of DPlot installed on your system, you can force DPLOTLIB to use DPlot Jr by deleting the registry entry for DPlot (HKEY_CURRENT_USER/Software/DPlot). This entry is recreated every time DPlot is started, so you do not risk fouling things up by deleting it.

 

 


Page url: http://www.dplot.com/lib/index.htm?dplot_start.htm