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

📄 modeminfoclass.h

📁 通过调用第3方的VC++类,实现具有遍历MODEM名字,COM口和初始化字符串等功能的一个实例
💻 H
字号:
/////////////////////////////////////////////////////////////////////////////
// Copyright (C) 1999 by Seain B. Conover, Tarasoft Corporation
// All rights reserved
//
// Distribute freely. Absolutely do not remove my name from the source or
// documentation (don't take credit for my work), mark your changes (don't
// get me blamed for your possible bugs), don't alter or remove this
// notice.
//
// No warrantee of any kind, express or implied, is included with this
// software; use at your own risk, responsibility for damages (if any) to
// anyone resulting from the use of this software rests entirely with the
// user.
//
// Read *Atlas Shrugged*, http://www.aynrand.org
//
/////////////////////////////////////////////////////////////////////////////


#if !defined(AFX_MODEMINFO_H__F83AE331_CF9D_11D2_9E1C_0060672CA551__INCLUDED_)
#define AFX_MODEMINFO_H__F83AE331_CF9D_11D2_9E1C_0060672CA551__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

// ModemInfo.h : header file
//

/////////////////////////////////////////////////////////////////////////////
// CModemInfo class

class CModemInfo
{
// Construction
public:
	CModemInfo();
	virtual ~CModemInfo();


// Operations
public:

	// number of modems in machine
	const int		GetModemCount() const;			

	// reset string
	const CString	GetModemResetString( const CString strName ) const;

	// init string, with optional desired volume level specified
	// error control on, compression on, hardward flow control, modulation CCITT, blind off, call setup fail timer, inactivity timer + if requested, includes  volume init
	const CString	GetModemInitString( const CString strName, const int nSpeakerVolume = -1 ) const;

	// com port
	const int		GetModemComPort( const CString strName ) const;

	// maximum bps as per control panel
	const int		GetModemBps( const CString strName ) const;

	// fills CComboBoxBox with list of modem names
	void			FillComboBoxWithModemNames( CComboBox* pComboBox );

	// fills CListBox control with list of modem names
	void			FillListBoxWithModemNames( CListBox* pListBox );

	// first listed non-virtual modem name in registry
	const CString	GetFirstModemName() const;

	// modem name based on index
	const CString	GetModemName( const int nIndex ) const;

	// does modem have speaker
	const BOOL		GetModemHasSpeaker( const CString strName ) const;

	// how many volume levels? 
	const int		GetModemVolumeLevelsCount( const CString strName ) const;

	// is strName a valid modem?
	const BOOL		GetIsModem( const CString strName ) const;



protected:
	const CString	GetProfileString( LPCTSTR lpszSection, LPCTSTR lpszEntry, LPCTSTR lpszDefault, HKEY hKey ) const;
	const CString	GetModemRegistrySection( const int nIndex ) const;
	const CString	GetModemClassGuid() const;
	const int		GetModemIndex( CString strName ) const;
	const CString	GetPaddedIndex( const int nIndex ) const;
	const CString	GetFirstRegistrySubKey( const HKEY hKey, const CString strSection ) const;
	const int		GetModemComPortByIndex( const int nIndex ) const;

// Attributes
protected:
	CStringArray m_aModems;
	CString	m_strModemClassGuid;
};

/////////////////////////////////////////////////////////////////////////////

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

#endif // !defined(AFX_MODEMINFO_H__F83AE331_CF9D_11D2_9E1C_0060672CA551__INCLUDED_)

⌨️ 快捷键说明

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