Hello,

I need to write a web application for my pocket PC, here is part of the
code I'm using:

xrequest = new ActiveXObject("Microsoft.XMLHTTP");
xrequest.open("POST",url,true );

I'm getting access denied when trying to execute the open method.

The same code works fine when running it using scripting host on the same
pocket PC. Also, the same code works fine on another iPaq I have that uses
win CE 4

Trying to change the security setting in the registry didn't help.

Can someone please help

Thanks,
Shlomi

RE: XMLHTTP doesn't work, I'm getting access denied by a-nlewis

a-nlewis
Wed Feb 16 12:51:20 CST 2005

------=_NextPart_0001_26921225
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

This is a known problem which affects certain builds of Pocket PC 2003 and
all builds of Pocket PC 2003 Second Edition. The workaround is pretty
complicated, and involves creating an ActiveX control using ATL and
embedding it in the web page. Other than the complexity of the workaround,
the main disadvantage to this approach is that it means your end users must
download, install and register the ActiveX control before they can use your
HTML content. Unfortunately, there is no other way around the problem.

If you are familiar with creating ATL controls, the process is pretty
straightforward. Start by creating an ATL project and add a simple object
to it - let's call the control "ComAdapter" and the object "ComObject".
Then add the following method to the object:

STDMETHODIMP GetInterface
(
/*[in]*/ BSTR bstrObj, // Name of the object
/*[out, retval]*/ VARIANT *pvarObj // Returned object
)
{
CComPtr<IDispatch> pObj;
IDispatch* pDispatch = NULL;
HRESULT hr = pObj.CoCreateInstance( bstrObj );

if( SUCCEEDED( hr ) )
{
if( pObj )
hr = pObj->QueryInterface( IID_IDispatch,
(void**)&pDispatch );
else
hr = E_NOINTERFACE;
}

VariantClear( pvarObj );
V_VT( pvarObj ) = VT_DISPATCH;
V_DISPATCH( pvarObj ) = pDispatch;

return hr;
}

Finally, you will need to make some changes to your HTML code - something
like this:

var objXML = new ActiveXObject( "ComAdapter.ComObject" );
var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );
objRealXML.open( "POST", url, true );


---

Nathan Lewis
Microsoft Mobile and Embedded Devices Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.



--------------------
From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
Subject: XMLHTTP doesn't work, I'm getting access denied
Date: Wed, 16 Feb 2005 05:19:03 -0800


Hello,

I need to write a web application for my pocket PC, here is part of the
code I'm using:

xrequest = new ActiveXObject("Microsoft.XMLHTTP");
xrequest.open("POST",url,true );

I'm getting access denied when trying to execute the open method.

The same code works fine when running it using scripting host on the same
pocket PC. Also, the same code works fine on another iPaq I have that uses
win CE 4

Trying to change the security setting in the registry didn't help.

Can someone please help

Thanks,
Shlomi


------=_NextPart_0001_26921225
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 This is a known problem which affects certain builds of Pocket PC 2003 and all builds of Pocket PC 2003 Second Edition. The workaround is pretty complicated, and involves creating an ActiveX control using ATL and embedding it in the web page. Other than the complexity of the workaround, the main disadvantage to this approach is that it means your end users must download, install and register the ActiveX control before they can use your HTML content. Unfortunately, there is no other way around the problem.
\par
\par If you are familiar with creating ATL controls, the process is pretty straightforward. Start by creating an ATL project and add a simple object to it - let's call the control "ComAdapter" and the object "ComObject". Then add the following method to the object:
\par
\par STDMETHODIMP GetInterface
\par (
\par /*[in]*/ BSTR bstrObj, // Name of the object
\par /*[out, retval]*/ VARIANT *pvarObj // Returned object
\par )
\par \{
\par CComPtr<IDispatch> pObj;
\par IDispatch* pDispatch = NULL;
\par HRESULT hr = pObj.CoCreateInstance( bstrObj );
\par
\par if( SUCCEEDED( hr ) )
\par \{
\par if( pObj )
\par hr = pObj->QueryInterface( IID_IDispatch, (void**)&pDispatch );
\par else
\par hr = E_NOINTERFACE;
\par \}
\par
\par VariantClear( pvarObj );
\par V_VT( pvarObj ) = VT_DISPATCH;
\par V_DISPATCH( pvarObj ) = pDispatch;
\par
\par return hr;
\par \}
\par
\par Finally, you will need to make some changes to your HTML code - something like this:
\par
\par var objXML = new ActiveXObject( "ComAdapter.ComObject" );
\par var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );\tab
\par objRealXML.open( "POST", url, true );
\par
\par
\par ---
\par
\par Nathan Lewis
\par Microsoft Mobile and Embedded Devices Developer Support
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par
\par \pard\li720 --------------------
\par From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
\par Subject: XMLHTTP doesn't work, I'm getting access denied
\par Date: Wed, 16 Feb 2005 05:19:03 -0800
\par
\par
\par Hello,
\par
\par I need to write a web application for my pocket PC, here is part of the
\par code I'm using:
\par
\par xrequest = new ActiveXObject("Microsoft.XMLHTTP");
\par xrequest.open("POST",url,true );
\par
\par I'm getting access denied when trying to execute the open method.
\par
\par The same code works fine when running it using scripting host on the same
\par pocket PC. Also, the same code works fine on another iPaq I have that uses
\par win CE 4
\par
\par Trying to change the security setting in the registry didn't help.
\par
\par Can someone please help
\par
\par Thanks,
\par Shlomi
\par
\par \pard
\par
\par }
------=_NextPart_0001_26921225--


RE: XMLHTTP doesn't work, I'm getting access denied by Shlomi

Shlomi
Thu Feb 17 02:05:03 CST 2005

Thank you very much for your support. I will give it a try.

I saw another workaround, setting a new registry key as follow:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet
Settings a DWORD value named "Security_AccessCrossDomainData" and set it to
1.

I tried it with no success. Is there a different registry key that might
solve this problem without coding?

"Nathan Lewis" wrote:

