how do I make a request to .aspx page from vc? 
Author Message
 how do I make a request to .aspx page from vc?

Hi.

What I am trying to do is to check if a user is logged in to my site
from in the ActiveX module by requesting an authorization result from
a .aspx page, but I don't see anyway to make a .aspx page request from
vc++.

I tried using libwww with WWW_HTML type, but it just returns an html
page (without going through server processing of .aspx).

How do I make a http request to a .aspx page from c++?



Sat, 17 Sep 2005 16:56:01 GMT  
 how do I make a request to .aspx page from vc?

Quote:

> Hi.

> What I am trying to do is to check if a user is logged in to my site
> from in the ActiveX module by requesting an authorization result from
> a .aspx page, but I don't see anyway to make a .aspx page request from
> vc++.

> I tried using libwww with WWW_HTML type, but it just returns an html
> page (without going through server processing of .aspx).

> How do I make a http request to a .aspx page from c++?

You send an HTTP request for the page to port 80, like you would any other
web resource.

There are a number of options:

1. Use libwww - the technique you described should work.  If it didn't,
there's a problem in how you're using libwww.  I wouldn't recommend this
approach: libwww is large, complex, badly documented and poor performing.
But it should work.

2. Use WinHTTP.  This is probably the easiest solution, but it requires that
your clients (the PCs hosting your activex control) have WinHTTP installed
(which may require them to download it).  See
http://msdn.microsoft.com/library/en-us/winhttp/http/portal.asp?frame...
for information about WinHTTP.

3. Use WinInet.  WinInet is the network library used by Internet Explorer
itself and is already present on any computer hosting Internet Explorer.

3a. ... through MFC.  MFC provides a servies of classes that wrap the
WinInet API.  See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wcem...
chttpcon.asp.

3b. ... directly.  WinInet exposes a C API that you can call directly.  See
http://msdn.microsoft.com/library/en-us/wininet/wininet/portal.asp?fr...
e.

Since you're trying to run an .aspx page in an existing session, you need to
pass the session information along from the browser to the activex control
so that it can pass it on to the .aspx server.  Again, there are a number of
choices:

a. If your ASP.NET application is using URL-based session tracking, then you
simply append the session parameter from the page's query string onto
whatever URL your control wants to invoke.

b. If your ASP.NET applicating is using cookie-based session tracking, then
you need to pass all the cookies from the browser to the activex control so
that they may be included in the request(s) that the control makes.  If you
use WinInet (either technique), you may be able to skip this step, because
WinInet and Internet Explorer share a single cookie cache.

-cd



Sat, 17 Sep 2005 22:55:42 GMT  
 how do I make a request to .aspx page from vc?
Thanks.. I rewrote everything using wininet.

-jae-



Mon, 19 Sep 2005 19:28:03 GMT  
 how do I make a request to .aspx page from vc?

--------------------

Quote:

>Newsgroups: microsoft.public.dotnet.languages.vc
>Subject: Re: how do I make a request to .aspx page from vc?
>Date: 3 Apr 2003 03:28:03 -0800
>Organization: http://groups.google.com/
>Lines: 3




Quote:
>NNTP-Posting-Host: 24.24.134.65
>Content-Type: text/plain; charset=ISO-8859-1
>Content-Transfer-Encoding: 8bit
>X-Trace: posting.google.com 1049369284 14816 127.0.0.1 (3 Apr 2003
11:28:04 GMT)

>NNTP-Posting-Date: 3 Apr 2003 11:28:04 GMT
>Path:

cpmsftngxa08.phx.gbl!cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfeed00.su
l.t-online.de!t-online.de!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!sn
-xit-03!sn-xit-06!sn-xit-09!supernews.com!postnews1.google.com!not-for-mail

Quote:
>Xref: cpmsftngxa08.phx.gbl microsoft.public.dotnet.languages.vc:21741
>X-Tomcat-NG: microsoft.public.dotnet.languages.vc

>Thanks.. I rewrote everything using wininet.

>-jae-

Be aware that WinInet is not suitable for server side applications, because
there's a limit to the 4 concurrent connection in the same process.
WinHTTP is much more scalable, but not as readily available as WinInet.
You can also use the CAtlHttpClient class from ATL Server.

--
Anson Tsao, Visual C++ Team
This posting is provided AS IS with no warranties, and confers no rights.



Sun, 25 Sep 2005 02:43:14 GMT  
 how do I make a request to .aspx page from vc?
Thanks for the info.

I wonder, however, would I need to distribute anything else other than my .ocx
for my activeX to run on old machines like win 95?

Do I need to make the user to install anything else?? like wininet.dll(?)



Fri, 07 Oct 2005 07:52:18 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. HELP: Intercepting HTTP Request, Showing Login Page, and Continuing with Original Request

2. VC++ and aspx pages

3. Populate ClipBoard from TextField on ASPX Page?

4. Trouble accessing DataSet from aspx page

5. Start Process Behind ASPX Page

6. How to get current directory in aspx page?

7. Use ENTER on a aspx-page with multiple usercontrols

8. Communication between ASPX and ASP pages

9. apache ProxyPass breaks with .NET aspx pages

10. FileStream in aspx: can I program page breaks?

11. Formatting datetime parameter in aspx page

12. Has anybody accessed Outlook from an ASPX page?

 

 
Powered by phpBB® Forum Software