I have recently attempted to use the Mozilla ActiveX control in favour to the equivalent IE control. I am using C++ within the BCB 6. I used to use the VCL TCppWebBrowser component (an IE activeX wrapper) and simply replied it with the Mozilla control. Navigation local html pages work seemingly without a problem. However I need to gain access to printer functions. and attempted to use the IMozControlBridge - this is where problems began!
I found a few lines of code (from withing this mailing list) and altered it slightly to the following.
In my .h file:
...
...
#include "MOZILLACONTROLLib_OCX.h"
#include "nsIWebBrowser.h"
...
class TForm1 : public TForm
{
-published:
...
TMozillaBrowser *HTMLBrowser;
...
private:
...
IMozControlBridge *pBridge;
...
...
};
In the constructor of my .cpp file
... #pragma link "MOZILLACONTROLLib_OCX" ...
__fastcall TForm1::Torm1 (TComponent* Owner) : TForm(Owner
{
HRESULT rv;
nsIWebBrowser *pMoz = nsnull;
pBridge = nsnull;rv = HTMLBrowser->DefaultDispatch->QueryInterface(Sysutils::StringToGUID("{D6131E69-4A89-4AB5-B916-5A581D66C84F}")),
(void **)&pBridge );
if( SUCCEEDED( rv ) )
{
rv = pBridge->GetWebBrowser( (void **)&pMoz );
pBridge->Release();
}
}Now this compiles, builds and runs. However pMoz remains a NULL. Why? Why can't I get an interface? What have I left out!
Regards Gerhard
_______________________________________________ mozilla-embedding mailing list [EMAIL PROTECTED] http://mail.mozilla.org/listinfo/mozilla-embedding