> This is a known problem which affects certain builds of Pocket PC 2003 and
> all builds of Pocket PC 2003 Second Edition. The workaround is pretty
> complicated, and involves creating an ActiveX control using ATL and
> embedding it in the web page. Other than the complexity of the workaround,
> the main disadvantage to this approach is that it means your end users must
> download, install and register the ActiveX control before they can use your
> HTML content. Unfortunately, there is no other way around the problem.
>
> If you are familiar with creating ATL controls, the process is pretty
> straightforward. Start by creating an ATL project and add a simple object
> to it - let's call the control "ComAdapter" and the object "ComObject".
> Then add the following method to the object:
>
> STDMETHODIMP GetInterface
> (
> /*[in]*/ BSTR bstrObj, // Name of the object
> /*[out, retval]*/ VARIANT *pvarObj // Returned object
> )
> {
> CComPtr<IDispatch> pObj;
> IDispatch* pDispatch = NULL;
> HRESULT hr = pObj.CoCreateInstance( bstrObj );
>
> if( SUCCEEDED( hr ) )
> {
> if( pObj )
> hr = pObj->QueryInterface( IID_IDispatch,
> (void**)&pDispatch );
> else
> hr = E_NOINTERFACE;
> }
>
> VariantClear( pvarObj );
> V_VT( pvarObj ) = VT_DISPATCH;
> V_DISPATCH( pvarObj ) = pDispatch;
>
> return hr;
> }
>
> Finally, you will need to make some changes to your HTML code - something
> like this:
>
> var objXML = new ActiveXObject( "ComAdapter.ComObject" );
> var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );
> objRealXML.open( "POST", url, true );
>
>
> ---
>
> Nathan Lewis
> Microsoft Mobile and Embedded Devices Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
> --------------------
> From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
> Subject: XMLHTTP doesn't work, I'm getting access denied
> Date: Wed, 16 Feb 2005 05:19:03 -0800
>
>
> Hello,
>
> I need to write a web application for my pocket PC, here is part of the
> code I'm using:
>
> xrequest = new ActiveXObject("Microsoft.XMLHTTP");
> xrequest.open("POST",url,true );
>
> I'm getting access denied when trying to execute the open method.
>
> The same code works fine when running it using scripting host on the same
> pocket PC. Also, the same code works fine on another iPaq I have that uses
> win CE 4
>
> Trying to change the security setting in the registry didn't help.
>
> Can someone please help
>
> Thanks,
> Shlomi
>
>

RE: XMLHTTP doesn't work, I'm getting access denied by Shlomi

Shlomi
Thu Feb 17 05:15:01 CST 2005

I'm trying to implement your solution, I've created the dll and loaded it to
the iPaq, I'm getting an error from Javascript for sending the wrong number
of parameters for the GetInterface method. From what I understand
GetInterface should return the object in pvarObj, who do I use that in
Javascript?

Does Microsoft intend to distribute a solution for this problem?

"Nathan Lewis" wrote:

> This is a known problem which affects certain builds of Pocket PC 2003 and
> all builds of Pocket PC 2003 Second Edition. The workaround is pretty
> complicated, and involves creating an ActiveX control using ATL and
> embedding it in the web page. Other than the complexity of the workaround,
> the main disadvantage to this approach is that it means your end users must
> download, install and register the ActiveX control before they can use your
> HTML content. Unfortunately, there is no other way around the problem.
>
> If you are familiar with creating ATL controls, the process is pretty
> straightforward. Start by creating an ATL project and add a simple object
> to it - let's call the control "ComAdapter" and the object "ComObject".
> Then add the following method to the object:
>
> STDMETHODIMP GetInterface
> (
> /*[in]*/ BSTR bstrObj, // Name of the object
> /*[out, retval]*/ VARIANT *pvarObj // Returned object
> )
> {
> CComPtr<IDispatch> pObj;
> IDispatch* pDispatch = NULL;
> HRESULT hr = pObj.CoCreateInstance( bstrObj );
>
> if( SUCCEEDED( hr ) )
> {
> if( pObj )
> hr = pObj->QueryInterface( IID_IDispatch,
> (void**)&pDispatch );
> else
> hr = E_NOINTERFACE;
> }
>
> VariantClear( pvarObj );
> V_VT( pvarObj ) = VT_DISPATCH;
> V_DISPATCH( pvarObj ) = pDispatch;
>
> return hr;
> }
>
> Finally, you will need to make some changes to your HTML code - something
> like this:
>
> var objXML = new ActiveXObject( "ComAdapter.ComObject" );
> var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );
> objRealXML.open( "POST", url, true );
>
>
> ---
>
> Nathan Lewis
> Microsoft Mobile and Embedded Devices Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
> --------------------
> From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
> Subject: XMLHTTP doesn't work, I'm getting access denied
> Date: Wed, 16 Feb 2005 05:19:03 -0800
>
>
> Hello,
>
> I need to write a web application for my pocket PC, here is part of the
> code I'm using:
>
> xrequest = new ActiveXObject("Microsoft.XMLHTTP");
> xrequest.open("POST",url,true );
>
> I'm getting access denied when trying to execute the open method.
>
> The same code works fine when running it using scripting host on the same
> pocket PC. Also, the same code works fine on another iPaq I have that uses
> win CE 4
>
> Trying to change the security setting in the registry didn't help.
>
> Can someone please help
>
> Thanks,
> Shlomi
>
>

RE: XMLHTTP doesn't work, I'm getting access denied by a-nlewis

a-nlewis
Thu Feb 17 14:28:27 CST 2005

------=_NextPart_0001_2C1146B6
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Short answer: I don't know.

Long answer: I think there is a registry key to work around the problem,
but I'm not sure what it is.

Sorry!

--------------------
From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
Subject: RE: XMLHTTP doesn't work, I'm getting access denied
Date: Thu, 17 Feb 2005 00:05:03 -0800


Thank you very much for your support. I will give it a try.

I saw another workaround, setting a new registry key as follow:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Internet
Settings a DWORD value named "Security_AccessCrossDomainData" and set it to
1.

I tried it with no success. Is there a different registry key that might
solve this problem without coding?

"Nathan Lewis" wrote:

> This is a known problem which affects certain builds of Pocket PC 2003
and
> all builds of Pocket PC 2003 Second Edition. The workaround is pretty
> complicated, and involves creating an ActiveX control using ATL and
> embedding it in the web page. Other than the complexity of the
workaround,
> the main disadvantage to this approach is that it means your end users
must
> download, install and register the ActiveX control before they can use
your
> HTML content. Unfortunately, there is no other way around the problem.
>
> If you are familiar with creating ATL controls, the process is pretty
> straightforward. Start by creating an ATL project and add a simple
object
> to it - let's call the control "ComAdapter" and the object "ComObject".
> Then add the following method to the object:
>
> STDMETHODIMP GetInterface
> (
> /*[in]*/ BSTR bstrObj, // Name of the object
> /*[out, retval]*/ VARIANT *pvarObj // Returned object
> )
> {
> CComPtr<IDispatch> pObj;
> IDispatch* pDispatch = NULL;
> HRESULT hr = pObj.CoCreateInstance( bstrObj );
>
> if( SUCCEEDED( hr ) )
> {
> if( pObj )
> hr = pObj->QueryInterface( IID_IDispatch,
> (void**)&pDispatch );
> else
> hr = E_NOINTERFACE;
> }
>
> VariantClear( pvarObj );
> V_VT( pvarObj ) = VT_DISPATCH;
> V_DISPATCH( pvarObj ) = pDispatch;
>
> return hr;
> }
>
> Finally, you will need to make some changes to your HTML code - something
> like this:
>
> var objXML = new ActiveXObject( "ComAdapter.ComObject" );
> var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );
> objRealXML.open( "POST", url, true );
>
>
> ---
>
> Nathan Lewis
> Microsoft Mobile and Embedded Devices Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
>
>
> --------------------
> From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
> Subject: XMLHTTP doesn't work, I'm getting access denied
> Date: Wed, 16 Feb 2005 05:19:03 -0800
>
>
> Hello,
>
> I need to write a web application for my pocket PC, here is part of the
> code I'm using:
>
> xrequest = new ActiveXObject("Microsoft.XMLHTTP");
> xrequest.open("POST",url,true );
>
> I'm getting access denied when trying to execute the open method.
>
> The same code works fine when running it using scripting host on the same
> pocket PC. Also, the same code works fine on another iPaq I have that
uses
> win CE 4
>
> Trying to change the security setting in the registry didn't help.
>
> Can someone please help
>
> Thanks,
> Shlomi
>
>

