Specifies a URL to which the host should navigate or a program that the host should run when the IDE enters run mode.
HRESULT GetStartupInfo(
DESIGNERSTARTUPINFO *pStartupInfo
);
Parameter
pStartupInfo
[in, out] Pointer to a data structure with the following members:
Member | Contents |
cb | A ULONG value specifying the size of the data structure. This value must be sizeof(DESIGNERSTARTUPINFO); it is filled in by the host. |
dwStartupFlags | Specifies DESIGNERSTARTUPINFO_EXE or DESIGNERSTARTUPINFO_URL to indicate whether bstrStartupData represents a program or a URL. |
bstrStartupData | Specifies either a URL or the name of an executable program. |
Return Values
The designer returns one of the following values:
Return Value | Meaning |
S_OK | Success. |
Other statuses | Errors. |
Comments
The designer implements this method.
The host calls the designer's GetStartupInfo method to determine whether it should navigate to a URL or load an executable program when the IDE enters run mode. Designers that implement this method must set the DESIGNERFEATURE_STARTUPINFO flag in the registry.
More than one designer that supports startup information can be present in the host IDE. Typically, the host lets the user specify which designer to query for startup information. Therefore, a designer cannot depend on this method being called in all cases.
In pStartupInfo.dwStartupFlags, the designer specifies either DESIGNERSTARTUPINFO_URL or DESIGNERSTARTUPINFO_EXE, indicating that the host should navigate to a URL or load an executable program, respectively. In pStartupInfo.bstrStartupData, the designer specifies either the URL or the name of the program, along with any command-line arguments.
The designer must allocate pStartupInfo.bstrStartupData with SysAllocString (or one of its variants, such as SysAllocStringLen); the host will free bstrStartupData with SysFreeString.
Example
The following example specifies a URL to which the host navigates when it starts the designer. The example first sets DESIGNERSTARTUPINFO_URL in dwStartupFlags, then initializes the string that will contain the URL on return. Finally, it calls a local routine that writes the URL in the bstrStartupData member of the pStartupInfo
structure.
STDMETHODIMP MyDesigner::GetStartupInfo
(
DESIGNERSTARTUPINFO* pStartupInfo
)
{
pStartupInfo->dwStartupFlags = DESIGNERSTARTUPINFO_URL;
pStartupInfo->bstrStartupData = NULL;
GetRunURL(&pStartupInfo->bstrStartupData);
return S_OK;
}
See Also