Click here to Skip to main content
15,900,511 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
General32bit color icons and user break points Pin
Douglas Troy27-Jul-01 9:40
Douglas Troy27-Jul-01 9:40 
GeneralRe: 32bit color icons and user break points Pin
Tomasz Sowinski29-Jul-01 23:33
Tomasz Sowinski29-Jul-01 23:33 
GeneralRe: 32bit color icons and user break points Pin
Douglas Troy30-Jul-01 5:23
Douglas Troy30-Jul-01 5:23 
GeneralCalculate a Checksum Pin
youssef27-Jul-01 8:13
youssef27-Jul-01 8:13 
GeneralRe: Calculate a Checksum Pin
PJ Arends27-Jul-01 9:46
professionalPJ Arends27-Jul-01 9:46 
GeneralRe: Calculate a Checksum Pin
Joe Moldovan27-Jul-01 13:40
Joe Moldovan27-Jul-01 13:40 
GeneralRead/write from a binary file @ specified offsets Pin
27-Jul-01 7:20
suss27-Jul-01 7:20 
GeneralRe: Read/write from a binary file @ specified offsets Pin
Carlos Antollini27-Jul-01 8:18
Carlos Antollini27-Jul-01 8:18 
I wrote this for Read get the number of page in a tiff file.
typedef struct _TiffHeader
{
	WORD Identifier;
	WORD Version;
	DWORD IFDOffest;
}TIFHEADER;

typedef struct _TiffTag
{
	WORD TagId;
	WORD DataType;
	DWORD DataCount;
	DWORD DataOffset;
}TIFTAG;


long CWebBrowApp::GetTiffPageCount(LPCTSTR lpFileName)
{
	TIFHEADER* udtTifHdr = new TIFHEADER;
	WORD NumDirEntries;
	DWORD NextIFDOffset;
	long nPages = 0;
	CFile tFile;
	
	if(tFile.Open(lpFileName, CFile::modeRead | CFile::typeBinary))
	{
		
		tFile.Read(udtTifHdr, sizeof(TIFHEADER));
		
		DWORD lOff = udtTifHdr->IFDOffest;
		
		do 
		{
			nPages++;
			tFile.Seek(lOff, CFile::begin);
			tFile.Read(&NumDirEntries, sizeof(WORD));
			tFile.Seek(NumDirEntries * sizeof(TIFTAG), CFile::current);
			tFile.Read(&NextIFDOffset, sizeof(DWORD));
			lOff = NextIFDOffset;
		} 
		while(NextIFDOffset != 0);		
		
		tFile.Close();
	}

	delete udtTifHdr;

	return nPages;
}



I hope to help you!!!;) Wink | ;) Wink | ;) Wink | ;)
Good Luck!!!
Big Grin | :-D

Carlos Antollini.
GeneralRe: Read/write from a binary file @ specified offsets Pin
Chris Losinger27-Jul-01 8:20
professionalChris Losinger27-Jul-01 8:20 
GeneralRe: Read/write from a binary file @ specified offsets Pin
31-Jul-01 9:58
suss31-Jul-01 9:58 
GeneralCListView Not cooperating... Pin
Joseph Dempsey27-Jul-01 6:12
Joseph Dempsey27-Jul-01 6:12 
GeneralRe: CListView Not cooperating... Pin
Matt Gullett27-Jul-01 6:20
Matt Gullett27-Jul-01 6:20 
GeneralRe: CListView Not cooperating... Pin
Diarrhio28-Jul-01 3:21
Diarrhio28-Jul-01 3:21 
GeneralCross Class Functions Pin
Matt Newman27-Jul-01 5:50
Matt Newman27-Jul-01 5:50 
GeneralRe: Cross Class Functions Pin
Chris Losinger27-Jul-01 5:53
professionalChris Losinger27-Jul-01 5:53 
GeneralRe: Cross Class Functions Pin
Matt Newman27-Jul-01 6:04
Matt Newman27-Jul-01 6:04 
GeneralRe: Cross Class Functions Pin
Chris Losinger27-Jul-01 7:05
professionalChris Losinger27-Jul-01 7:05 
GeneralRe: Cross Class Functions Pin
Matt Newman27-Jul-01 8:23
Matt Newman27-Jul-01 8:23 
GeneralPLEASE HELP !!!! URGENT !!!!!!!!!! save struct in file Pin
27-Jul-01 5:09
suss27-Jul-01 5:09 
GeneralRe: PLEASE HELP !!!! URGENT !!!!!!!!!! save struct in file Pin
Joaquín M López Muñoz27-Jul-01 5:37
Joaquín M López Muñoz27-Jul-01 5:37 
Questionproblem with SetActiveView( , ),,?????? Pin
mr200327-Jul-01 4:40
mr200327-Jul-01 4:40 
AnswerRe: problem with SetActiveView( , ),,?????? Pin
Tomasz Sowinski27-Jul-01 4:50
Tomasz Sowinski27-Jul-01 4:50 
GeneralRe: problem with SetActiveView( , ),,?????? Pin
mr200327-Jul-01 6:06
mr200327-Jul-01 6:06 
GeneralRe: problem with SetActiveView( , ),,?????? Pin
Matt Gullett27-Jul-01 6:14
Matt Gullett27-Jul-01 6:14 
GeneralRe: problem with SetActiveView( , ),,?????? Pin
mr200327-Jul-01 8:34
mr200327-Jul-01 8:34 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.