------=_NextPart_0001_2C1146B6
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 Short answer: I don't know.
\par
\par Long answer: I think there is a registry key to work around the problem, but I'm not sure what it is.
\par
\par Sorry!
\par
\par \pard\li720 --------------------
\par From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
\par Subject: RE: XMLHTTP doesn't work, I'm getting access denied
\par Date: Thu, 17 Feb 2005 00:05:03 -0800
\par
\par
\par Thank you very much for your support. I will give it a try.
\par
\par I saw another workaround, setting a new registry key as follow:
\par HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Internet
\par Settings a DWORD value named "Security_AccessCrossDomainData" and set it to
\par 1.
\par
\par I tried it with no success. Is there a different registry key that might
\par solve this problem without coding?
\par
\par "Nathan Lewis" wrote:
\par
\par > This is a known problem which affects certain builds of Pocket PC 2003 and
\par > all builds of Pocket PC 2003 Second Edition. The workaround is pretty
\par > complicated, and involves creating an ActiveX control using ATL and
\par > embedding it in the web page. Other than the complexity of the workaround,
\par > the main disadvantage to this approach is that it means your end users must
\par > download, install and register the ActiveX control before they can use your
\par > HTML content. Unfortunately, there is no other way around the problem.
\par >
\par > If you are familiar with creating ATL controls, the process is pretty
\par > straightforward. Start by creating an ATL project and add a simple object
\par > to it - let's call the control "ComAdapter" and the object "ComObject".
\par > Then add the following method to the object:
\par >
\par > STDMETHODIMP GetInterface
\par > (
\par > /*[in]*/ BSTR bstrObj, // Name of the object
\par > /*[out, retval]*/ VARIANT *pvarObj // Returned object
\par > )
\par > \{
\par > CComPtr<IDispatch> pObj;
\par > IDispatch* pDispatch = NULL;
\par > HRESULT hr = pObj.CoCreateInstance( bstrObj );
\par >
\par > if( SUCCEEDED( hr ) )
\par > \{
\par > if( pObj )
\par > hr = pObj->QueryInterface( IID_IDispatch,
\par > (void**)&pDispatch );
\par > else
\par > hr = E_NOINTERFACE;
\par > \}
\par >
\par > VariantClear( pvarObj );
\par > V_VT( pvarObj ) = VT_DISPATCH;
\par > V_DISPATCH( pvarObj ) = pDispatch;
\par >
\par > return hr;
\par > \}
\par >
\par > Finally, you will need to make some changes to your HTML code - something
\par > like this:
\par >
\par > var objXML = new ActiveXObject( "ComAdapter.ComObject" );
\par > var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );\tab
\par > objRealXML.open( "POST", url, true );
\par >
\par >
\par > ---
\par >
\par > Nathan Lewis
\par > Microsoft Mobile and Embedded Devices Developer Support
\par >
\par > This posting is provided "AS IS" with no warranties, and confers no rights.
\par >
\par >
\par >
\par > --------------------
\par > From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
\par > Subject: XMLHTTP doesn't work, I'm getting access denied
\par > Date: Wed, 16 Feb 2005 05:19:03 -0800
\par >
\par >
\par > Hello,
\par >
\par > I need to write a web application for my pocket PC, here is part of the
\par > code I'm using:
\par >
\par > xrequest = new ActiveXObject("Microsoft.XMLHTTP");
\par > xrequest.open("POST",url,true );
\par >
\par > I'm getting access denied when trying to execute the open method.
\par >
\par > The same code works fine when running it using scripting host on the same
\par > pocket PC. Also, the same code works fine on another iPaq I have that uses
\par > win CE 4
\par >
\par > Trying to change the security setting in the registry didn't help.
\par >
\par > Can someone please help
\par >
\par > Thanks,
\par > Shlomi
\par >
\par >
\par \pard
\par
\par }
------=_NextPart_0001_2C1146B6--


RE: XMLHTTP doesn't work, I'm getting access denied by a-nlewis

a-nlewis
Thu Feb 17 14:36:36 CST 2005

------=_NextPart_0001_2C1894F4
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

If you specified the second parameter in the IDL using [out, retval], then
you will only need one parameter in the JScript code. The correct IDL
definition would be something like:

[
object,
uuid( ...your GUID here... ),
dual,
helpstring("IComObject Interface"),
pointer_default(unique)
]
interface IComObject : IDispatch
{
[
id(1),
helpstring("Returns the requested object interface.")
]
HRESULT GetInterface( [in] BSTR bstrObj, [out, retval] VARIANT*
pvarObj );
};


I'm not sure if there are plans to create a sample for this workaround, but
a KB has been requested.


---

Nathan Lewis
Microsoft Mobile and Embedded Devices Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.



--------------------
From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
Subject: RE: XMLHTTP doesn't work, I'm getting access denied
Date: Thu, 17 Feb 2005 03:15:01 -0800


I'm trying to implement your solution, I've created the dll and loaded it
to
the iPaq, I'm getting an error from Javascript for sending the wrong number
of parameters for the GetInterface method. From what I understand
GetInterface should return the object in pvarObj, who do I use that in
Javascript?

Does Microsoft intend to distribute a solution for this problem?

"Nathan Lewis" wrote:

