Skip to content

Commit 3196255

Browse files
author
zwiglm
committed
Initial commit
0 parents  commit 3196255

File tree

347 files changed

+83376
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

347 files changed

+83376
-0
lines changed

CGif.cpp

Lines changed: 2293 additions & 0 deletions
Large diffs are not rendered by default.

CHIMES.WAV

54.5 KB
Binary file not shown.

CJPEG.cpp

Lines changed: 16757 additions & 0 deletions
Large diffs are not rendered by default.

DigitalText.cpp

Lines changed: 1748 additions & 0 deletions
Large diffs are not rendered by default.

ErrorObject.cpp

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
// ErrorObject.cpp: implementation of the CErrorObject class.
2+
//
3+
//////////////////////////////////////////////////////////////////////
4+
5+
#include "stdafx.h"
6+
#include "vidsend.h"
7+
#include "ErrorObject.h"
8+
9+
#ifdef _DEBUG
10+
#undef THIS_FILE
11+
static char THIS_FILE[]=__FILE__;
12+
#define new DEBUG_NEW
13+
#endif
14+
15+
//////////////////////////////////////////////////////////////////////
16+
// Construction/Destruction
17+
//////////////////////////////////////////////////////////////////////
18+
//**************************************************************************
19+
CErrorObject::CErrorObject()
20+
{
21+
22+
}
23+
//**************************************************************************
24+
CErrorObject::~CErrorObject()
25+
{
26+
27+
}
28+
//**************************************************************************
29+
void CErrorObject::HandleError(CException *err,char* szRoutine, char* szModule )
30+
{
31+
char msg[512];
32+
CRuntimeClass* prt = err->GetRuntimeClass();
33+
34+
// IN CASE OF FILE EXCEPTION
35+
if( strcmp( prt->m_lpszClassName, "CFileException" ) == 0)
36+
{
37+
CFileException* e = (CFileException*) err;
38+
e->ReportError();
39+
/*sprintf(msg,"Module: %s\nRoutine: %s\nFilename: %s\nCause: %s",szModule,szRoutine,e->m_strFileName,e->m_cause );
40+
41+
MessageBox(NULL, msg,"File Handling Error",MB_OK);*/
42+
}
43+
44+
45+
if( strcmp( prt->m_lpszClassName, "CDBException" ) == 0)
46+
{
47+
CDBException* e = (CDBException*) err;
48+
e->ReportError();
49+
50+
}
51+
52+
if( strcmp( prt->m_lpszClassName, "CMemoryException" ) == 0)
53+
{
54+
CMemoryException* e = (CMemoryException*) err;
55+
e->ReportError();
56+
57+
}
58+
59+
if( strcmp( prt->m_lpszClassName, "CArchiveException" ) == 0)
60+
{
61+
CArchiveException* e = (CArchiveException*) err;
62+
e->ReportError();
63+
64+
}
65+
66+
if( strcmp( prt->m_lpszClassName, "CNotSupportedException" ) == 0)
67+
{
68+
CNotSupportedException* e = (CNotSupportedException*) err;
69+
e->ReportError();
70+
71+
72+
}
73+
74+
#ifdef _DEBUG
75+
sprintf(msg,"Module: %s\nRoutine: %s",szModule,szRoutine);
76+
AfxMessageBox(msg);
77+
#endif
78+
79+
80+
}
81+
//**************************************************************************
82+
void CErrorObject::HandleError(_com_error &e, char *szRoutine, char *szModule)
83+
{
84+
char msg[512];
85+
sprintf(msg,"Module: %s\nRoutine: %s\nMessage: %s\nDescription: %s",szModule,szRoutine,e.ErrorMessage(),e.Description() );
86+
87+
}
88+
//**************************************************************************

