Click here to Skip to main content
15,906,237 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
psychegr2-Sep-09 21:16
psychegr2-Sep-09 21:16 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
Randor 2-Sep-09 21:50
professional Randor 2-Sep-09 21:50 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
psychegr3-Sep-09 1:12
psychegr3-Sep-09 1:12 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
Randor 3-Sep-09 9:31
professional Randor 3-Sep-09 9:31 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
psychegr8-Sep-09 9:40
psychegr8-Sep-09 9:40 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
Randor 8-Sep-09 14:42
professional Randor 8-Sep-09 14:42 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
psychegr8-Sep-09 22:00
psychegr8-Sep-09 22:00 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
psychegr10-Sep-09 4:55
psychegr10-Sep-09 4:55 
David,

Do you see any wrong in this code?
I get always the error C2440 "=" cannot convert from "char [64]" to "unsigned char *"!

int do_srec (srecord *where, FILE *infile)
{
	int ctr,asize,c;
	BYTE *put, s9flag = 0;

	do c = fgetc (infile);
	while (c != 'S' && c != EOF);
	if (c == EOF) return SREC_EOF;
	FREAD (infile,where->rectype);
	switch (where->rectype)
	{
		case	'0':
		asize = 2;
		break;

		case	'1':
		case '2':
		case '3':
		asize = 1 + where->rectype - '0';
		break;

		case	'7':
		case '8':
		case '9':
		asize = 11 - (where->rectype - '0');
		s9flag = 1;
		break;

		default:
		return SREC_FORMAT;
	}
	checksum = 0;
	where->reclen = collect (1,&c, infile);
	where->address = 0;
	for (ctr = asize; ctr; ctr--)
	{
		where->address <<= 8;
		where->address |= collect (1,&where->reclen, infile);
	}
	put = where->bytes;
	for (ctr = where->reclen-1; ctr; )
		*put++ = collect (1, &ctr, infile);
	collect (1, &where->reclen, infile);
	if (checksum != 0xff) return SREC_CHECKSUM;
	where->reclen += 4;
	return s9flag ? SREC_S9 : 0;
}

The error occurs in the 8th line from the end!
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
Randor 10-Sep-09 18:52
professional Randor 10-Sep-09 18:52 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
psychegr11-Sep-09 5:53
psychegr11-Sep-09 5:53 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
Randor 11-Sep-09 7:15
professional Randor 11-Sep-09 7:15 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
psychegr15-Sep-09 13:02
psychegr15-Sep-09 13:02 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
Randor 16-Sep-09 3:45
professional Randor 16-Sep-09 3:45 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
psychegr17-Sep-09 9:28
psychegr17-Sep-09 9:28 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
Randor 17-Sep-09 17:00
professional Randor 17-Sep-09 17:00 
GeneralRe: Program that uses LPT port to communicate with a circuit that programs a cpu! Pin
psychegr20-Sep-09 4:28
psychegr20-Sep-09 4:28 
QuestionEOF Pin
cdpace2-Sep-09 10:25
cdpace2-Sep-09 10:25 
AnswerRe: EOF Pin
Luc Pattyn2-Sep-09 10:45
sitebuilderLuc Pattyn2-Sep-09 10:45 
GeneralRe: EOF Pin
«_Superman_»2-Sep-09 17:24
professional«_Superman_»2-Sep-09 17:24 
GeneralRe: EOF Pin
David Crow3-Sep-09 2:52
David Crow3-Sep-09 2:52 
GeneralRe: EOF Pin
«_Superman_»3-Sep-09 7:09
professional«_Superman_»3-Sep-09 7:09 
QuestionCapture non-client mouse click on sizable window Pin
Darryl Bryk2-Sep-09 10:22
Darryl Bryk2-Sep-09 10:22 
AnswerRe: Capture non-client mouse click on sizable window Pin
«_Superman_»2-Sep-09 17:29
professional«_Superman_»2-Sep-09 17:29 
GeneralRe: Capture non-client mouse click on sizable window Pin
Darryl Bryk3-Sep-09 9:29
Darryl Bryk3-Sep-09 9:29 
GeneralRe: Capture non-client mouse click on sizable window Pin
«_Superman_»3-Sep-09 17:08
professional«_Superman_»3-Sep-09 17:08 

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.