Click here to Skip to main content
15,909,651 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Dymanic windows (clarified) Pin
Alton Williams13-May-04 4:08
Alton Williams13-May-04 4:08 
GeneralRe: Dymanic windows (clarified) Pin
Jens Doose13-May-04 4:44
Jens Doose13-May-04 4:44 
GeneralRe: Dymanic windows Pin
David Crow10-May-04 3:07
David Crow10-May-04 3:07 
GeneralRe: Dymanic windows Pin
Alton Williams13-May-04 3:33
Alton Williams13-May-04 3:33 
GeneralRe: Dymanic windows Pin
marcosvpp10-May-04 5:54
marcosvpp10-May-04 5:54 
GeneralRe: Dymanic windows Pin
Jens Doose13-May-04 3:46
Jens Doose13-May-04 3:46 
GeneralRe: Dymanic windows Pin
Marcos Vinícius13-May-04 4:51
sussMarcos Vinícius13-May-04 4:51 
GeneralNewbie DLL Question Pin
Hagiel9-May-04 4:37
Hagiel9-May-04 4:37 
okay here it goes ...

my app crashes cause of a DLL (coded correctly)
my DLL is accessing to a file, only to read ...
isn't it allowed to a dll to read a file? how to fix it ?

is there maybe another error?
Its a simply Win32 dll with CPP, Header and Def file
and my app is a console app (MFC apps crash too)

the debugger links me to "output.c"

if i write other console apps it crashes too ...

can any1 help me?

int main(int argc, char* argv[])<br />
{<br />
	if (argc < 2)<br />
	{<br />
		printf ("Usage is: <CharFile> \n");<br />
		getchar();<br />
		return 1;<br />
	}<br />
	char * output = "";<br />
	char hash[5] = "abcd"; // Some Decoding hash<br />
	char * outputfile = "";<br />
	sprintf(outputfile,"%s.txt",argv[1]);<br />
	FILE * fp = fopen(argv[1],"r");<br />
	FILE * f = fopen(outputfile,"wt");<br />
<br />
	if (!fp)<br />
	{<br />
		printf ("Error opening file %s\n", argv[1]);<br />
		getchar();<br />
		return 2;<br />
	}<br />
	int findex = 0;<br />
	unsigned char d;<br />
	while (!feof(fp)) <br />
	{<br />
        int c = fgetc(fp);<br />
        if (c == EOF) break;<br />
        unsigned char k = (hash[findex % 4] + findex) % 256;<br />
        d = c ^ (k | 0x80);<br />
		findex++;<br />
		output += (char) d;<br />
		fprintf(f,(const char *) d);<br />
	}<br />
	fclose(fp);	<br />
	fclose(f);<br />
	return 0;<br />
}

QuestionHow to move caret around in characters in an Edit control? Pin
Gary Shen9-May-04 4:33
Gary Shen9-May-04 4:33 
AnswerRe: How to move caret around in characters in an Edit control? Pin
Ravi Bhavnani9-May-04 6:24
professionalRavi Bhavnani9-May-04 6:24 
GeneralSplitter window question Pin
Chakrdeep9-May-04 3:15
Chakrdeep9-May-04 3:15 
GeneralRe: Splitter window question Pin
Ravi Bhavnani9-May-04 4:22
professionalRavi Bhavnani9-May-04 4:22 
GeneralIP lister... Pin
Snyp9-May-04 3:03
Snyp9-May-04 3:03 
GeneralRe: IP lister... Pin
Andrew Walker9-May-04 3:25
Andrew Walker9-May-04 3:25 
GeneralRe: IP lister... Pin
Ravi Bhavnani9-May-04 4:25
professionalRavi Bhavnani9-May-04 4:25 
GeneralRe: IP lister... Pin
Snyp9-May-04 4:28
Snyp9-May-04 4:28 
GeneralRe: IP lister... Pin
Paul Ranson10-May-04 1:13
Paul Ranson10-May-04 1:13 
GeneralRe: IP lister... Pin
David Crow10-May-04 3:23
David Crow10-May-04 3:23 
GeneralRe: IP lister... Pin
David Crow10-May-04 3:18
David Crow10-May-04 3:18 
GeneralMemory allocation Pin
Luis Ricardo9-May-04 2:06
Luis Ricardo9-May-04 2:06 
GeneralConvert to UCS-2 .. Pin
rasha20038-May-04 23:11
rasha20038-May-04 23:11 
GeneralRe: Convert to UCS-2 .. Pin
Michael Dunn9-May-04 5:51
sitebuilderMichael Dunn9-May-04 5:51 
GeneralRe: Convert to UCS-2 .. Pin
rasha20039-May-04 8:20
rasha20039-May-04 8:20 
GeneralRe: Convert to UCS-2 .. Pin
Michael Dunn9-May-04 20:11
sitebuilderMichael Dunn9-May-04 20:11 
GeneralRe: Convert to UCS-2 .. Pin
rasha200310-May-04 5:09
rasha200310-May-04 5:09 

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.