ErrorObject.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// ErrorObject.h: interface for the CErrorObject class.
2+
//
3+
//////////////////////////////////////////////////////////////////////
4+
5+
#if !defined(AFX_ERROROBJECT_H__C7BDCC79_AD99_43E2_843A_3944D6B57122__INCLUDED_)
6+
#define AFX_ERROROBJECT_H__C7BDCC79_AD99_43E2_843A_3944D6B57122__INCLUDED_
7+
8+
#if _MSC_VER > 1000
9+
#pragma once
10+
#endif // _MSC_VER > 1000
11+
#include <comdef.h>
12+
class CErrorObject
13+
{
14+
public:
15+
void HandleError(_com_error& e,char* szRoutine,char* szModule);
16+
void HandleError(CException* err, char* szRoutine, char* szModule);
17+
CErrorObject();
18+
virtual ~CErrorObject();
19+
20+
};
21+
22+
#endif // !defined(AFX_ERROROBJECT_H__C7BDCC79_AD99_43E2_843A_3944D6B57122__INCLUDED_)

Image.cpp

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
// Copyright (c) 1996-2000 Logitech, Inc. All Rights Reserved
2+
3+
4+
// Image.cpp : implementation file
5+
//
6+
7+
#include "stdafx.h"
8+
#include "vfw.h"
9+
#include "Image.h"
10+
11+
#ifdef _DEBUG
12+
#define new DEBUG_NEW
13+
#undef THIS_FILE
14+
static char THIS_FILE[] = __FILE__;
15+
#endif
16+
17+
/////////////////////////////////////////////////////////////////////////////
18+
// CImage
19+
20+
CImage::CImage()
21+
: m_pbi(NULL)
22+
{
23+
}
24+
25+
CImage::~CImage()
26+
{
27+
ClearImage();
28+
}
29+
30+
31+
static int BmiRowSize(const LPBITMAPINFOHEADER pbi)
32+
{
33+
return ((pbi->biBitCount * pbi->biWidth) + 31) / 32 * 4;
34+
}
35+
36+
static int BmiColors(const LPBITMAPINFOHEADER pbi)
37+
{
38+
int nColors = pbi->biClrUsed;
39+
if (nColors == 0) {
40+
nColors = (1 << pbi->biBitCount) & 0x1FF;
41+
}
42+
return nColors;
43+
}
44+
45+
46+
static size_t BmiSize(const LPBITMAPINFOHEADER pbi)
47+
{
48+
size_t s = pbi->biSize + BmiColors(pbi) * sizeof (RGBQUAD);
49+
if (pbi->biSizeImage) {
50+
s += pbi->biSizeImage;
51+
} else {
52+
s += pbi->biHeight * BmiRowSize(pbi);
53+
}
54+
return s;
55+
} // BmiSize
56+
57+
58+
static BYTE* BmiFindBits(LPBITMAPINFOHEADER pbi)
59+
{
60+
BYTE* lp = (BYTE*)pbi;
61+
return lp + pbi->biSize + BmiColors(pbi) * sizeof (RGBQUAD);
62+
} // BmiFindBits
63+
64+
65+
void CImage::ClearImage(void)
66+
{
67+
if (m_pbi) {
68+
free(m_pbi); m_pbi = NULL; m_lpbits = NULL;
69+
}
70+
if (m_hWnd) {
71+
Invalidate(TRUE);
72+
}
73+
} // ClearImage
74+
75+
76+
void CImage::SetImage(LPBITMAPINFOHEADER pbi)
77+
{
78+
ClearImage();
79+
if (pbi) {
80+
size_t nb = BmiSize(pbi);
81+
m_pbi = (LPBITMAPINFOHEADER)malloc(nb);
82+
memcpy(m_pbi, pbi, nb);
83+
m_lpbits = BmiFindBits(m_pbi);
84+
}
85+
if (m_hWnd) {
86+
Invalidate(TRUE);
87+
}
88+
}
89+
90+
91+
void CImage::SetImage(BITMAPFILEHEADER *pbmp)
92+
{
93+
// This assumes a 'packed' file, with the DIB immediately
94+
// following the file header. Every BMP file I've ever
95+
// dumped is this way, but...
96+
LPBITMAPINFOHEADER pbi = (LPBITMAPINFOHEADER)++pbmp;
97+
SetImage(pbi);
98+
}
99+
100+
101+
void CImage::DrawImage(CDC& dc, CRect rc)
102+
{
103+
if (m_pbi) {
104+
HDRAWDIB hdd = DrawDibOpen();
105+
if (hdd) {
106+
DrawDibDraw(hdd, dc.m_hDC,
107+
rc.left, rc.top, // xDst, yDst,
108+
rc.Width(), rc.Height(),
109+
m_pbi,
110+
m_lpbits,
111+
0, 0,
112+
m_pbi->biWidth, m_pbi->biHeight,
113+
0);
114+
115+
DrawDibClose(hdd);
116+
}
117+
} else {
118+
dc.FillSolidRect(rc, RGB(192, 192, 192));
119+
}
120+
}
121+
122+
123+
BEGIN_MESSAGE_MAP(CImage, CStatic)
124+
//{{AFX_MSG_MAP(CImage)
125+
ON_WM_PAINT()
126+
//}}AFX_MSG_MAP
127+
END_MESSAGE_MAP()
128+
129+
/////////////////////////////////////////////////////////////////////////////
130+
// CImage message handlers
131+
132+
void CImage::OnPaint()
133+
{
134+
CPaintDC dc(this); // device context for painting
135+
CRect rc;
136+
GetClientRect(rc);
137+
DrawImage(dc, rc);
138+
}

Image.h

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#if !defined(AFX_IMAGE_H__F4E51541_42FD_11D4_8434_0050DA7BC9AB__INCLUDED_)
2+
#define AFX_IMAGE_H__F4E51541_42FD_11D4_8434_0050DA7BC9AB__INCLUDED_
3+
4+
#if _MSC_VER > 1000
5+
#pragma once
6+
#endif // _MSC_VER > 1000
7+
// Image.h : header file
8+
//
9+
10+
/////////////////////////////////////////////////////////////////////////////
11+
// CImage window
12+
13+
class CImage : public CStatic
14+
{
15+
// Construction
16+
public:
17+
CImage();
18+
19+
// Attributes
20+
public:
21+
22+
// Operations
23+
public:
24+
25+
void SetImage(LPBITMAPINFOHEADER pbi);
26+
// Makes a copy of the specified DIB image and displays it.
27+
// Note that pbi == NULL is OK, it sets 'no image'.
28+
29+
void SetImage(BITMAPFILEHEADER *pbmp);
30+
// Same as above, but with a pointer to a BMP file in memory.
31+
32+
void ClearImage(void);
33+
// Set to no image.
34+
35+
// Overrides
36+
// ClassWizard generated virtual function overrides
37+
//{{AFX_VIRTUAL(CImage)
38+
//}}AFX_VIRTUAL
39+
40+
// Implementation
41+
public:
42+
virtual ~CImage();
43+
44+
protected:
45+
LPBITMAPINFOHEADER m_pbi; // pointer to current (malloc'd) DIB
46+
BYTE* m_lpbits; // pointer to actual pixels
47+
48+
virtual void DrawImage(CDC& dc, CRect rc);
49+
// Draw the current image to dc, scaled to fit in rectangle rc
50+
51+
// Generated message map functions
52+
//{{AFX_MSG(CImage)
53+
afx_msg void OnPaint();
54+
//}}AFX_MSG
55+
56+
DECLARE_MESSAGE_MAP()
57+
};
58+
59+
/////////////////////////////////////////////////////////////////////////////
60+
61+
//{{AFX_INSERT_LOCATION}}
62+
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
63+
64+
#endif // !defined(AFX_IMAGE_H__F4E51541_42FD_11D4_8434_0050DA7BC9AB__INCLUDED_)

0 commit comments

Comments
 (0)