CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 1 of 2 12 LastLast
Results 1 to 15 of 30

Thread: HTTP Request

  1. #1
    Join Date
    Apr 2005
    Posts
    1,828

    HTTP Request

    Can someone suggest me a way to use HTTP Request in pure VC++, without using any .NET framework?

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

  3. #3
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: HTTP Request

    Best regards,
    Igor

  4. #4
    Join Date
    Apr 2005
    Posts
    1,828

    Re: HTTP Request

    Thanks those links were helpful. Can you additionally suggest me, how can i communicate with a Chrome toolbar using this HTTPInterface?

  5. #5
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: HTTP Request

    AFAIK HTTPInterface is to communicate with WebInet (HTTP), not with the browser items.
    Read the Chrome documentation if you want to communicate with a Chrome toolbar.
    Victor Nijegorodov

  6. #6
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: HTTP Request

    Quote Originally Posted by maverick786us View Post
    Can you additionally suggest me, how can i communicate with a Chrome toolbar using this HTTPInterface?
    HTTP requests are issued by web client apps for communication with web servers. Chrome is not server, as it is a browser, and therefore it issues HTTP requests by itself.

    You have to explain in detail what you really mean by "communicate with a Chrome toolbar"
    Best regards,
    Igor

  7. #7
    Join Date
    Apr 2005
    Posts
    1,828

    Re: HTTP Request

    The examples that you provided me uses WinINet class. I just came across this article.

    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx

    Provided by my client, and he said that "WinINet does not support server implementations. In addition, it should not be used from a service. For server implementations or services use Microsoft Windows HTTP Services (WinHTTP)"

    So is there a way i can make HTTP Request using Windows HTTP?

  8. #8
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: HTTP Request

    Quote Originally Posted by maverick786us View Post
    ...
    So is there a way i can make HTTP Request using Windows HTTP?
    Well, if you already have a working code using WinINet then you can port it to WinHTTP:
    http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
    If not - then develop your "server implementations or services" using WinHTTP from the very begin.
    Victor Nijegorodov

  9. #9
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: HTTP Request

    WinInet is by far the easiest method to implement simple HTTP request in part because the whole configuration is delegated to using the built- in internet config (the same one used as IE).

    "porting" WinInet to WinHTTP is made overly simple in the document linked above. It's typically much more complex in practice to get your code to use WinHTTP and to get WinHTTP to just work. Especially if you need to deal with proxies, HTTPS and security in general, WinHTTP can quickly require a lot more code to do things.

    Also note that WinHTTP is for the "client" side of the HTTP story (requesting/getting/downloading pages) and not for the server side (hosting a website). You wouldn't be the first to confuse the meaning of the word service/server in this context.


    If you want to host a website/serve data via http, then you want the "Windows HTTP Server API" (http://msdn.microsoft.com/en-us/libr...v=vs.85).aspx).


    Note that all of the above are higher level API's. YOu can also do everything you want by doing network communication over sockets (this is how a browser like Chrome does it). THe advantage of a socket implementation is that your code can be made portable to run on Linux or other OS, whereas the above api's are all exclusive to Windows platforms. Obviously, doing it with sockets means you'll have to handle all the low level stuff yourself.

  10. #10
    Join Date
    Apr 2005
    Posts
    1,828

    Re: HTTP Request

    Quote Originally Posted by OReubens View Post
    Note that all of the above are higher level API's. YOu can also do everything you want by doing network communication over sockets (this is how a browser like Chrome does it). THe advantage of a socket implementation is that your code can be made portable to run on Linux or other OS, whereas the above api's are all exclusive to Windows platforms. Obviously, doing it with sockets means you'll have to handle all the low level stuff yourself.
    Thanks. Can you show me an example, where a network communication between Chrome and a VC++ DLL is established?

  11. #11
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: HTTP Request

    Quote Originally Posted by maverick786us View Post
    Thanks. Can you show me an example, where a network communication between Chrome and a VC++ DLL is established?
    What do you mean by "communication between Chrome and a VC++ DLL"? What DLL?
    Victor Nijegorodov

  12. #12
    Join Date
    Apr 2005
    Posts
    1,828

    Re: HTTP Request

    Quote Originally Posted by VictorN View Post
    What do you mean by "communication between Chrome and a VC++ DLL"? What DLL?
    I have created a win32 DLL and I want to pass some arguments from the chrome Toolbar

  13. #13
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: HTTP Request

    programmatically "doing" something with chrome browser or the chrome toolbar has absolutely NOTHING to do with HTTP requests.

  14. #14
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: HTTP Request

    Quote Originally Posted by maverick786us View Post
    I have created a win32 DLL and I want to pass some arguments from the chrome Toolbar
    Well, first reread the post ##5,6,13.
    Now, please choose whether we will still discuss here your problems with HTTP requests or you will start a new thread to discuss the problems about communicating with Chrome toolbar.

    Well, we could do it parallel BUT in different threads because these two problems are absolutely diferent.
    Victor Nijegorodov

  15. #15
    Join Date
    Apr 2005
    Posts
    1,828

    Re: HTTP Request

    Quote Originally Posted by OReubens View Post
    programmatically "doing" something with chrome browser or the chrome toolbar has absolutely NOTHING to do with HTTP requests.
    IE and firefox can directly interact with a desktop application. But with Chrome and Safari, the only way to communicate with desktop applications is through TCP/IP.

    Now there is already a 3rd party application. I have develop a Win32 DLL that will have an HTTP Interface, for which it will use WinHTTP. This DLL will simple communicate with the toolbar and store various parameters. So how can I accomplish this?

    @VictorN, I apologize for prociging incomplete information in my previous post.

Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured