Wrox Programmer Forums
|
BOOK: Professional C#, 2nd and 3rd Editions
This is the forum to discuss the Wrox book Professional C#, 3rd Edition by Simon Robinson, Christian Nagel, Karli Watson, Jay Glynn, Morgan Skinner, Bill Evjen; ISBN: 9780764557590
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C#, 2nd and 3rd Editions 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 August 21st, 2003, 07:12 AM
Registered User
 
Join Date: Aug 2003
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Using win 32 dll in C#

I have used the function InternetGetConnectedState() to check whether the system is connected to internet. It is working Correctly.
But the Function returns the description about the connection in its out parameter (here Description) how can i print that description.
i tried printing Value in Description but it prints number.
I tried Comparing it with Return Constants but it gives Error .
The Constant Name Is undefined.

[DllImport("wininet.dll")]
private extern static bool InternetGetConnectedState(out int Description, int ReservedValue ) ;

Abhijeet Kumar
Software Engineer
Cybage Software Pvt. Ltd.
 
Old August 23rd, 2003, 05:48 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

Hi Abhijeet

The value that is being retruned is of typ DWORD
and the numerical value stored in it is what you
are seeing when you print it. The right way is to check
the returned value against constants but instead of using
the constant names .Net check the values of these constants
in Wininet.h file and check the returned value against them.
Like the constant INTERNET_CONNECTION_LAN has the value 2
defined in Wininet.h.

Regards

Ankur Verma
.Net and C++ Specialist
Wiley Tech Support





Similar Threads
Thread Thread Starter Forum Replies Last Post
nitepad in win 32 satishsatao C++ Programming 1 April 7th, 2006 03:26 AM
Win 32 VC++ Implementation doubts !!! indupriyav Visual C++ 1 December 16th, 2005 11:57 AM
Working with Win 32 Registry pannet1 BOOK: Access 2003 VBA Programmer's Reference 4 April 27th, 2005 03:45 AM
Win '98 vs. Win XP rgerald Access VBA 0 February 19th, 2004 12:30 PM





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