Couldn't create nsIXMLHttpRequest instance! Source Code
"tanbo19820704" <[email protected]> Mon, 13 Sep 2010 11:26:04 +0800
| Newsgroups | gmane.comp.mozilla.devel.dom |
|---|---|
| Message-ID | <[email protected]> |
In Firfox's Source TestNativeXMLHttpRequest.cpp
xhr Is Null
1
nsCOMPtr<nsIXMLHttpRequest> xhr =
do_CreateInstance(NS_XMLHTTPREQUEST_CONTRACTID, &rv);
TEST_ENSURE_SUCCESS(rv, "Couldn't create nsIXMLHttpRequest instance!");
NS_NAMED_LITERAL_CSTRING(getString, "GET");
NS_NAMED_LITERAL_CSTRING(testURL, TEST_URL);
const nsAString& empty = EmptyString();
printf("*** About to see an expected warning about mPrincipal:\n");
rv = xhr->OpenRequest(getString, testURL, PR_FALSE, empty, empty);
printf("*** End of expected warning output.\n");
TEST_ENSURE_FAILED(rv, "OpenRequest should have failed!");
2 Other Way
nsCOMPtr<nsIXMLHttpRequest> request = do_GetService(NS_XMLHTTPREQUEST_CONTRACTID, &rv);
The request is Null also
AnyBody Know how to Create nsIXMLHttpRequest instance?
My SDK IS Gecko_SDK 1.9.2
Thanks.
2010-09-13
tanbo19820704