Wrox Programmer Forums
|
Visual C++ Questions specific to Microsoft's Visual C++. For questions not specific to this Microsoft version, use the C++ Programming forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Visual C++ section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 2nd, 2005, 05:47 PM
Registered User
 
Join Date: Dec 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default WinInet

Hello Everyone,
I have used Visual C++ six in the past and have now began using Visual Studio 2003 .net and am having trouble with including wininet.h in my project. The project type is a windows forms application .net.
What happens is when I include the file I get a ton of syntax
errors in the compiler that reference the wininet.h file. I assume it is including the file because if I double click on one of the errors it opens that file. I have added the wininet.lib file to the project properties ->link ->input section.
If I choose to create an MFC Application in the compiler and include wininet.h everything works fine.

Thanks for your help
                   Regie


 
Old December 3rd, 2005, 09:53 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

Regie, the answer lies in the name of the template that you selected to make your project. The name was "Windows Forms Application (.NET)". With this template selected what you are actually creating is a .NET application, i.e. an application that is going to run on Framework, which further means that you may have selected C++ as your language for development and VC ++ .NET 2003 as the IDE, but you are going to have to abide by the rules and regulations of creating a .NET application only. One of these rules say that if you want to make use of 'native' data types and stuff that’s specific to windows environment, you will first have to MAP them to data types available in .NET. Wininet is full of literals and info that’s specific to windows environment, something that Framework hardly understands.

When you select MFC Application, however, you are actually creating those good old windows application that you used to create in pre .NET era. Just the IDE is new that is VS 2003. So in that case everything that wininet 'has to say' is well understood and accepted gleefully by the compiler. Framework is not needed to run these applications.

Regards
Ankur Verma
 
Old December 13th, 2005, 10:36 AM
Registered User
 
Join Date: Dec 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ankur,
Thank you for the information. I'm going to give it a try.
I'm sorry it took so long for me to respond, but after I submitted this question I realized I was going on vacation 12-5 thru 12-12.

Thanks Again
Regie




 
Old December 13th, 2005, 11:06 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

Well, I took care of your query while you were on vacation.
Guess, that arrangment worked out just fine.... for you. ;)

Welcome to the forum and thanks for your contribution.

Regards
Ankur
 
Old December 28th, 2005, 04:02 PM
Registered User
 
Join Date: Dec 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hello Ankur I'm back,

I thought what you said might be pretty straight forward about mapping the data types but quickly found out I really didn't know how to go about it. I tried searching the internet for help but no go. Could you give me a jump start as to how you would go about including wininet.h with out getting all the compiler errors.
I would probably go back and use MFC exclusively if it wasn't for the fact I'm using the microsoft .net datagrid and really like it.
If I have to I could maybe write what I need to with MFC and just
call it's .exe from my .net program not exactly what I would like as I would like to get use to using .net.
Please bear with me I'm learning, but whats up with .net that RAS and Wininet are not understood by the framework, is there something in .net similar or newer that I should be using in order to dial a modem.:)

                   Thank again,
                     Regie


 
Old December 29th, 2005, 01:21 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 453
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via AIM to Ankur_Verma Send a message via MSN to Ankur_Verma
Default

You may not have to go back to MFC. Rod, another member on this forum,
is working on mobile devices and GSM modem. Look at this post by him,
the code is in C# but just might give you something to look at.

http://p2p.wrox.com/topic.asp?TOPIC_ID=37814

Regards
Ankur Verma





Similar Threads
Thread Thread Starter Forum Replies Last Post
WinINet - Choosing encryption algorithm tdaplyn Visual C++ 0 April 28th, 2006 06:48 PM
WinInet jain30 Visual C++ 0 December 1st, 2005 01:43 AM
Visual C++ wininet brwoodru Visual C++ 1 November 2nd, 2005 04:07 PM
Problem with wininet IgorT VB How-To 1 September 2nd, 2004 10:20 AM
Using WININET.DLL from .NET rparkhouse@optimise.com.a ADO.NET 3 July 1st, 2003 11:59 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.