|
howdy, i'm looking to start out with some internet work, i've read some articles here about winsock etc. I was just wondering which you would suggest to use, wininet or winsock? What the differences are? Maybe a nice refernce to somewhere where I can get this info. is there any other libs to use? etc.
thanks for any info.
Luke.
|
|
|
|
|
From MSDN Library:
How WinInet Makes It Easier to Create Internet Client Applications
The Win32 Internet Extensions, or WinInet, provide access to common Internet protocols, including gopher, FTP, and HTTP. Using WinInet, you can write Internet client applications at a higher level of programming, without having to deal with WinSock, TCP/IP, or the details of specific Internet protocols. WinInet provides a consistent set of functions for all three protocols, with a familiar Win32 API interface. This consistency minimizes code changes you need to make if the underlying protocol changes (for example, from FTP to HTTP).
Visual C++ provides two ways for you to use WinInet. You can call the Win32 Internet functions directly (see the OLE documentation in the Platform SDK for more information) or you can use WinInet through the MFC WinInet classes.
You can use WinInet to:
Download HTML pages.
HTTP is a protocol used to transfer HTML pages from a server to a client browser.
Send FTP requests to upload or download files or get directory listings.
A typical request is an anonymous logon to download a file.
Use gopher's menu system for accessing resources on the Internet.
Menu items can be several types, including other menus, an indexed database you can search, a newsgroup, or a file.
For all three protocols, you establish a connection, make requests to the server, and close the connection.
The MFC WinInet classes make it easy to:
Read information from HTTP, FTP, and gopher servers as easily as reading files from a hard drive.
Use HTTP, FTP, and gopher protocols without programming directly to WinSock or TCP/IP.
Developers who use the Win32 Internet functions do not need to be familiar with TCP/IP or Windows Sockets. You can still program at the socket level, using WinSock and TCP/IP protocols directly, but it's even easier to use the MFC WinInet classes to access HTTP, FTP, and gopher protocols across the Internet. For many common operations, developers do not need to know the details of the particular protocol they are using.
Many operations that can be performed by your computer as a client to other computers on the Internet can take a long time. The speed of these operations is usually limited by the speed of your network connection, but they can also be affected by other network traffic and the complexity of the operation. Connecting to a remote FTP server, for example, requires that your computer first look up the name of that server to find its address. Your application will then attempt to connect to the server at that address. Once the connection is opened, your computer and the remote server will initiate a conversation with the file transfer protocol before you can actually use the connection to retrieve files.
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
thanks for that, and I must say sorry. Not long after I posted that I found similar information. So thanks anyhow..
now off to read about winsock
bye
Luke.
|
|
|
|
|
How to encrypt / Decrypt using RSA algorithm.
I need to get the public key and private key in two different files.
Can anyone help me please
|
|
|
|
|
|
Try this link: http://www.geocities.com/hmaxf_urlcr/hmaxf_rsa_dos.zip
Miroslav Rajcic
|
|
|
|
|
Hello.
I'm doign a program in MFC that needs to ping an IP address and detect if the ping 'answers' or not, that is, if the IP is reacheble or not. How can I do this programatically?
Thanks a lot.
-- n
|
|
|
|
|
|
Thanks a lot, I'll try it out and see what happens.
-- n
|
|
|
|
|
Hi, any good C example on this?
|
|
|
|
|
I have a dialog applicaion assosciated with system tray icon. When i run my application, the dialog and tray icon appear at same time but
i want the dialog to be hidden at runtime. When i double-click its corresponding task bar icon , then it should appear.Plz suggest .
|
|
|
|
|
|
In OnInitDialog, Set a timer to lunch. In OnTimer member function, use,
App.HideApplication!
Here is an example:
BOOL CMyDialog::OnInitDialog()
{
SetTimer(1, 1, NULL);
return TRUE;
}
void CMyDialog::OnTimer(int nTimerID)
{
theApp.HideApplication();
KillTimer(1);
CDialog::OnTimer(nTimerID);
}
Remember that before implementation of any dialog member function, you must add this code:
extern CYourApplication theApp;
A. Riazi
|
|
|
|
|
hi,
///theApp.HideApplication();
there is no funtion HideApplication() available..
|
|
|
|
|
HideApplication() is member function of CWinApp!
A. Riazi
|
|
|
|
|
In WinNT (but not only), in the control pannel, you have the possibility to open a dialog for changing some values which are typical fom the country you're currently living in, such as the local currency, or whether you are using a , to separate thousands or a . or nothing, and so on. This dialog usually opens up showing a map.
So, I'd like to programatically change the values in this dialog. Is this possible ? Are these values stored in the registry (if yes, which key?)?
Thanks
~RaGE();
|
|
|
|
|
Hello!
You need to look up these functions:
National Language Support Functions
The following functions are used with national language support.
ConvertDefaultLocale
EnumCalendarInfo
EnumCalendarInfoEx
EnumCalendarInfoProc
EnumCalendarInfoProcEx
EnumCodePagesProc
EnumDateFormats
EnumDateFormatsProc
EnumLocalesProc
EnumSystemCodePages
EnumSystemLocales
EnumTimeFormats
EnumTimeFormatsProc
GetACP
GetCPInfo
GetCPInfoEx
GetCurrencyFormat
GetDateFormat
GetLocaleInfo
GetNumberFormat
GetOEMCP
GetSystemDefaultLangID
GetSystemDefaultLCID
GetThreadLocale
GetTimeFormat
GetUserDefaultLangID
GetUserDefaultLCID
IsValidCodePage
IsValidLocale
LCMapString
SetLocaleInfo
SetThreadLocale
Mike Eriksson
Sonork 100.21825
|
|
|
|
|
Hi, everyone!
I do not understand what is the function of new operator
in the following example. Especially this statement,
--------
(void)new (pint) Elem(10);
--------
Another question, when compiling, a warning jumps out like the
following, I want to know how to avoid the warning.
Thanks in advance,
George
--------
c:\program files\microsoft visual studio\myprojects\testnew\testnew.cpp(25) : warning C4291: 'void *__cdecl operator new(unsigned int,void *)' : no matching operator delete found; memory will not be freed if initialization throws an exception
--------
#include <iostream.h>
inline void* operator new(size_t, void* ptr) { return ptr;}
class Elem{
public:
Elem(int a)
{
data = a;
}
public:
int getData()
{
return data;
}
private:
int data;
};
void main()
{
int* pint = new int[2 + sizeof(Elem)];
(void)new (pint) Elem(10);
Elem* elem = (Elem*)pint;
cout << elem->getData() << endl;
delete pint;
}
|
|
|
|
|
(void)new (pint) Elem(10); Constructs a new Elem object at the address pint . Run it step by step with a breakpoint in new 's body and you'll see what is all about.
rechi
|
|
|
|
|
Hi, Bogdan buddies!
I do not understand why we add a "(void)" before
the statement?
Thanks in advance,
George
|
|
|
|
|
George2 wrote:
I do not understand...
Neither do i. The call has right value so the conversion appears to be useless since there's no variable to receive it.
rechi
|
|
|
|
|
Hi, Bogdan pal!
The return type of new operator is void*, so
I think we should use
--------
(void*) ...
--------
other than
--------
(void) ...
--------
Since void* is a C++ data type and void is not a C++ data type. What is your opinion?
Thanks in advance,
George
|
|
|
|
|
Perhaps it's to get it rid of a compile warning. Leave it out and see if there is one.
|
|
|
|
|
Thanks, Anonymous buddies.
I have tried and you are right. Can you tell
me why?
George
|
|
|
|
|
I am implementing a skin based tool kit.
When repainting the frame of a window,
i catch WM_NCPAINT message then get window's
device context :
case WM_NCPAINT:
{
HDC hdc = NULL;
if( wparam==1 )
hdc = GetWindowDC( hwnd );
else
hdc = GetDCEx( hwnd, (HRGN)(wparam), DCX_WINDOW|DCX_INTERSECTRGN );
paintFrame( hdc );
ReleaseDC( hwnd, hdc );
}
The 'GetDCEx line' is taken from MSDN.
I use MSVC++7 under winXP
Thanks for your help
|
|
|
|