home *** CD-ROM | disk | FTP | other *** search
/ Mastering Visual Basic 6 / mastvb6.iso / leadtools / ocx32.lt / Connect.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-03  |  1.9 KB  |  77 lines

  1. // Connect.cpp : implementation file
  2. //
  3.  
  4. #include "stdafx.h"
  5. #include "NetCap.h"
  6. #include "Connect.h"
  7.  
  8. /////////////////////////////////////////////////////////////////////////////
  9. // CConnection dialog
  10.  
  11.  
  12. CConnection::CConnection(CWnd* pParent /*=NULL*/)
  13.     : CDialog(CConnection::IDD, pParent)
  14. {
  15.     //{{AFX_DATA_INIT(CConnection)
  16.     //}}AFX_DATA_INIT
  17.    m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
  18. }
  19.  
  20. void CConnection::DoDataExchange(CDataExchange* pDX)
  21. {
  22.     CDialog::DoDataExchange(pDX);
  23.     //{{AFX_DATA_MAP(CConnection)
  24.     DDX_Control(pDX, IDC_LEAD, m_Lead);
  25.     //}}AFX_DATA_MAP
  26. }
  27.  
  28.  
  29. BEGIN_MESSAGE_MAP(CConnection, CDialog)
  30.     //{{AFX_MSG_MAP(CConnection)
  31.     ON_WM_CLOSE()
  32.     //}}AFX_MSG_MAP
  33. END_MESSAGE_MAP()
  34.  
  35. /////////////////////////////////////////////////////////////////////////////
  36. // CConnection message handlers
  37.  
  38. BOOL CConnection::OnInitDialog() 
  39. {
  40.     CDialog::OnInitDialog();
  41.     
  42.     SetIcon(m_hIcon, TRUE);    
  43.     SetIcon(m_hIcon, FALSE);
  44.  
  45.    UNLOCKSUPPORT(m_Lead);
  46.  
  47.    m_Lead.SetBitmap(0);
  48.  
  49.    m_Lead.SetAppearance(APPEARANCE_FLAT);
  50.    m_Lead.SetPaintDither(PAINTDITHER_DIFFUSION);
  51.    m_Lead.SetPaintPalette(PAINTPALETTE_AUTO);
  52.    m_Lead.SetPaintSizeMode(PAINTSIZEMODE_NORMAL);
  53.     m_Lead.SetAutoScroll(FALSE);
  54.    m_Lead.SetAutoRepaint(FALSE);
  55.     m_Lead.SetBackErase(FALSE);
  56.    m_Lead.SetAutoSize(TRUE);
  57.    m_Lead.SetAutoSetRects(TRUE);
  58.    m_Lead.SetBorderStyle(0);
  59.     m_Lead.SetEnableMethodErrors(FALSE);
  60.  
  61.    m_nBytesIn   = 0;
  62.    m_nBytesOut  = 0;
  63.    m_nImagesIn  = 0;
  64.    m_nImagesOut = 0;
  65.    m_nTime      = GetTickCount();
  66.    m_nTimeout   = m_nTime;
  67.  
  68.    return TRUE;  // return TRUE unless you set the focus to a control
  69.                   // EXCEPTION: OCX Property Pages should return FALSE
  70. }
  71.  
  72. void CConnection::OnClose() 
  73. {
  74.    //sb: do not call CDialog::OnClose() here because Disconnect closes the window!!
  75.    m_pOwner->Disconnect(m_nComputer);
  76. }
  77.