Server Help

Non-Subspace Related Coding - What is DWORD?

hellzlaker - Tue Aug 12, 2008 11:06 am
Post subject: What is DWORD?
I know it stands for double word in 32 bit, but i don't get how come DWORD can be like 0x00045 or bunch of other digits, and not 2 words like it means, for me a double word is something like "funny cat"
Bak - Tue Aug 12, 2008 11:13 am
Post subject:
http://en.wikipedia.org/wiki/Word_(computer_science)#Dword_and_Qword
Samapico - Tue Aug 12, 2008 6:42 pm
Post subject:
Numbers represented by 0x#######...
are hexadecimal numbers

2 hexadecimal characters are equivalent to one byte. Hex characters are 0 to 9 and A to F (16 different possible characters). Combine 2 hex characters you get 16*16 different possibilities, representing values from 0 to 255, just like a byte.

So a word being 16 bits, or 2 bytes (as shown in Bak's link), a Dword would be 4 bytes, so something like 0x00112233 would be a DWORD I guess

Correct me if I'm wrong, people

Fun fact:

http://en.wikipedia.org/wiki/Intel_80486 wrote:
(The i486 was so named, without the usual 80-prefix, because of a court ruling that prohibited trademarking numbers like 80486. Later, with the Pentium, Intel dropped number-based naming altogether.)

Bak - Tue Aug 12, 2008 6:56 pm
Post subject:
Quote:
So a word being 16 bits, or 2 bytes (as shown in Bak's link), a Dword would be 8 bytes
icon_sad.gif
hellzlaker - Tue Aug 12, 2008 8:53 pm
Post subject:
uhm Bak was Samapico wrong? why so said?

Also how do you download a file from the web in c++? I searched on google and all I found out was that its easy in win32 but didn't find how to do it
Samapico - Tue Aug 12, 2008 10:21 pm
Post subject:
4



4 it is


2 x 2 = 4

I wrote a word was 4 bytes first, then noticed it was 2... so ... yeah... tongue.gif
hellzlaker - Tue Aug 12, 2008 11:11 pm
Post subject:
oh OK so DWORD pretty much is used for memory addresses

what about how to download a file from the web?
Samapico - Tue Aug 12, 2008 11:34 pm
Post subject:
well, for one it has nothing to do with dwords,

and... well there are probably 314315 different ways to do it.

http://www.google.ca/search?hl=fr&q=c%2B%2B+download+file&meta=

first result gives what looks like a project that does what you want.
hellzlaker - Wed Aug 13, 2008 12:44 am
Post subject:
ah I searched "how to make c++ download files from the web" and couldn't find anything good, thanks
hellzlaker - Wed Aug 13, 2008 1:44 am
Post subject:
wierd problem my code

HRESULT download = URLDownloadToFile(0,"http://wua.la/hellzlaker/Documents/afa.txt","A3_GANJA_Config.ini",0,0);

visual c++ gives me this

'URLDownloadToFileW' : cannot convert parameter 2 from 'const char [54]' to 'LPCWSTR
k0zy - Wed Aug 13, 2008 8:37 am
Post subject:
It's not wierd...

How about you try casting it into a LPCWSTR?
Oh wait... that's a wide string.

Try the _T macro.

URLDownloadToFile(0, _T("http://wua.la/hellzlaker/Documents/afa.txt"),"A3_GANJA_Config.ini",0,0);
hellzlaker - Wed Aug 13, 2008 9:37 pm
Post subject:
I fixed it the _T macro didn't work, neither did L and TEXT() but I fixed it, when to options and changed character settings from unicode to multi byte
All times are -5 GMT
View topic
Powered by phpBB 2.0 .0.11 © 2001 phpBB Group