InternetConnect() error, resolving name

This is a discussion on InternetConnect() error, resolving name within the Windows Programming forums, part of the Platform Specific Boards category; I'm trying to connect to an FTP server, but I am getting the error ERROR_INTERNET_NAME_NOT_RESOLVED. Using the exact same address, ...

  1. #1
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401

    InternetConnect() error, resolving name

    I'm trying to connect to an FTP server, but I am getting the error ERROR_INTERNET_NAME_NOT_RESOLVED. Using the exact same address, username, and password, I can log in using IE. Here is my code:

    Code:
    hNet=InternetOpen("ipupdate",INTERNET_OPEN_TYPE_DIRECT,
                           NULL,NULL,NULL);
    hFTP=InternetConnect(hNet,"ftp://members.optushome.com.au",
                    INTERNET_DEFAULT_FTP_PORT,
                    "username","password",INTERNET_SERVICE_FTP,
                    NULL,NULL);
    InternetOpen() returns a valid handle, but InternetConnect() returns NULL. Is there anything in the function calls that would cause this error?
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

  2. #2
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,439
    Well "ftp://members.optushome.com.au" is protocol_name://domain_name, which IE uses to decide which protocol to use.

    Since you're already set on using FTP, try it without the "ftp://" bit
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    mustang benny bennyandthejets's Avatar
    Join Date
    Jul 2002
    Posts
    1,401
    I could kiss you right now Salem, it works perfectly. Thank you.
    benforbes@optusnet.com.au
    Microsoft Visual Studio .NET 2003 Enterprise Architect
    Windows XP Pro

    Code Tags
    Programming FAQ
    Tutorials

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. InternetConnect fails
    By jmd15 in forum Windows Programming
    Replies: 5
    Last Post: 09-04-2005, 06:05 PM
  2. wininet (internetconnect)
    By jabroni77 in forum Networking/Device Communication
    Replies: 0
    Last Post: 05-19-2005, 07:29 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21