> This is a known problem which affects certain builds of Pocket PC 2003
and
> all builds of Pocket PC 2003 Second Edition. The workaround is pretty
> complicated, and involves creating an ActiveX control using ATL and
> embedding it in the web page. Other than the complexity of the
workaround,
> the main disadvantage to this approach is that it means your end users
must
> download, install and register the ActiveX control before they can use
your
> HTML content. Unfortunately, there is no other way around the problem.
>
> If you are familiar with creating ATL controls, the process is pretty
> straightforward. Start by creating an ATL project and add a simple
object
> to it - let's call the control "ComAdapter" and the object "ComObject".
> Then add the following method to the object:
>
> STDMETHODIMP GetInterface
> (
> /*[in]*/ BSTR bstrObj, // Name of the object
> /*[out, retval]*/ VARIANT *pvarObj // Returned object
> )
> {
> CComPtr<IDispatch> pObj;
> IDispatch* pDispatch = NULL;
> HRESULT hr = pObj.CoCreateInstance( bstrObj );
>
> if( SUCCEEDED( hr ) )
> {
> if( pObj )
> hr = pObj->QueryInterface( IID_IDispatch,
> (void**)&pDispatch );
> else
> hr = E_NOINTERFACE;
> }
>
> VariantClear( pvarObj );
> V_VT( pvarObj ) = VT_DISPATCH;
> V_DISPATCH( pvarObj ) = pDispatch;
>
> return hr;
> }
>
> Finally, you will need to make some changes to your HTML code - something
> like this:
>
> var objXML = new ActiveXObject( "ComAdapter.ComObject" );
> var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );
> objRealXML.open( "POST", url, true );
>
>
> ---
>
> Nathan Lewis
> Microsoft Mobile and Embedded Devices Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
>
>
> --------------------
> From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
> Subject: XMLHTTP doesn't work, I'm getting access denied
> Date: Wed, 16 Feb 2005 05:19:03 -0800
>
>
> Hello,
>
> I need to write a web application for my pocket PC, here is part of the
> code I'm using:
>
> xrequest = new ActiveXObject("Microsoft.XMLHTTP");
> xrequest.open("POST",url,true );
>
> I'm getting access denied when trying to execute the open method.
>
> The same code works fine when running it using scripting host on the same
> pocket PC. Also, the same code works fine on another iPaq I have that
uses
> win CE 4
>
> Trying to change the security setting in the registry didn't help.
>
> Can someone please help
>
> Thanks,
> Shlomi
>
>

------=_NextPart_0001_2C1894F4
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 If you specified the second parameter in the IDL using [out, retval], then you will only need one parameter in the JScript code. The correct IDL definition would be something like:
\par
\par [
\par object,
\par uuid( ...your GUID here... ),
\par dual,
\par helpstring("IComObject Interface"),
\par pointer_default(unique)
\par ]
\par interface IComObject : IDispatch
\par \{
\par [
\par id(1),
\par helpstring("Returns the requested object interface.")
\par ]
\par HRESULT GetInterface( [in] BSTR bstrObj, [out, retval] VARIANT* pvarObj );
\par \};
\par
\par
\par I'm not sure if there are plans to create a sample for this workaround, but a KB has been requested.
\par
\par
\par ---
\par
\par Nathan Lewis
\par Microsoft Mobile and Embedded Devices Developer Support
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par
\par \pard\li720 --------------------
\par From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
\par Subject: RE: XMLHTTP doesn't work, I'm getting access denied
\par Date: Thu, 17 Feb 2005 03:15:01 -0800
\par
\par
\par I'm trying to implement your solution, I've created the dll and loaded it to
\par the iPaq, I'm getting an error from Javascript for sending the wrong number
\par of parameters for the GetInterface method. From what I understand
\par GetInterface should return the object in pvarObj, who do I use that in
\par Javascript?
\par
\par Does Microsoft intend to distribute a solution for this problem?
\par
\par "Nathan Lewis" wrote:
\par
\par > This is a known problem which affects certain builds of Pocket PC 2003 and
\par > all builds of Pocket PC 2003 Second Edition. The workaround is pretty
\par > complicated, and involves creating an ActiveX control using ATL and
\par > embedding it in the web page. Other than the complexity of the workaround,
\par > the main disadvantage to this approach is that it means your end users must
\par > download, install and register the ActiveX control before they can use your
\par > HTML content. Unfortunately, there is no other way around the problem.
\par >
\par > If you are familiar with creating ATL controls, the process is pretty
\par > straightforward. Start by creating an ATL project and add a simple object
\par > to it - let's call the control "ComAdapter" and the object "ComObject".
\par > Then add the following method to the object:
\par >
\par > STDMETHODIMP GetInterface
\par > (
\par > /*[in]*/ BSTR bstrObj, // Name of the object
\par > /*[out, retval]*/ VARIANT *pvarObj // Returned object
\par > )
\par > \{
\par > CComPtr<IDispatch> pObj;
\par > IDispatch* pDispatch = NULL;
\par > HRESULT hr = pObj.CoCreateInstance( bstrObj );
\par >
\par > if( SUCCEEDED( hr ) )
\par > \{
\par > if( pObj )
\par > hr = pObj->QueryInterface( IID_IDispatch,
\par > (void**)&pDispatch );
\par > else
\par > hr = E_NOINTERFACE;
\par > \}
\par >
\par > VariantClear( pvarObj );
\par > V_VT( pvarObj ) = VT_DISPATCH;
\par > V_DISPATCH( pvarObj ) = pDispatch;
\par >
\par > return hr;
\par > \}
\par >
\par > Finally, you will need to make some changes to your HTML code - something
\par > like this:
\par >
\par > var objXML = new ActiveXObject( "ComAdapter.ComObject" );
\par > var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );\tab
\par > objRealXML.open( "POST", url, true );
\par >
\par >
\par > ---
\par >
\par > Nathan Lewis
\par > Microsoft Mobile and Embedded Devices Developer Support
\par >
\par > This posting is provided "AS IS" with no warranties, and confers no rights.
\par >
\par >
\par >
\par > --------------------
\par > From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
\par > Subject: XMLHTTP doesn't work, I'm getting access denied
\par > Date: Wed, 16 Feb 2005 05:19:03 -0800
\par >
\par >
\par > Hello,
\par >
\par > I need to write a web application for my pocket PC, here is part of the
\par > code I'm using:
\par >
\par > xrequest = new ActiveXObject("Microsoft.XMLHTTP");
\par > xrequest.open("POST",url,true );
\par >
\par > I'm getting access denied when trying to execute the open method.
\par >
\par > The same code works fine when running it using scripting host on the same
\par > pocket PC. Also, the same code works fine on another iPaq I have that uses
\par > win CE 4
\par >
\par > Trying to change the security setting in the registry didn't help.
\par >
\par > Can someone please help
\par >
\par > Thanks,
\par > Shlomi
\par >
\par >
\par \pard
\par
\par }
------=_NextPart_0001_2C1894F4--


RE: XMLHTTP doesn't work, I'm getting access denied by Working

Working
Fri Feb 18 06:19:01 CST 2005


Hi Mr. leweis.


I read your answer - but it's not complete, it is dealing only in one aspect
in the problem.

Ok, so we don't need to send the second parameter in the java script,

but in this parameter the reference to the object is should be returned.

so how there is a way to retrieve the object pointer???

the methods itself return an HRESULT type, which is actually a long.

how can we get the reference to the object that has been created in
GetInterface() method.


Example:

You gave us this code for using the object:

var objXML = new ActiveXObject( "ComAdapter.ComObject" );
var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );


In your example the objRealXML variable will hold a reference to the
"Microsoft.XMLHTTP" COM object, but the return value of the GetInterface()
is HRESULT , as declared in the idl file:

HRESULT GetInterface( [in] BSTR bstrObj, [out, retval] VARIANT*
pvarObj );


How can we get the VARIANT* pvarObj , which hold the reference to the
"Microsoft.XMLHTTP" COM object, from a Java Script code.

