⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 awarenet.h

📁 c++系统开发实例精粹内附的80例源代码 环境:windows2000,c++6.0
💻 H
字号:
#ifndef AWARENET_INCLUDE
#define AWARENET_INCLUDE

/*
--------------------------AwareNet Library--------------------------

Version 1.19
Copyright(C) 1999, 2000 Tenebril Incorporated

  Extensive documentation is provided online at the
  Tenebril Incorporated web site.  It is accessible from,

  http://www.tenebril.com/developers/main.html

  Please refer to this documentation to learn how to use
  AwareNet.

---------------------------------------------------------------------
*/

#ifdef IN_MCSPNET_DLL
#define DLL_EXPORT_STR __declspec(dllexport)
#else
#define DLL_EXPORT_STR

////////////////////////////////////////////////////
// AwareNet_Update*Msg
//
// These messages should be caught by your
// application.  Please read the AwareNet
// documentation for more information.
////////////////////////////////////////////////////

__declspec(dllimport) UINT AwareNet_UpdateContactsMsg;
__declspec(dllimport) UINT AwareNet_UpdateIdentityMsg;

#endif

#define AWARENET_MAX_IP                                  24
#define AWARENET_MAX_NAME                               120

#ifdef __cplusplus
extern "C" {  
#endif

////////////////////////////////////////////////////
// TPersonalInfo
//
// This structure is used only for communication
// between this DLL and your program; you should
// use the CPersonalInfo wrapper class in your
// application or, at worst, call the below
// PersonalInfo functions.
////////////////////////////////////////////////////

typedef struct
{
	TCHAR m_czName[256];
	TCHAR m_czEMail[128];
	TCHAR m_czPassword[128];
} TPersonalInfo;

////////////////////////////////////////////////////
// AwareNet exports
//
// You are encouraged to use the provided CAwareNet
// class in the AwareNetClass.[ch] files, rather
// than calling the below API functions directly.
// The CAwareNet class will handle dynamic
// memory allocation and buffer considerations
// for you.
//
// The below API functions save internal state.
// State for the AwareNet system is mostly global 
// to the machine, and partly global to the
// Internet.
////////////////////////////////////////////////////

DLL_EXPORT_STR BOOL AwareNet_Initialize(HWND ParentWindow, int Service);
DLL_EXPORT_STR BOOL AwareNet_Deallocate(int Service);
DLL_EXPORT_STR BOOL AwareNet_SetMyProfile(TPersonalInfo PInfo);
DLL_EXPORT_STR HWND AwareNet_SetParentWindow(HWND Parent);
DLL_EXPORT_STR BOOL AwareNet_FlushData();
DLL_EXPORT_STR BOOL AwareNet_Add(LPCTSTR czProgramName, LPCTSTR czProgramURL, int nTOS);
DLL_EXPORT_STR BOOL AwareNet_AddID(int ID);
DLL_EXPORT_STR BOOL AwareNet_ChangeIdentity();
DLL_EXPORT_STR int  AwareNet_GetHighestIdentity();
DLL_EXPORT_STR BOOL AwareNet_GetIdentity(int iIdentityNum, LPTSTR czName, UINT nNameLen);
DLL_EXPORT_STR BOOL AwareNet_SetIdentity(int iIdentityNum, LPCTSTR cszPassword);
DLL_EXPORT_STR BOOL AwareNet_DeleteIdentity(int iID);
DLL_EXPORT_STR int  AwareNet_GetActiveIdentity();
DLL_EXPORT_STR BOOL AwareNet_AddIdentity();
DLL_EXPORT_STR BOOL AwareNet_Delete(int ID);
DLL_EXPORT_STR int  AwareNet_GetAcquaintance(int num);
DLL_EXPORT_STR int  AwareNet_GetFriend(int num);
DLL_EXPORT_STR BOOL AwareNet_GetProfile(int ID, TPersonalInfo *PInfo);
DLL_EXPORT_STR BOOL AwareNet_GetMyProfile(TPersonalInfo *PInfo);
DLL_EXPORT_STR int  AwareNet_LookupID(LPCTSTR czEMail);
DLL_EXPORT_STR BOOL AwareNet_LookupProfile(int ID, TPersonalInfo *PInfo);
DLL_EXPORT_STR BOOL AwareNet_IsOnline(int iID, int iService, BOOL bForceLookup);
DLL_EXPORT_STR BOOL AwareNet_GetIP(int ID, LPTSTR czIP, UINT nLenBuffer);
DLL_EXPORT_STR int  AwareNet_GetMyID();
DLL_EXPORT_STR BOOL AwareNet_UpdateTOS(int service, BOOL up);
DLL_EXPORT_STR int  AwareNet_NumActiveTOS();
DLL_EXPORT_STR BOOL AwareNet_SendInvitation(LPCTSTR czRecipient, LPCTSTR czProgramName,
											LPCTSTR czProgramURL, int nTOS);
DLL_EXPORT_STR BOOL AwareNet_AddAnonAcquaintances(int nNum, int nService);
DLL_EXPORT_STR UINT AwareNet_GetAnonAcquaintances(int nService, BOOL bRefresh, 
												  TCHAR *ptBuffer, UINT nBuffer);
DLL_EXPORT_STR BOOL AwareNet_IsIdentityTaken(LPCTSTR czEMail);

////////////////////////////////////////////////////
// PersonalInfo exports
//
// You are strongly encouraged to use the provided
// CPersonalInfo class in the AwareNetClass.[ch] 
// files, rather calling the below functions 
// directly.  The CAwareNet class will pass around
// instantiations of CPersonalInfo; TPersonalInfo
// is used only to maintain a fully C-compatible
// interface for this DLL.
////////////////////////////////////////////////////

DLL_EXPORT_STR TPersonalInfo *PersonalInfo_Create();
DLL_EXPORT_STR void           PersonalInfo_Destroy(TPersonalInfo *);
DLL_EXPORT_STR LPCTSTR        PersonalInfo_GetName(TPersonalInfo *);
DLL_EXPORT_STR LPCTSTR        PersonalInfo_GetEMail(TPersonalInfo *);
DLL_EXPORT_STR LPCTSTR        PersonalInfo_GetPassword(TPersonalInfo *);
DLL_EXPORT_STR BOOL           PersonalInfo_SetName(TPersonalInfo *, LPCTSTR);
DLL_EXPORT_STR BOOL           PersonalInfo_SetEMail(TPersonalInfo *, LPCTSTR);
DLL_EXPORT_STR BOOL           PersonalInfo_SetPassword(TPersonalInfo *, LPCTSTR);
DLL_EXPORT_STR BOOL           PersonalInfo_Copy(TPersonalInfo *, TPersonalInfo *);

#ifdef __cplusplus
}
#endif

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -