|
gr8coaster329 wrote: does anyone how internet accelerators work
Generally when a big file is downloaded say 1MB, the internet explorer downloads the file using one single socket i.e. serially, The problem with this approch is that the data back should come to you without wasting the bandwidth i.e. There should be no time gab between 2 packets.
So the accelerators opens more than one socket and downloads the file from different part of the file, i.e partial download, partial download is possible in http1.1 and also the server should support the partial download.
Downloading the same file from different offset, to some extend improves the bandwith utilization and hence improves the download time.
gr8coaster329 wrote: any help, includeing websites tutorial or ideas would be greatly appreciated.
Check the GET HTTP request for more info, You might need to know the HTTP protocol for this too.
or google "partial get request"
Partial request can also be achived using FTP protocol, so the download accelerators uses either FTP or HTTP depending on the location of the content i.e. on http server or ftp server.
-Prakash
|
|
|
|
|
I need a console app (it is called from various other programs) that processes some data from various files and at times needs to send data to a (let's say generic text) printer with some printer control instructions. I cam across a sample in the help files with starts:
BOOL RawDataToPrinter(LPSTR szPrinterName, LPBYTE lpData, DWORD dwCount)<br />
{<br />
HANDLE hPrinter;<br />
DOC_INFO_1 DocInfo;<br />
DWORD dwJob;<br />
DWORD dwBytesWritten;<br />
<br />
if( ! OpenPrinter( szPrinterName, &hPrinter, NULL ) )<br />
return FALSE;<br />
.....
This seemed to do what I need. I included WinNT.h and then the fun began: Compiling just presents a long list off errors in the WinNT.h file:
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winnt.h(273) : error C2146: syntax error : missing ';' before identifier 'WCHAR'
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winnt.h(273) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
c:\program files\microsoft visual studio 8\vc\platformsdk\include\winnt.h(276) : error C2143: syntax error : missing ';' before '*'
and many others.
Any ideas? Suggestions? -- Honestly I have not yet started to celebrate the new year!
Ludwig
|
|
|
|
|
Try creating a console application with win32 support.
-Prakash
|
|
|
|
|
Hi and belated Merry Christmas to everybody! I wish you all a Happy New Year and may it bring you all health and happyness and luck to your families.
Oh and yes, I do have a question: I got a VC++ 6 DLL project. Simple. Win32. How can I add a "Description", "Company Name" and "Version" to it?
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Add a Version resource to the project.
onwards and upwards...
|
|
|
|
|
Hi basementman. I can't really add a version resource 'cause as I said this is an emtpy win32 DLL project. It only holds a .cpp and a couple of Hs. Can I do it like this?? How can I add such a resource?
-= E C H Y S T T A S =-
The Greater Mind Balance
|
|
|
|
|
Hi,
I have a this problem that I don't succeed in connecting to another computer through the net, can anyone please help me?
I have two computers in different locations:
1) Both get the ip through the local computer name and then a call to gethostbyname and inet_ntoa. Is there a better way achieving the current ip?
2) I use a hub, how can I get my real IP and not what the hub gives me?
3) On the other computer a server listens on INADDR_ANY and a certain port, when I try to connect to it with the ip found in section 1, I fail after a timeout. I tried pinging the computer with the ip found, but it was unreachable. Can it be the ip is unreachable (even when the firewall is down)? What can be the problem? The socket connects without problems to sites on the internet and to the local computer ip.
thanks in advance,
O.
|
|
|
|
|
If you are behind a NAT server, you cannot really get your public IP, except by doing something externally like doing an HTTP connect to download a webpage that simply returns your IP address. For e.g., you could connect to www.whatismyip.com and download the index page, and then parse out the IP address from there.
|
|
|
|
|
I am trying to design a simple program for keeping track of how long people are sitting at a position in a workplace. I would like to represent each person with a small square that looks like a button but can be dragged into and out of position. The button like graphic would have a space for a name and a timer. Is this just a matter of designing a small dialog box or is there some other simple way to do this using icons or cursors ??
thanks
|
|
|
|
|
How to avoid this error and send tcp pack in raw sock mode while sendto() returns SOCK_ERR and WSAEINTR "Interrupted function call." by WSAGetLastError(), although udp packs goes normally. (The code is completely functional and without errors.)
9ine
|
|
|
|
|
I want to write a CStringW string to a wfstream but it doesn't seem to work. Does anyone know how to do this?
my sipet is:
CStringW sRus(_T("ершы шы ф еуые"));
wfstream outFile;
outFile.open("C:\\Junk.txt",ios_base::out);
outFile << sRus << '\n';
outFile.close();
Chris
|
|
|
|
|
|
ChrisLang wrote: I want to write a CStringW string to a wfstream but it doesn't seem to work
The reason why is explained here[^].
The two most common elements in the universe are Hydrogen and stupidity. - Harlan Ellison
Awasu 2.2 [^]: A free RSS/Atom feed reader with support for Code Project.
|
|
|
|
|
You need to open the file in binary mode:
outFile.open("C:\\Junk.txt",ios_base::out | ios_base::binary);
Hope that helps.
Karl - WK5M
PP-ASEL-IA (N43CS)
<kmedcalf@ev1.net>
PGP Key: 0xDB02E193
PGP Key Fingerprint: 8F06 5A2E 2735 892B 821C 871A 0411 94EA DB02 E193
|
|
|
|
|
I have spent hours scouring the net for the answer to this, I do hope somebody could help me here
I'm currently coding an English-Chinese dictionary in C. This dictionary will later be embedded into a PDA with the Hopen OS (Don't worry about this). Anyway, due to this, my final code has to be contained in only 1 file, ie... no .bin or .txt
Basicaly I have included in my code a rather large word list in the following format
#define MAXCHN 100<br />
#define MAXPIN 100<br />
#define MAXENG 200<br />
<br />
typedef struct {<br />
char chn[MAXCHN];<br />
char pin[MAXPIN];<br />
char ove[MAXPIN];<br />
char eng[MAXENG];<br />
}<br />
<br />
Words words[] = <br />
{ <br />
{"°¡","a","¨¡","(interj.) | ah"},<br />
{"°¢","a","¨¡","an initial particle | prefix to names of people"},<br />
{"ºÇ","a","¨¡","(phonetic particle)"}
(please note you may need to alter your code page)
This is some 30000 lines of text.
Now this works all good and proper, but with one drawback, The size. The origional text file is only 1.6Mb, after compilation the file is some 16MB. I realised my error in that each C string is allocated what I earlier defined. So after I compile, some of the shorter lines have a mass of white space after them, increasing the size.
All the text is constant, it will not be changed at all. Basically it is just a waste of space.
Instead of literal strings I tried using pointers i.e
typedef struct {<br />
char *chn;<br />
char *pin;<br />
char *ove;<br />
char *eng;<br />
}
Though this causes buffer overruns during execution. Maybe I overlooked something but I'm pretty sure this isn't the way to go.
Any help, advice or even a head banging would be greatly appreciated. Thankyou.
|
|
|
|
|
waldermort wrote: Though this causes buffer overruns during execution. Maybe I overlooked something but I'm pretty sure this isn't the way to go.
Well, how do you allocate the different strings ?
'any way, I would try to do this in a 2 passes process; write an application that generate a dictionnary in binary format (hexa, or uuencoded ) , and include that data in your final application, use that data as the dictionnary.
or do something like ( does that work ? ):
typedef struct Word {
char *chn;
char *pin;
char *ove;
char *eng;
}
Word _word[] =
{
{"°¡","a","¨¡","(interj.) | ah"},
{"°¢","a","¨¡","an initial particle | prefix to names of people"},
...
};
now, each string ( chh, pin, ove, eng ) will have the right size.
Maximilien Lincourt
Your Head A Splode - Strong Bad
|
|
|
|
|
I didnt exactly get u ? ... The size of exe is issue or memory used by program while it is running is issue ?
If both are issues go for allocating data on heap. Only allocate data for the character required at that time while deleting the previous one. I mean u will have use switches with 30,000(whatever lines of text is) cases.
I hope I have understood ur problem correctly && u have understood the solution.
Best of Luck & Best Regards,
|
|
|
|
|
Thanks for the quick replies.
The memory used while running is no problem, however the size of the exe is.
Creating a pointer for each e.g char *chn; causes the program to crash, as far as I can see it has something to do with determining the string length. This may have something to do with limitations of the SDK I am using.
I think I will try recoding this and using multi dimensional arrays.
My question is, what is the best way to include this much text, while at the same time saving space within the exe?
|
|
|
|
|
If exe size is problem then start allocating data on heap. or the other option is compressing data by using binary data just the way Maximilien mentioned.
|
|
|
|
|
waldermort wrote: Words words[] =
{
{"°¡","a","¨¡","(interj.) | ah"},
{"°¢","a","¨¡","an initial particle | prefix to names of people"},
{"ºÇ","a","¨¡","(phonetic particle)"}
MAXCHN 100
See MAXCHN is 100. And you are storing just a small amount of string ie about 2 or 4 chars in each. Once you do this it will run fine. But each structure will take up 400 bytes.
Now just think about the number of structures you allocate. .
I think this is the problem. Be more careful with this.
waldermort wrote: typedef struct {
char chn[MAXCHN];
char pin[MAXPIN];
char ove[MAXPIN];
char eng[MAXENG];
}
You can restructure it like this...
struct {
char chn[10];
char pin[10];
char ove[10];
char eng[MAXENG];
}
Just an Idea.
Jesus Loves You and Me <marquee direction="up" height="50" scrolldelay="1" step="1" scrollamount="1" style="background-color:'#44ccff'">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
What ur doing is static array , u need to dynamically allocate
memory .
I can see the problem is the Size of file not the memory usage.
Actually from the Architecure view ur including the data file
in your code file , this is an issue .
Do one thing u can create a structure that also stores the
size of four array
<br />
typedef struct{<br />
int MAXCHN,MAXPIN,MAXENG;<br />
char chn*;<br />
char pin*;<br />
char ove*;<br />
char eng*;<br />
}
Process the data file and change the size of each
individual structure data.
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
-- modified at 1:21 Friday 30th December, 2005
|
|
|
|
|
Thanks for the advice guys, you have all been very helpful. I saw the error was in not dynamicaly allocating the arrays.
I have scrubbed the whole struct and instead used a an array of pointers to an array of pointers. char *(*results[MAXSTR])[4] Urgh I hated to say it, sorry, I hate arrays too - give me STL any day of the week. Anyway this method is proving more efficient memory wise also since I don't need to deal with whole strings rather just the pointer.
What I thought earlier were buffer overruns were infact a little bug I had overlooked. when calling textout I had set a static length, if the text was shorter then it didnt matter because the white space at the end of the array was overwriting what was previously drawn. When dynamicaly allocating this was causing problems. It'll teach me to clear the canvas before drawing.
I have now got the exe (debug) down to 5mb. for some reason I am having the C1001 INTERNAL COMPILE ERROR when trying a release build. I am also thinking about including a huffman algorithm to further reduce some of that ascii.
|
|
|
|
|
when I select an icon in view, I want the icon appearanced changed to indicate that it is selected.I don't know how to resolve this question .
the icon is on the view.
Help me,thank you.
|
|
|
|
|
See here.
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
I draw some icons into view ,the icon is from a file.I also draw some text in the view . the view inherit from CSrollView.
but the icon can't be output at the end.
thank you .
|
|
|
|