Click here to Skip to main content
13,090,517 members (58,019 online)
Click here to Skip to main content


375 bookmarked
Posted 14 Jun 2006

Build your own cryptographically safe server/client protocol

, 21 Jun 2006
This article presents all you need to implement your own secure protocol using variable keysize RSA encryption/decryption, digital signing, multi precision library, Diffie-Hellman key exchange, Rijndael, and more. Everything is converged into a secure IOCP client/server chat server.
#if !defined(AFX_SQLLISTCTRL_H__DEBCFBF5_0237_4D9B_8C17_E70FE11ECFB6__INCLUDED_)

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// SqlListCtrl.h : header file

// MyListCtrl window

#include "HistoryEdit.h"


*	Structure to contain the list data. 

typedef struct tagITEMINFO { 
	unsigned int m_ID;
    CString  m_sClientAddress;
	int m_iListIndex; // to Know what index the item has in the list.  
	int m_iNumberOfReceivedMsg;
	CString m_sName;


class MyListCtrl : public CListCtrl
// Construction

// Attributes

// Operations

// Overrides
	// ClassWizard generated virtual function overrides

// Implementation
	BOOL Select(int index);
	BOOL FreeItem(int Index);
	void ReSort();

	BOOL SetHeaderIcon(int iIndex,int iPictureIndex);
	ITEMINFO* Find(CString ID);
	ITEMINFO* Select(CString ID);
	void SetIconSize(int x,int y);
	//BOOL DBLoadIcon();
	//BOOL DBLoadData(CString kategori="");

//	BOOL SqlInit(CString username,CString password,CString  hostadress,int Listtype, CHistoryEdit *logg=NULL);
	BOOL DeleteSelectedItem();

	BOOL init();

	ITEMINFO* GetSelectedItem();
	BOOL DeleteAllItems();
	static int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
	static int CALLBACK CompareFunc2(LPARAM lParam1, LPARAM lParam2, LPARAM lParamSort);
	BOOL FreeListItems();
	int AddItemToList(int nIndex,int iImage=0, ITEMINFO *pItem=NULL);
	int AddItemToList(ITEMINFO *pItem, int iImage=0);
	virtual ~MyListCtrl();
	// Data base functions
	//BYTE* DBLoadImage(Connection *con,long* size,CString stable,CString sblobfield,CString sKeyField,CString sKey);

	// Generated message map functions
	// Header and Column managment 
	// Current column nr which we sort by.
	int m_iCurrentSortColumn;
	int m_iNumberOfColumns;

	int m_iColumnWidthArray[10];
	// The Image List for the columns.
	CImageList m_HeaderImages;
	// The dirrection of the sort. 
	int m_sortdirection;
	// Other configs 
	int m_ListType;
	CImageList m_ImageListThumb;

	// The size of the icons
	int m_IconWidth;
	int m_IconHeight;
	BOOL m_ShowIcons;
	afx_msg void OnDestroy();
	afx_msg void OnGetdispinfo(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnCustomdraw( NMHDR* pNMHDR, LRESULT* pResult );
	afx_msg void OnColumnclick(NMHDR* pNMHDR, LRESULT* pResult);
	afx_msg void OnSize(UINT nType, int cx, int cy);

	void ResizeColumns(int cx=-1);


// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_SQLLISTCTRL_H__DEBCFBF5_0237_4D9B_8C17_E70FE11ECFB6__INCLUDED_)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Program Manager
Sweden Sweden
Amin Gholiha.
- Master of Science in Information Technology.
- Degree of Master of Education.
Knowledge/interest: programming (.NET,Visual, C#/C++), neural network, mathematical modeling, signal processing, sequence analysis, pattern recognition,robot technology, system design, security and business management systems. For business proposal email, all other emails will be ignored.
Current Work:
Project Manager (the best free e-signature tool)

You may also be interested in...

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.170813.1 | Last Updated 21 Jun 2006
Article Copyright 2006 by spinoza
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid