[webkit-dev] loadRequest

drewtenn at yahoo.com drewtenn at yahoo.com
Wed Nov 19 08:34:02 PST 2008


I finally got WebKit to build properly. 

I'm building a test application and I'm using WinLauncher as my example.

WinLauncher doesn't appear to work for me when I type a URL in e.g. http://yahoo.com so it doesn't surprise me that my code doesn't work.

I'm essentially taking the loadURL function from WinLauncher. All of the HRESULTS's come back with S_OK, yet all I see in my window is a white blank screen. loadHTMLString() works properly.

This also leads to a second question about some DLL dependencies. Namely, CFNetwork, CoreFoundation, etc. Obviously I got these from my Safari installation. Are these DLL's freely redistributable?

Thanks

Here's my code for my URL. I took out a lot of the checks for brevity.


void CWebKitTestView::loadURL(BSTR urlBStr)
{
  IWebFrame* frame = 0;
  IWebMutableURLRequest* request = 0;
  static BSTR methodBStr = 0;

  if (!methodBStr)
    methodBStr = SysAllocString(TEXT("GET"));

  HRESULT hr = gWebView->mainFrame(&frame);

  hr = CoCreateInstance(CLSID_WebMutableURLRequest, 0, CLSCTX_ALL, IID_IWebMutableURLRequest, (void**)&request);

  hr = request->initWithURL(urlBStr, WebURLRequestUseProtocolCachePolicy, 0);
  hr = request->setHTTPMethod(methodBStr);
  hr = frame->loadRequest(request);

  if (frame)
    frame->Release();
  if (request)
    request->Release();
}


      


More information about the webkit-dev mailing list