Can custom webbot use frontpage via COM?

J

Joey Oravec

Hi, I'm trying to write a webbot to provide "breadcrumbs navigation" in
frontpage 2003. Since the output string will be calculated at design time
(static) based upon the navigation view, a client-side webbot seems like the
perfect solution.

Using Visual C++ 2005 beta 2, I can already make a webbot. Am I able to
access the Frontpage web object model from within this webbot? I can't figure
out how.

I've included my code below. The example files with the 2002 SDK are useless
with Visual C++ 2005, since the interfaces have changed. I get a non-NULL
value for myapp but I get an HRESULT 0x80010001 "call rejected by callee".
Why??

#include "webbot.h"
#import <MSO.DLL>
#import <VBE6EXT.OLB>
#import <fpeditax.dll> rename("namespace", "my_namespace")
#import <frontpg.exe>
using namespace FrontPage;

BeginWebBotExpand(crumbs,ret,bot,cgi,form)
{
HRESULT hRes;
//CoInitialize(NULL); // Since I'm in a webbot, should I do this?

_ApplicationPtr myapp(__uuidof(Application));
_variant_t versionVar;
versionVar = myapp->Version;

//CoUninitialize(); // Since I'm in a webbot, should I do this?
} EndWebBotExpand

Any ideas? I considered a FrontPage design time control but it looks that
DTCs are totally dead, and they're poorly documented. Am I wrong, and they
might work better?

Thanks!

-joey
 
S

Stefan B Rusynko

See
http://msdn.microsoft.com/library/d...c_fpValidatingFormControlsUsingJavaScript.asp




| Hi, I'm trying to write a webbot to provide "breadcrumbs navigation" in
| frontpage 2003. Since the output string will be calculated at design time
| (static) based upon the navigation view, a client-side webbot seems like the
| perfect solution.
|
| Using Visual C++ 2005 beta 2, I can already make a webbot. Am I able to
| access the Frontpage web object model from within this webbot? I can't figure
| out how.
|
| I've included my code below. The example files with the 2002 SDK are useless
| with Visual C++ 2005, since the interfaces have changed. I get a non-NULL
| value for myapp but I get an HRESULT 0x80010001 "call rejected by callee".
| Why??
|
| #include "webbot.h"
| #import <MSO.DLL>
| #import <VBE6EXT.OLB>
| #import <fpeditax.dll> rename("namespace", "my_namespace")
| #import <frontpg.exe>
| using namespace FrontPage;
|
| BeginWebBotExpand(crumbs,ret,bot,cgi,form)
| {
| HRESULT hRes;
| //CoInitialize(NULL); // Since I'm in a webbot, should I do this?
|
| _ApplicationPtr myapp(__uuidof(Application));
| _variant_t versionVar;
| versionVar = myapp->Version;
|
| //CoUninitialize(); // Since I'm in a webbot, should I do this?
| } EndWebBotExpand
|
| Any ideas? I considered a FrontPage design time control but it looks that
| DTCs are totally dead, and they're poorly documented. Am I wrong, and they
| might work better?
|
| Thanks!
|
| -joey
 
S

Stefan B Rusynko

Sorry wrong link
Should have been a link to
http://msdn.microsoft.com/library/d...l/odc_fpManagedFrontPageAddIns.asp?frame=true