Thanks for your support,

Eli



"Nathan Lewis" wrote:

> If you specified the second parameter in the IDL using [out, retval], then
> you will only need one parameter in the JScript code. The correct IDL
> definition would be something like:
>
> [
> object,
> uuid( ...your GUID here... ),
> dual,
> helpstring("IComObject Interface"),
> pointer_default(unique)
> ]
> interface IComObject : IDispatch
> {
> [
> id(1),
> helpstring("Returns the requested object interface.")
> ]
> HRESULT GetInterface( [in] BSTR bstrObj, [out, retval] VARIANT*
> pvarObj );
> };
>
>
> I'm not sure if there are plans to create a sample for this workaround, but
> a KB has been requested.
>
>
> ---
>
> Nathan Lewis
> Microsoft Mobile and Embedded Devices Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
> --------------------
> From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
> Subject: RE: XMLHTTP doesn't work, I'm getting access denied
> Date: Thu, 17 Feb 2005 03:15:01 -0800
>
>
> I'm trying to implement your solution, I've created the dll and loaded it
> to
> the iPaq, I'm getting an error from Javascript for sending the wrong number
> of parameters for the GetInterface method. From what I understand
> GetInterface should return the object in pvarObj, who do I use that in
> Javascript?
>
> Does Microsoft intend to distribute a solution for this problem?
>
> "Nathan Lewis" wrote:
>
> > This is a known problem which affects certain builds of Pocket PC 2003
> and
> > all builds of Pocket PC 2003 Second Edition. The workaround is pretty
> > complicated, and involves creating an ActiveX control using ATL and
> > embedding it in the web page. Other than the complexity of the
> workaround,
> > the main disadvantage to this approach is that it means your end users
> must
> > download, install and register the ActiveX control before they can use
> your
> > HTML content. Unfortunately, there is no other way around the problem.
> >
> > If you are familiar with creating ATL controls, the process is pretty
> > straightforward. Start by creating an ATL project and add a simple
> object
> > to it - let's call the control "ComAdapter" and the object "ComObject".
> > Then add the following method to the object:
> >
> > STDMETHODIMP GetInterface
> > (
> > /*[in]*/ BSTR bstrObj, // Name of the object
> > /*[out, retval]*/ VARIANT *pvarObj // Returned object
> > )
> > {
> > CComPtr<IDispatch> pObj;
> > IDispatch* pDispatch = NULL;
> > HRESULT hr = pObj.CoCreateInstance( bstrObj );
> >
> > if( SUCCEEDED( hr ) )
> > {
> > if( pObj )
> > hr = pObj->QueryInterface( IID_IDispatch,
> > (void**)&pDispatch );
> > else
> > hr = E_NOINTERFACE;
> > }
> >
> > VariantClear( pvarObj );
> > V_VT( pvarObj ) = VT_DISPATCH;
> > V_DISPATCH( pvarObj ) = pDispatch;
> >
> > return hr;
> > }
> >
> > Finally, you will need to make some changes to your HTML code - something
> > like this:
> >
> > var objXML = new ActiveXObject( "ComAdapter.ComObject" );
> > var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );
> > objRealXML.open( "POST", url, true );
> >
> >
> > ---
> >
> > Nathan Lewis
> > Microsoft Mobile and Embedded Devices Developer Support
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> >
> >
> > --------------------
> > From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
> > Subject: XMLHTTP doesn't work, I'm getting access denied
> > Date: Wed, 16 Feb 2005 05:19:03 -0800
> >
> >
> > Hello,
> >
> > I need to write a web application for my pocket PC, here is part of the
> > code I'm using:
> >
> > xrequest = new ActiveXObject("Microsoft.XMLHTTP");
> > xrequest.open("POST",url,true );
> >
> > I'm getting access denied when trying to execute the open method.
> >
> > The same code works fine when running it using scripting host on the same
> > pocket PC. Also, the same code works fine on another iPaq I have that
> uses
> > win CE 4
> >
> > Trying to change the security setting in the registry didn't help.
> >
> > Can someone please help
> >
> > Thanks,
> > Shlomi
> >
> >
>

RE: XMLHTTP doesn't work, I'm getting access denied by a-nlewis

a-nlewis
Fri Feb 18 17:07:54 CST 2005

------=_NextPart_0001_31C96BB2
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

The JScript code will work correctly as shown. The "[out, retval]"
declaration specifies that the function will return the object directly.
If you wanted to access the HRESULT return value, you would have to do that
directly from a language such as C++. Please give it a try, and you will
see what I mean.


---

Nathan Lewis
Microsoft Mobile and Embedded Devices Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.



--------------------
From: =?Utf-8?B?V29ya2luZyB3aXRoIFNsb21p?= <Working with
Slomi@discussions.microsoft.com>
Subject: RE: XMLHTTP doesn't work, I'm getting access denied
Date: Fri, 18 Feb 2005 04:19:01 -0800


Hi Mr. leweis.


I read your answer - but it's not complete, it is dealing only in one
aspect
in the problem.

Ok, so we don't need to send the second parameter in the java script,

but in this parameter the reference to the object is should be returned.

so how there is a way to retrieve the object pointer???

the methods itself return an HRESULT type, which is actually a long.

how can we get the reference to the object that has been created in
GetInterface() method.


Example:

You gave us this code for using the object:

var objXML = new ActiveXObject( "ComAdapter.ComObject" );
var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );


In your example the objRealXML variable will hold a reference to the
"Microsoft.XMLHTTP" COM object, but the return value of the GetInterface()
is HRESULT , as declared in the idl file:

HRESULT GetInterface( [in] BSTR bstrObj, [out, retval] VARIANT*
pvarObj );


How can we get the VARIANT* pvarObj , which hold the reference to the
"Microsoft.XMLHTTP" COM object, from a Java Script code.

Thanks for your support,

Eli



"Nathan Lewis" wrote:

> If you specified the second parameter in the IDL using [out, retval],
then
> you will only need one parameter in the JScript code. The correct IDL
> definition would be something like:
>
> [
> object,
> uuid( ...your GUID here... ),
> dual,
> helpstring("IComObject Interface"),
> pointer_default(unique)
> ]
> interface IComObject : IDispatch
> {
> [
> id(1),
> helpstring("Returns the requested object interface.")
> ]
> HRESULT GetInterface( [in] BSTR bstrObj, [out, retval] VARIANT*
> pvarObj );
> };
>
>
> I'm not sure if there are plans to create a sample for this workaround,
but
> a KB has been requested.
>
>
> ---
>
> Nathan Lewis
> Microsoft Mobile and Embedded Devices Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
>
>
> --------------------
> From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
> Subject: RE: XMLHTTP doesn't work, I'm getting access denied
> Date: Thu, 17 Feb 2005 03:15:01 -0800
>
>
> I'm trying to implement your solution, I've created the dll and loaded it
> to
> the iPaq, I'm getting an error from Javascript for sending the wrong
number
> of parameters for the GetInterface method. From what I understand
> GetInterface should return the object in pvarObj, who do I use that in
> Javascript?
>
> Does Microsoft intend to distribute a solution for this problem?
>
> "Nathan Lewis" wrote:
>
> > This is a known problem which affects certain builds of Pocket PC 2003
> and
> > all builds of Pocket PC 2003 Second Edition. The workaround is pretty
> > complicated, and involves creating an ActiveX control using ATL and
> > embedding it in the web page. Other than the complexity of the
> workaround,
> > the main disadvantage to this approach is that it means your end users
> must
> > download, install and register the ActiveX control before they can use
> your
> > HTML content. Unfortunately, there is no other way around the problem.
> >
> > If you are familiar with creating ATL controls, the process is pretty
> > straightforward. Start by creating an ATL project and add a simple
> object
> > to it - let's call the control "ComAdapter" and the object "ComObject".

