🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Browser

Started by
15 comments, last by CJ 24 years, 6 months ago
Yep, just like ZemeonE said, you want to use multiple threads. This is really easy to do. You would also want a new thread for each image, so that they can download at the same time.
Advertisement
Okay, thanx to your input I implemented multithreading. I got some weird error messages, but solved that with static.....

Now...i stumbled across some weird problem.......and that is that the program terminates when it reaches the following line of code:

file->SetReadBufferSize(4096);

file is a CInternetFile

My code looks like:

CInternetSession session;CString Code = "Quering\r\n";CInternetFile  *file = NULL;try{	file = (CInternetFile*)session.OpenURL((char*)URL);}catch(CInternetException* pEx){	file = NULL;	pEx->Delete;}if(file){	Code += "Connection established.\r\n";	CString line;	file->SetReadBufferSize(4096);			while(TRUE)	{		if(file->ReadString(line) == FALSE) break;		Code += line + "\r\n";	}	file->Close();	delete file;}else{	Code += "No server has been found \r\n";}


This code worked fine without multithreading, so I am wondering why it causes a termination of the program. I am quite confused about it.

It says it exits with code(3)......

Debugging doesn''t seem to help (me)...

Dance with me......

http://members.xoom.com/CJdeVos/index.htm

Oh, also when I try to access the normal variabeles in my program.....like m_Code (which is a textbox)....it gives me an error like: (out of the head)

CMyProgram::m_Code Object has to point to class, struct, onion...

or something similar to that.......

Dance with me......

http://members.xoom.com/CJdeVos/index.htm

Have you associated the correct variable type with your text box? Maybe it should be a control or something similar? Sorry I cannot help further as I am not too experienced at trouble-shooting MFC programs. I am into Win32 these days. =)

Best regards,
Sherman
_________________ Best regards, Sherman Chin Director Sherman3D (Malaysia) Sdn Bhd www.Sherman3D.com www.AlphaKimori.com
Looks like it is adios to the medieval world of Imperial Guards, Knights and Kings - back to plain old Dedicated, Zealot, etc.
Hehehehe =) What next? Private, Lieutenant, Captain, Admiral and so on? =) Very interesting indeed =) I am serious....this is fun =)

Best regards,
Sherman
_________________ Best regards, Sherman Chin Director Sherman3D (Malaysia) Sdn Bhd www.Sherman3D.com www.AlphaKimori.com
You can find more information on the browser stuff in MFC at http://www.codeguru.com

Admin for GameDev.net.

There is something obviously wrong with the message board. The URL hyperlinks do not work and the table length is too long in Netscape requiring us to scroll left and right. I certainly hope it can be rectified soon. Thanks.

Best regards,
Sherman
_________________ Best regards, Sherman Chin Director Sherman3D (Malaysia) Sdn Bhd www.Sherman3D.com www.AlphaKimori.com

This topic is closed to new replies.

Advertisement