Hi everyone

After uninstalling Safari and starting to explicitly loading the webkit.dll 
file I get a weird error when loading a URL request. Incidentally I get the 
same error the exact same place when I try to run the WinLauncher.exe 
application (which is part of the Windows port of WebKit).

(NOTE: error handling code and other clutter is removed from the following 
source)

First I load the DLL and gets a function pointer to the DllGetClassObject 
method (DllRegisterServer does nothing so registering the dll with RegSvr32.exe 
yields an error):

              hmodWebKit  = LoadLibrary(TEXT("WebKit.dll"));
              if (hmodWebKit)
                     dllGetClassObject = 
(DLLGETCLASSOBJECTFARPROC)GetProcAddress(hmodWebKit, "DllGetClassObject");
              if(!dllGetClassObject)
                     return false;

Then I get the class factory for a WebView, and instructs it to create an 
instance:

              IClassFactory* pClsFactory;
              if(FAILED(dllGetClassObject(CLSID_WebView, IID_IClassFactory, 
(void**)&pClsFactory)))
                     return false;
              IWebView* pWebView;
              classFactory->CreateInstance(NULL, IID_IWebView, 
(void**)&pWebView);

Now for the part where I will load a URL. I start by getting the main frame:

              IWebFrame* frame;
              webView->mainFrame(&frame);

Then I create a class factory for a mutable web request and instructs that 
factory to create a request for me:

              IWebMutableURLRequest* request;
              IClassFactory* pClsFct;
              dllGetClassObject(CLSID_WebMutableURLRequest, IID_IClassFactory, 
(void**)&pClsFct);
              pClsFct->CreateInstance(NULL, IID_IWebMutableURLRequest, 
(void**)&request);

I initialize the request like this:
              
request->initWithURL(bstrUrl,WebURLRequestUseProtocolCachePolicy,60);

But when I instruct the frame to load the request, like this:
              frame->loadRequest(request);

I get an acces violation exception saying:
"Unhandled exception at 0x655452d5 in <app.name>.exe: 0xC0000005:
Access violation reading location 0x00000070."

The application breaks in StringImplCF.cpp, in the method "CFStringRef 
StringImpl::createCFString()" at this line:
    CFStringRef string = CFStringCreateWithCharactersNoCopy(allocator, 
reinterpret_cast<const UniChar*>(m_data), m_length, kCFAllocatorNull);

As previously mentioned it is the same error that I get when trying to run 
WinLauncher.exe. Does anyone know what the problem is?

Best regards,
Frank
_______________________________________________
webkit-dev mailing list
webkit-dev@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-dev

Reply via email to