> > Then add the following method to the object:
> >
> > STDMETHODIMP GetInterface
> > (
> > /*[in]*/ BSTR bstrObj, // Name of the object
> > /*[out, retval]*/ VARIANT *pvarObj // Returned object
> > )
> > {
> > CComPtr<IDispatch> pObj;
> > IDispatch* pDispatch = NULL;
> > HRESULT hr = pObj.CoCreateInstance( bstrObj );
> >
> > if( SUCCEEDED( hr ) )
> > {
> > if( pObj )
> > hr = pObj->QueryInterface( IID_IDispatch,
> > (void**)&pDispatch );
> > else
> > hr = E_NOINTERFACE;
> > }
> >
> > VariantClear( pvarObj );
> > V_VT( pvarObj ) = VT_DISPATCH;
> > V_DISPATCH( pvarObj ) = pDispatch;
> >
> > return hr;
> > }
> >
> > Finally, you will need to make some changes to your HTML code -
something
> > like this:
> >
> > var objXML = new ActiveXObject( "ComAdapter.ComObject" );
> > var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );
> > objRealXML.open( "POST", url, true );
> >
> >
> > ---
> >
> > Nathan Lewis
> > Microsoft Mobile and Embedded Devices Developer Support
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> >
> >
> > --------------------
> > From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
> > Subject: XMLHTTP doesn't work, I'm getting access denied
> > Date: Wed, 16 Feb 2005 05:19:03 -0800
> >
> >
> > Hello,
> >
> > I need to write a web application for my pocket PC, here is part of
the
> > code I'm using:
> >
> > xrequest = new ActiveXObject("Microsoft.XMLHTTP");
> > xrequest.open("POST",url,true );
> >
> > I'm getting access denied when trying to execute the open method.
> >
> > The same code works fine when running it using scripting host on the
same
> > pocket PC. Also, the same code works fine on another iPaq I have that
> uses
> > win CE 4
> >
> > Trying to change the security setting in the registry didn't help.
> >
> > Can someone please help
> >
> > Thanks,
> > Shlomi
> >
> >
>

------=_NextPart_0001_31C96BB2
Content-Type: text/x-rtf
Content-Transfer-Encoding: 7bit

{\rtf1\ansi\ansicpg1252\deff0\deflang1033{\fonttbl{\f0\fnil\fprq2\fcharset0 MS Sans Serif;}}
\viewkind4\uc1\pard\f0\fs20 The JScript code will work correctly as shown. The "[out, retval]" declaration specifies that the function will return the object directly. If you wanted to access the HRESULT return value, you would have to do that directly from a language such as C++. Please give it a try, and you will see what I mean.
\par
\par
\par ---
\par
\par Nathan Lewis
\par Microsoft Mobile and Embedded Devices Developer Support
\par
\par This posting is provided "AS IS" with no warranties, and confers no rights.
\par
\par
\par
\par \pard\li720 --------------------
\par From: =?Utf-8?B?V29ya2luZyB3aXRoIFNsb21p?= <Working with Slomi@discussions.microsoft.com>
\par Subject: RE: XMLHTTP doesn't work, I'm getting access denied
\par Date: Fri, 18 Feb 2005 04:19:01 -0800
\par
\par
\par Hi Mr. leweis.
\par
\par
\par I read your answer - but it's not complete, it is dealing only in one aspect
\par in the problem.
\par
\par Ok, so we don't need to send the second parameter in the java script,
\par
\par but in this parameter the reference to the object is should be returned.
\par
\par so how there is a way to retrieve the object pointer???
\par
\par the methods itself return an HRESULT type, which is actually a long.
\par
\par how can we get the reference to the object that has been created in
\par GetInterface() method.
\par
\par
\par Example:
\par
\par You gave us this code for using the object:
\par
\par var objXML = new ActiveXObject( "ComAdapter.ComObject" );
\par var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );
\par
\par
\par In your example the objRealXML variable will hold a reference to the
\par "Microsoft.XMLHTTP" COM object, but the return value of the GetInterface()
\par is HRESULT , as declared in the idl file:
\par
\par HRESULT GetInterface( [in] BSTR bstrObj, [out, retval] VARIANT*
\par pvarObj );
\par
\par
\par How can we get the VARIANT* pvarObj , which hold the reference to the
\par "Microsoft.XMLHTTP" COM object, from a Java Script code.
\par
\par Thanks for your support,
\par
\par Eli
\par
\par
\par
\par "Nathan Lewis" wrote:
\par
\par > If you specified the second parameter in the IDL using [out, retval], then
\par > you will only need one parameter in the JScript code. The correct IDL
\par > definition would be something like:
\par >
\par > [
\par > object,
\par > uuid( ...your GUID here... ),
\par > dual,
\par > helpstring("IComObject Interface"),
\par > pointer_default(unique)
\par > ]
\par > interface IComObject : IDispatch
\par > \{
\par > [
\par > id(1),
\par > helpstring("Returns the requested object interface.")
\par > ]
\par > HRESULT GetInterface( [in] BSTR bstrObj, [out, retval] VARIANT*
\par > pvarObj );
\par > \};
\par >
\par >
\par > I'm not sure if there are plans to create a sample for this workaround, but
\par > a KB has been requested.
\par >
\par >
\par > ---
\par >
\par > Nathan Lewis
\par > Microsoft Mobile and Embedded Devices Developer Support
\par >
\par > This posting is provided "AS IS" with no warranties, and confers no rights.
\par >
\par >
\par >
\par > --------------------
\par > From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
\par > Subject: RE: XMLHTTP doesn't work, I'm getting access denied
\par > Date: Thu, 17 Feb 2005 03:15:01 -0800
\par >
\par >
\par > I'm trying to implement your solution, I've created the dll and loaded it
\par > to
\par > the iPaq, I'm getting an error from Javascript for sending the wrong number
\par > of parameters for the GetInterface method. From what I understand
\par > GetInterface should return the object in pvarObj, who do I use that in
\par > Javascript?
\par >
\par > Does Microsoft intend to distribute a solution for this problem?
\par >
\par > "Nathan Lewis" wrote:
\par >
\par > > This is a known problem which affects certain builds of Pocket PC 2003
\par > and
\par > > all builds of Pocket PC 2003 Second Edition. The workaround is pretty
\par > > complicated, and involves creating an ActiveX control using ATL and
\par > > embedding it in the web page. Other than the complexity of the
\par > workaround,
\par > > the main disadvantage to this approach is that it means your end users
\par > must
\par > > download, install and register the ActiveX control before they can use
\par > your
\par > > HTML content. Unfortunately, there is no other way around the problem.
\par > >
\par > > If you are familiar with creating ATL controls, the process is pretty
\par > > straightforward. Start by creating an ATL project and add a simple
\par > object
\par > > to it - let's call the control "ComAdapter" and the object "ComObject".
\par > > Then add the following method to the object:
\par > >
\par > > STDMETHODIMP GetInterface
\par > > (
\par > > /*[in]*/ BSTR bstrObj, // Name of the object
\par > > /*[out, retval]*/ VARIANT *pvarObj // Returned object
\par > > )
\par > > \{
\par > > CComPtr<IDispatch> pObj;
\par > > IDispatch* pDispatch = NULL;
\par > > HRESULT hr = pObj.CoCreateInstance( bstrObj );
\par > >
\par > > if( SUCCEEDED( hr ) )
\par > > \{
\par > > if( pObj )
\par > > hr = pObj->QueryInterface( IID_IDispatch,
\par > > (void**)&pDispatch );
\par > > else
\par > > hr = E_NOINTERFACE;
\par > > \}
\par > >
\par > > VariantClear( pvarObj );
\par > > V_VT( pvarObj ) = VT_DISPATCH;
\par > > V_DISPATCH( pvarObj ) = pDispatch;
\par > >
\par > > return hr;
\par > > \}
\par > >
\par > > Finally, you will need to make some changes to your HTML code - something
\par > > like this:
\par > >
\par > > var objXML = new ActiveXObject( "ComAdapter.ComObject" );
\par > > var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );\tab
\par > > objRealXML.open( "POST", url, true );
\par > >
\par > >
\par > > ---
\par > >
\par > > Nathan Lewis
\par > > Microsoft Mobile and Embedded Devices Developer Support
\par > >
\par > > This posting is provided "AS IS" with no warranties, and confers no
\par > rights.
\par > >
\par > >
\par > >
\par > > --------------------
\par > > From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
\par > > Subject: XMLHTTP doesn't work, I'm getting access denied
\par > > Date: Wed, 16 Feb 2005 05:19:03 -0800
\par > >
\par > >
\par > > Hello,
\par > >
\par > > I need to write a web application for my pocket PC, here is part of the
\par > > code I'm using:
\par > >
\par > > xrequest = new ActiveXObject("Microsoft.XMLHTTP");
\par > > xrequest.open("POST",url,true );
\par > >
\par > > I'm getting access denied when trying to execute the open method.
\par > >
\par > > The same code works fine when running it using scripting host on the same
\par > > pocket PC. Also, the same code works fine on another iPaq I have that
\par > uses
\par > > win CE 4
\par > >
\par > > Trying to change the security setting in the registry didn't help.
\par > >
\par > > Can someone please help
\par > >
\par > > Thanks,
\par > > Shlomi
\par > >
\par > >
\par >
\par \pard
\par
\par }
------=_NextPart_0001_31C96BB2--


