岁月留声QtAsp

Qt in Linux , Asp Asp.net Jsp Php in Web

« CIPAddressCtrl控件的用法 VC++6.0助手 Visual Assist X »

重写 CIPAddressCtrl::GetAddress

CIPAddressCtrl

An IP Address control, a control similar to an edit control, allows you to enter and manipulate a numerical address in Internet Protocol (IP) format.

The CIPAddressCtrl class provides the functionality of the Windows common IP Address control. This control (and therefore the CIPAddressCtrl class) is available only to programs running under Microsoft Internet Explorer 4.0 and later. They will also be available under future versions of Windows and Windows NT.

For more general information about the IP Address Control, see in the Platform SDK.

#include <afxcmn.h>

Class MembersBase ClassHierarchy Chart
 

CIPAddressCtrl::GetAddress

int GetAddress( BYTE& nField0, BYTE& nField1, BYTE& nField2, BYTE& nField3 );

int GetAddress( DWORD& dwAddress );

Return Value

The number of non-blank fields in the IP Address Control.

Parameters

nField0

A reference to the field 0 value from a packed IP address.

nField1

A reference to the field 1 value from a packed IP address.

nField2

A reference to the field 2 value from a packed IP address.

nField3

A reference to the field 3 value from a packed IP address.

dwAddress

A reference to the address of a DWORD value that receives the IP address. See Remarks for a table that shows how dwAddress is filled.

Remarks

This member function implements the behavior of the Win32 message , as described in the Platform SDK.

In the first prototype above, the numbers in fields 0 through 3 of the control, read left to right respectively, populate the four parameters. In the second prototype above, dwAddress is populated as follows.

Field Bits containing the field value
0 24 through 31
1 16 through 23
2 8 through 15
3 0 through 7

 

 

四个字节前后颠倒.  
  void   CCheckURL::ConvertAddr(DWORD   &   Addr)  
  {  
  DWORD   Old=Addr;  
  Addr=MAKELONG(MAKEWORD(HIBYTE(HIWORD(Old)),LOBYTE(HIWORD(Old))),MAKEWORD(HIBYTE(LOWORD(Old)),LOBYTE(LOWORD(Old))));  
  }  
 

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

Search

  •  

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Spirit Build 80722 Code detection by Codefense

Copyright 2008-2011 京公网安备 110115000655 京ICP备09005635号 www.qtasp.cn WebSite. All Rights Reserved.