| See
|
http://msdn.microsoft.com/library/d...c_fpValidatingFormControlsUsingJavaScript.asp
|
| --
|
| _____________________________________________
| SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| "Warning - Using the F1 Key will not break anything!" (-;
| To find the best Newsgroup for FrontPage support see:
| http://www.net-sites.com/sitebuilder/newsgroups.asp
| _____________________________________________
|
|
|| Hi, I'm trying to write a webbot to provide "breadcrumbs navigation" in
|| frontpage 2003. Since the output string will be calculated at design time
|| (static) based upon the navigation view, a client-side webbot seems like the
|| perfect solution.
||
|| Using Visual C++ 2005 beta 2, I can already make a webbot. Am I able to
|| access the Frontpage web object model from within this webbot? I can't figure
|| out how.
||
|| I've included my code below. The example files with the 2002 SDK are useless
|| with Visual C++ 2005, since the interfaces have changed. I get a non-NULL
|| value for myapp but I get an HRESULT 0x80010001 "call rejected by callee".
|| Why??
||
|| #include "webbot.h"
|| #import <MSO.DLL>
|| #import <VBE6EXT.OLB>
|| #import <fpeditax.dll> rename("namespace", "my_namespace")
|| #import <frontpg.exe>
|| using namespace FrontPage;
||
|| BeginWebBotExpand(crumbs,ret,bot,cgi,form)
|| {
|| HRESULT hRes;
|| //CoInitialize(NULL); // Since I'm in a webbot, should I do this?
||
|| _ApplicationPtr myapp(__uuidof(Application));
|| _variant_t versionVar;
|| versionVar = myapp->Version;
||
|| //CoUninitialize(); // Since I'm in a webbot, should I do this?
|| } EndWebBotExpand
||
|| Any ideas? I considered a FrontPage design time control but it looks that
|| DTCs are totally dead, and they're poorly documented. Am I wrong, and they
|| might work better?
||
|| Thanks!
||
|| -joey
|
|
 
J

Joey Oravec

Hi Stefan --

I appreciate the link, however I'm not sure the Managed Add-Ins are
appropriate to my original question. From the webpage: "After you have a form
in your add-in, you need a way to access it from within FrontPage. You can do
this by adding new menus, menu items, toolbars, and toolbar controls."

The key difference is that a webbot drops into the page's HTML and executes
every time that you: recalculate links, re-save the page, etc. On the other
hand an add-in, similar to a macro, appears on the toolbar or menu and
executes only once. My understanding is that when you click the toolbar
button to call the add-in, it would insert text and never evaluate again.

Since my proposed "breadcrumbs navigation" needs to update every time the
page is re-hashed (to check if the navigation structure has changed), I'm not
sure if this is possible with using a Managed Add-in. I think the add-in
would be little different than hardcoding the menu in HTML, whereas a webbot
would be a design-time dynamic element.

Am I confused? Is it possible to make Frontpage execute an add-in every time
the page re-hashes, similar to a webbot? Are you saying that I need to export
a COM interface and use the (obsolete?) DTC interface like interdev? That's
basically what the webpage describes by using a Managed Interop, if I'm
reading correctly.

Thanks!! It's confusing....

Stefan B Rusynko said:
Sorry wrong link
Should have been a link to
http://msdn.microsoft.com/library/d...l/odc_fpManagedFrontPageAddIns.asp?frame=true




| See
|
http://msdn.microsoft.com/library/d...c_fpValidatingFormControlsUsingJavaScript.asp
|
| --
|
| _____________________________________________
| SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
| "Warning - Using the F1 Key will not break anything!" (-;
| To find the best Newsgroup for FrontPage support see:
| http://www.net-sites.com/sitebuilder/newsgroups.asp
| _____________________________________________
|
|
|| Hi, I'm trying to write a webbot to provide "breadcrumbs navigation" in
|| frontpage 2003. Since the output string will be calculated at design time
|| (static) based upon the navigation view, a client-side webbot seems like the
|| perfect solution.
||
|| Using Visual C++ 2005 beta 2, I can already make a webbot. Am I able to
|| access the Frontpage web object model from within this webbot? I can't figure
|| out how.
||
|| I've included my code below. The example files with the 2002 SDK are useless
|| with Visual C++ 2005, since the interfaces have changed. I get a non-NULL
|| value for myapp but I get an HRESULT 0x80010001 "call rejected by callee".
|| Why??
||
|| #include "webbot.h"
|| #import <MSO.DLL>
|| #import <VBE6EXT.OLB>
|| #import <fpeditax.dll> rename("namespace", "my_namespace")
|| #import <frontpg.exe>
|| using namespace FrontPage;
||
|| BeginWebBotExpand(crumbs,ret,bot,cgi,form)
|| {
|| HRESULT hRes;
|| //CoInitialize(NULL); // Since I'm in a webbot, should I do this?
||
|| _ApplicationPtr myapp(__uuidof(Application));
|| _variant_t versionVar;
|| versionVar = myapp->Version;
||
|| //CoUninitialize(); // Since I'm in a webbot, should I do this?
|| } EndWebBotExpand
||
|| Any ideas? I considered a FrontPage design time control but it looks that
|| DTCs are totally dead, and they're poorly documented. Am I wrong, and they
|| might work better?
||
|| Thanks!
||
|| -joey
|
|
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top