RE: XMLHTTP doesn't work, I'm getting access denied by Shlomi

Shlomi
Sun Feb 20 04:33:02 CST 2005

I'm sorry but it is not working. First, calling the function with only one
parameter ends in an error saying this is the wrong number of parameters.
I've add another parameter just so the function will be called correctly and
it did, but I'm getting "undefined" in the return object: objRealXML.

Just out of curiosity, am I the first one to encounter this problem? Is
Microsoft going to develope a patch for this problem? XML functionality is
basic especialy in the mobile world...

"Nathan Lewis" wrote:

> The JScript code will work correctly as shown. The "[out, retval]"
> declaration specifies that the function will return the object directly.
> If you wanted to access the HRESULT return value, you would have to do that
> directly from a language such as C++. Please give it a try, and you will
> see what I mean.
>
>
> ---
>
> Nathan Lewis
> Microsoft Mobile and Embedded Devices Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
>
> --------------------
> From: =?Utf-8?B?V29ya2luZyB3aXRoIFNsb21p?= <Working with
> Slomi@discussions.microsoft.com>
> Subject: RE: XMLHTTP doesn't work, I'm getting access denied
> Date: Fri, 18 Feb 2005 04:19:01 -0800
>
>
> Hi Mr. leweis.
>
>
> I read your answer - but it's not complete, it is dealing only in one
> aspect
> in the problem.
>
> Ok, so we don't need to send the second parameter in the java script,
>
> but in this parameter the reference to the object is should be returned.
>
> so how there is a way to retrieve the object pointer???
>
> the methods itself return an HRESULT type, which is actually a long.
>
> how can we get the reference to the object that has been created in
> GetInterface() method.
>
>
> Example:
>
> You gave us this code for using the object:
>
> var objXML = new ActiveXObject( "ComAdapter.ComObject" );
> var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );
>
>
> In your example the objRealXML variable will hold a reference to the
> "Microsoft.XMLHTTP" COM object, but the return value of the GetInterface()
> is HRESULT , as declared in the idl file:
>
> HRESULT GetInterface( [in] BSTR bstrObj, [out, retval] VARIANT*
> pvarObj );
>
>
> How can we get the VARIANT* pvarObj , which hold the reference to the
> "Microsoft.XMLHTTP" COM object, from a Java Script code.
>
> Thanks for your support,
>
> Eli
>
>
>
> "Nathan Lewis" wrote:
>
> > If you specified the second parameter in the IDL using [out, retval],
> then
> > you will only need one parameter in the JScript code. The correct IDL
> > definition would be something like:
> >
> > [
> > object,
> > uuid( ...your GUID here... ),
> > dual,
> > helpstring("IComObject Interface"),
> > pointer_default(unique)
> > ]
> > interface IComObject : IDispatch
> > {
> > [
> > id(1),
> > helpstring("Returns the requested object interface.")
> > ]
> > HRESULT GetInterface( [in] BSTR bstrObj, [out, retval] VARIANT*
> > pvarObj );
> > };
> >
> >
> > I'm not sure if there are plans to create a sample for this workaround,
> but
> > a KB has been requested.
> >
> >
> > ---
> >
> > Nathan Lewis
> > Microsoft Mobile and Embedded Devices Developer Support
> >
> > This posting is provided "AS IS" with no warranties, and confers no
> rights.
> >
> >
> >
> > --------------------
> > From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
> > Subject: RE: XMLHTTP doesn't work, I'm getting access denied
> > Date: Thu, 17 Feb 2005 03:15:01 -0800
> >
> >
> > I'm trying to implement your solution, I've created the dll and loaded it
> > to
> > the iPaq, I'm getting an error from Javascript for sending the wrong
> number
> > of parameters for the GetInterface method. From what I understand
> > GetInterface should return the object in pvarObj, who do I use that in
> > Javascript?
> >
> > Does Microsoft intend to distribute a solution for this problem?
> >
> > "Nathan Lewis" wrote:
> >
> > > This is a known problem which affects certain builds of Pocket PC 2003
> > and
> > > all builds of Pocket PC 2003 Second Edition. The workaround is pretty
> > > complicated, and involves creating an ActiveX control using ATL and
> > > embedding it in the web page. Other than the complexity of the
> > workaround,
> > > the main disadvantage to this approach is that it means your end users
> > must
> > > download, install and register the ActiveX control before they can use
> > your
> > > HTML content. Unfortunately, there is no other way around the problem.
> > >
> > > If you are familiar with creating ATL controls, the process is pretty
> > > straightforward. Start by creating an ATL project and add a simple
> > object
> > > to it - let's call the control "ComAdapter" and the object "ComObject".
>
> > > Then add the following method to the object:
> > >
> > > STDMETHODIMP GetInterface
> > > (
> > > /*[in]*/ BSTR bstrObj, // Name of the object
> > > /*[out, retval]*/ VARIANT *pvarObj // Returned object
> > > )
> > > {
> > > CComPtr<IDispatch> pObj;
> > > IDispatch* pDispatch = NULL;
> > > HRESULT hr = pObj.CoCreateInstance( bstrObj );
> > >
> > > if( SUCCEEDED( hr ) )
> > > {
> > > if( pObj )
> > > hr = pObj->QueryInterface( IID_IDispatch,
> > > (void**)&pDispatch );
> > > else
> > > hr = E_NOINTERFACE;
> > > }
> > >
> > > VariantClear( pvarObj );
> > > V_VT( pvarObj ) = VT_DISPATCH;
> > > V_DISPATCH( pvarObj ) = pDispatch;
> > >
> > > return hr;
> > > }
> > >
> > > Finally, you will need to make some changes to your HTML code -
> something
> > > like this:
> > >
> > > var objXML = new ActiveXObject( "ComAdapter.ComObject" );
> > > var objRealXML = objXML.GetInterface( "Microsoft.XMLHTTP" );
> > > objRealXML.open( "POST", url, true );
> > >
> > >
> > > ---
> > >
> > > Nathan Lewis
> > > Microsoft Mobile and Embedded Devices Developer Support
> > >
> > > This posting is provided "AS IS" with no warranties, and confers no
> > rights.
> > >
> > >
> > >
> > > --------------------
> > > From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
> > > Subject: XMLHTTP doesn't work, I'm getting access denied
> > > Date: Wed, 16 Feb 2005 05:19:03 -0800
> > >
> > >
> > > Hello,
> > >
> > > I need to write a web application for my pocket PC, here is part of
> the
> > > code I'm using:
> > >
> > > xrequest = new ActiveXObject("Microsoft.XMLHTTP");
> > > xrequest.open("POST",url,true );
> > >
> > > I'm getting access denied when trying to execute the open method.
> > >
> > > The same code works fine when running it using scripting host on the
> same
> > > pocket PC. Also, the same code works fine on another iPaq I have that
> > uses
> > > win CE 4
> > >
> > > Trying to change the security setting in the registry didn't help.
> > >
> > > Can someone please help
> > >
> > > Thanks,
> > > Shlomi
> > >
> > >
> >
>

