|
|
|
date: Tue, 08 Jul 2008 23:44:44 +0800,
group: microsoft.public.inetsdk.programming.webbrowser_ctl
back
Re: how can I get postdata in ActiveX
kevin <bborn.pisces+ms@gmail.com> wrote:
> there is a link, and link to a web page include an activex control,
> in the activex control, how can i know what is the method of the link
> ? post or get?
> if the post,how can get the postdata?
> thanks.
If I understand you correctly, you have an HTML page (let's call it page
A). This page has a link or a form. When the user clicks on this link or
submits this form, the server generates another HTML page - page B. On
page B, there's an ActiveX control. You want the control to know the
details of the request that caused the server to return page B.
I don't know of any way to do it from inside the page. However, the
server definitely knows what request with what parameters caused it to
generate page B. Can't it place the data your control needs into the
HTML text, e.g. in the form of <param> tags?
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
date: Tue, 8 Jul 2008 16:43:52 -0400
author: Igor Tandetnik
Re: how can I get postdata in ActiveX
if the activex is a pdf reader ocx, and if user click the link page A, the
server generates page B, Page B is a pdf file, so how do download the pdf
files in the activex?
i think it 's should use UrlDownloadToCacheFile, but if the link use POST
method, UrlDownloadToCacheFile need the postdate
"Igor Tandetnik" wrote:
> kevin <bborn.pisces+ms@gmail.com> wrote:
> > there is a link, and link to a web page include an activex control,
> > in the activex control, how can i know what is the method of the link
> > ? post or get?
> > if the post,how can get the postdata?
> > thanks.
>
> If I understand you correctly, you have an HTML page (let's call it page
> A). This page has a link or a form. When the user clicks on this link or
> submits this form, the server generates another HTML page - page B. On
> page B, there's an ActiveX control. You want the control to know the
> details of the request that caused the server to return page B.
>
> I don't know of any way to do it from inside the page. However, the
> server definitely knows what request with what parameters caused it to
> generate page B. Can't it place the data your control needs into the
> HTML text, e.g. in the form of <param> tags?
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
>
>
date: Wed, 9 Jul 2008 00:41:01 -0700
author: bborn
Re: how can I get postdata in ActiveX
"bborn" wrote in message
news:C144EECD-FE95-415D-8695-A5241E8FC3E6@microsoft.com
> if the activex is a pdf reader ocx, and if user click the link page
> A, the server generates page B, Page B is a pdf file, so how do
> download the pdf files in the activex?
I don't understand this question. In my experience, it just works: I
click on a link to a PDF file (whether static or dynamically generated),
and my browser loads Acrobat Reader and displays this file. What exactly
seems to be the problem?
> i think it 's should use UrlDownloadToCacheFile, but if the link use
> POST method, UrlDownloadToCacheFile need the postdate
See KB article KB165800 "SAMPLE: PostMon.exe Demonstrates How to Use URL
Moniker to POST Data". Hope this helps, though I still don't understand
what you are trying to do.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
date: Wed, 9 Jul 2008 07:45:46 -0400
author: Igor Tandetnik
Re: how can I get postdata in ActiveX
Igor Tandetnik дµÀ:
> "bborn" wrote in message
> news:C144EECD-FE95-415D-8695-A5241E8FC3E6@microsoft.com
>> if the activex is a pdf reader ocx, and if user click the link page
>> A, the server generates page B, Page B is a pdf file, so how do
>> download the pdf files in the activex?
>
> I don't understand this question. In my experience, it just works: I
> click on a link to a PDF file (whether static or dynamically generated),
> and my browser loads Acrobat Reader and displays this file. What exactly
> seems to be the problem?
yes, but acrobat reader how to download the file. because the IE don't
download the pdf file.
see MimeType.exe makes ActiveX object default MIME type player
http://support.microsoft.com/kb/165072/en-us/
if the method is "Get", activex can get the url of the pdf file from
PX_String(pPX, "SRC", m_strURL);
if the method is "Post", strURL is the IE local cache path.
>> i think it 's should use UrlDownloadToCacheFile, but if the link use
>> POST method, UrlDownloadToCacheFile need the postdate
>
> See KB article KB165800 "SAMPLE: PostMon.exe Demonstrates How to Use URL
> Moniker to POST Data". Hope this helps, though I still don't understand
> what you are trying to do.
I read it, and I post successful. but the question is how to get the
postdata.
thank you for you reply! I need your help.
date: Wed, 09 Jul 2008 20:44:01 +0800
author: kevin bborn.pisces+
Re: how can I get postdata in ActiveX
"kevin" <bborn.pisces+ms@gmail.com> wrote in message
news:Ob81%23Fc4IHA.1196@TK2MSFTNGP05.phx.gbl
> see MimeType.exe makes ActiveX object default MIME type player
> http://support.microsoft.com/kb/165072/en-us/
>
> if the method is "Get", activex can get the url of the pdf file from
>
> PX_String(pPX, "SRC", m_strURL);
>
> if the method is "Post", strURL is the IE local cache path.
Either way, you have your content. Why do you care about the POST data
used to generate it? What are you trying to achieve?
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
date: Wed, 9 Jul 2008 09:07:38 -0400
author: Igor Tandetnik
Re: how can I get postdata in ActiveX
this is the code from kb223500, I think it's download by IMoniker
pimkName->BindToStorage(pibc, NULL, IID_IStream, (void**)&m_pStream);
STDMETHOD(LoadFromMoniker)(LPMONIKER pimkName, LPBC pibc)
{
USES_CONVERSION;
LPOLESTR pszURL;
BOOL bSuccess;
DWORD dwError;
pimkName->GetDisplayName(pibc, NULL, &pszURL);
m_pszURL = _tcsdup(W2T(pszURL));
// FTP! If we have a non-HTTP server, we can't do byte range!
// check scheme - http, ftp, ?
URL_COMPONENTS urlComponents;
memset(&urlComponents, 0, sizeof(URL_COMPONENTS));
urlComponents.dwStructSize = sizeof(URL_COMPONENTS);
bSuccess = InternetCrackUrl(m_pszURL, 0, 0, &urlComponents);
TESTRESULT(bSuccess, _T("IPSI::IN ICU"));
//if (INTERNET_SCHEME_HTTP == urlComponents.nScheme)
//{
// use byte ranges to obtain Central Directory
// uses class var m_DataBuffer
// bSuccess = CentralDirectoryRangeHelper();
//}
//else // No byte range support
{
pimkName->BindToStorage(pibc, NULL, IID_IStream, (void**)&m_pStream);
bSuccess = CentralDirectoryStreamHelper();
}
SendOnDataChange();
Cleanup:
if (bSuccess)
return S_OK;
else
return E_FAIL;
}
"Igor Tandetnik" wrote:
> "kevin" <bborn.pisces+ms@gmail.com> wrote in message
> news:O0T$Ajp4IHA.4916@TK2MSFTNGP06.phx.gbl
> > Igor Tandetnik ??:
> >> kevin <bborn.pisces+ms@gmail.com> wrote:
> >>
> >> Implement IPersistMoniker. This way, you are given a URL moniker in
> >> IPersistMoniker::Load (already set up with the URL and the post data
> >> as necessary) and you get to download from it yourself.
> >
> >
> > I found a sample at ms.
> > http://support.microsoft.com/kb/223500/en-us
> > It's implement IPersistMoniker::Load ,but it's still can't get the
> > info ...
>
> This sample doesn't use the moniker for actual download. It just
> extracts a URL from it, and then runs its own separate request using
> WinInet (losing any post data in the process).
>
> Use the moniker for download, e.g. as shown in KB165800. Skip the parts
> where the request is set up - that's already done for you. Proceed
> directly to the point where the response data is retrieved.
> --
> With best wishes,
> Igor Tandetnik
>
> With sufficient thrust, pigs fly just fine. However, this is not
> necessarily a good idea. It is hard to be sure where they are going to
> land, and it could be dangerous sitting under them as they fly
> overhead. -- RFC 1925
>
>
>
date: Thu, 10 Jul 2008 20:40:01 -0700
author: bborn
Re: how can I get postdata in ActiveX
"bborn" wrote in message
news:5CA752B7-0D62-4412-8CE7-FAE2636D2B05@microsoft.com
> this is the code from kb223500, I think it's download by IMoniker
> pimkName->BindToStorage(pibc, NULL, IID_IStream, (void**)&m_pStream);
Yes it does, but only if the request is not using HTTP protocol
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925
date: Sat, 12 Jul 2008 01:09:52 -0400
author: Igor Tandetnik
Re: how can I get postdata in ActiveX
Igor Tandetnik дµÀ:
> "bborn" wrote in message
> news:5CA752B7-0D62-4412-8CE7-FAE2636D2B05@microsoft.com
>> this is the code from kb223500, I think it's download by IMoniker
>> pimkName->BindToStorage(pibc, NULL, IID_IStream, (void**)&m_pStream);
>
> Yes it does, but only if the request is not using HTTP protocol
so i modify the code and let it direct use BindToStorage, is right?
or can you give me a sample? thank you.
//if (INTERNET_SCHEME_HTTP == urlComponents.nScheme)
//{
// use byte ranges to obtain Central Directory
// uses class var m_DataBuffer
// bSuccess = CentralDirectoryRangeHelper();
//}
//else // No byte range support
{
pimkName->BindToStorage(pibc, NULL, IID_IStream, (void**)&m_pStream);
bSuccess = CentralDirectoryStreamHelper();
}
date: Sat, 12 Jul 2008 17:11:18 +0800
author: kevin bborn.pisces+
|
|