The following example demonstrates OLE automation from Visual C++:
#include "webber.h"
void OnSomeEvent()
{
IWebber explorer;
COleException error;
if(!explorer.CreateDispatch("FrontPage.Explorer",&error))
{
AfxMessageBox("Error connecting to FrontPage Explorer.");
return;
}
explorer.vtiRefreshWebFromServer();
explorer.ReleaseDispatch();
}
The following is the same example as above, but using Visual Basic:
Function btnSomeEvent_Click()
{
Dim explorer as Object
Set explorer = CreateObject("FrontPage.Explorer")
explorer.vtiRefreshWebFromServer
Set explorer = Nothing
‘ NOTE: it is important to set the OLE object variable
‘ to Nothing so that the OLE connection is released
}
Note: The remaining sections describe the OLE methods supported by each component in FrontPage. In the top right corner of each page is the OLE component name used to access the method. The method parameters and return value are presented in both C++ and Visual Basic notation.