RE: XMLHTTP doesn't work, I'm getting access denied by Shlomi

Shlomi
Sun Mar 06 08:07:02 CST 2005

Thank you for your answer. I can't find the attachment though

"Nathan Lewis" wrote:

> (Clipping off some text to reduce the size of this post...)
>
> I have attached a small (and unsupported - see disclaimer in source files)
> sample which demonstrates the workaround I described. Take a look at the
> 'Test.htm' included in the ZIP for an example of how to use the control in
> your HTML.
>
> No, you're not the first to encounter the problem. A KB has been requested
> to address the problem, but I don't know when it may be published or what
> information it will contain, sorry.
>
>
> ---
>
> Nathan Lewis
> Microsoft Mobile and Embedded Devices Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no rights.
>
>
> --------------------
> From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
> Subject: RE: XMLHTTP doesn't work, I'm getting access denied
> Date: Sun, 20 Feb 2005 02:33:02 -0800
>
>
> I'm sorry but it is not working. First, calling the function with only one
> parameter ends in an error saying this is the wrong number of parameters.
> I've add another parameter just so the function will be called correctly
> and
> it did, but I'm getting "undefined" in the return object: objRealXML.
>
> Just out of curiosity, am I the first one to encounter this problem? Is
> Microsoft going to develope a patch for this problem? XML functionality is
> basic especialy in the mobile world..

RE: XMLHTTP doesn't work, I'm getting access denied by a-nlewis

a-nlewis
Mon Mar 07 12:54:39 CST 2005

------=_NextPart_0001_33FB823A
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

I think that is probably related to your news reader software - it shows up
fine in the news reader we use here, and also in Outlook Express. Try
setting up OE using msnew.microsoft.com as the NNTP host, subscribe to this
newsgroup and look up my message.


---

Nathan Lewis
Microsoft Mobile and Embedded Devices Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.




--------------------
From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
Subject: RE: XMLHTTP doesn't work, I'm getting access denied
Date: Sun, 6 Mar 2005 06:07:02 -0800


Thank you for your answer. I can't find the attachment though

"Nathan Lewis" wrote:

> (Clipping off some text to reduce the size of this post...)
>
> I have attached a small (and unsupported - see disclaimer in source
files)
> sample which demonstrates the workaround I described. Take a look at the
> 'Test.htm' included in the ZIP for an example of how to use the control
in
> your HTML.
>
> No, you're not the first to encounter the problem. A KB has been
requested
> to address the problem, but I don't know when it may be published or what
> information it will contain, sorry.
>
>
> ---
>
> Nathan Lewis
> Microsoft Mobile and Embedded Devices Developer Support
>
> This posting is provided "AS IS" with no warranties, and confers no
rights.
>
>
> --------------------
> From: =?Utf-8?B?U2hsb21p?= <Shlomi@discussions.microsoft.com>
> Subject: RE: XMLHTTP doesn't work, I'm getting access denied
> Date: Sun, 20 Feb 2005 02:33:02 -0800
>
>
> I'm sorry but it is not working. First, calling the function with only
one
> parameter ends in an error saying this is the wrong number of parameters.
> I've add another parameter just so the function will be called correctly
> and
> it did, but I'm getting "undefined" in the return object: objRealXML.
>
> Just out of curiosity, am I the first one to encounter this problem? Is
> Microsoft going to develope a patch for this problem? XML functionality
is
> basic especialy in the mobile world..

------=_NextPart_0001_33FB823A
Content-Type: text/x-rtf
Content-Transfer-