|
I have tried the method which are suggest by u, Superman but it gives following error ---
unresolved external symbol _URLDownloadToFileW@20 referenced in function "void __cdecl funDownloadFile(void)" (?funDownloadFile@@YAXXZ)
|
|
|
|
|
Add Urlmon.lib to Project Properties -> Configuration Properties -> Linker -> Input -> Additional Dependencies .
|
|
|
|
|
Now it is working fine ... thanks a lot buddy..
|
|
|
|
|
avika wrote: but if we are trying to download a exe or even a jpg file then this code does not work fine.
What do you mean exactly?
BTW you should use the 'code block ' button to post code.
avika wrote: outfile.write(pszOutBuffer,sizeof(dwSize) * 50);
BTW2 Why 50 in the above line?If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
if We are pass only outfile.write(pszOutBuffer,sizeof(dwSize)); then it show less data in the text file. But if We pass the outfile.write(pszOutBuffer,sizeof(dwSize) * 50); then it show complete data thats why we are passing this.
|
|
|
|
|
avika wrote: outfile.write(pszOutBuffer,sizeof(dwSize) * 50);
That should be
outfile.write(pszOutBuffer,dwSize);
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
This above code works for binary image download, but the problem is:
For an image file with 18k size, only 4k can be download and just half of the image can be seen on the client side.
Any ideas?
Thanks.
|
|
|
|
|
Question:
In Polymorphism we give same name to function (function overloading).. so each function takes same memory or different?? If Yes than How and If no then why??
Please reply me as earlier as possible
|
|
|
|
|
First think, when posting use a relevant title. "hlp its urgent" is relevant at all: we know that you want help (why would you ask a question otherwise ?). Furthermore urgent requests are considered rude. Why would your question be more urgent than somebody else's question ?
Please, next time before posting, read the posting guidelines ("How to ask a question") at the top of this message board.
Now for your question, I suggest you take a look at this[^]. You can also google for "virtual table" for more information.
|
|
|
|
|
When you overload a function, basically you're giving the same name to two different functions (the compiler produces two functions with two different names in the object file) hence two different portions of code memory are, of course, used.
DX Roster wrote: Please reply me as earlier as possible If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
Yes, I know that.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
It is possible by name mangling.
The compiler actually generates different names for the functions.
Read how Visual C++ compiler does this - Microsoft Visual C++ Name Mangling[^]
|
|
|
|
|
Mmmh, I'm confused now. I don't know if he was talking about function overloading or function overriding. He used the word overloading but he also talked about polymorphism (which has nothing to do with overloading but with overriding).
|
|
|
|
|
Cedric Moonen wrote: he also talked about polymorphism (which has nothing to do with overloading but with overriding).
Overloading is also a type of polymorphism - compile time polymorphism.
“Follow your bliss.” – Joseph Campbell
|
|
|
|
|
There you have it.
Let's leave it to him to choose what he wants.
|
|
|
|
|
sir i want to know that if i write two function with same name(Polymorphism function overloading) then both function will take same memory or different..
if both will take same memory then how???
|
|
|
|
|
They will actually become 2 different functions with different names.
The change in names is done by the compiler and this is called name mangling.
|
|
|
|
|
sir so both function will take different memory.... is it correct then how???
plz
|
|
|
|
|
Anyway, if you meant overloading or overriding, both functions will start at different memory addresses (two different functions cannot start at the same memory address, it doesn't make sense).
|
|
|
|
|
In case of overloading yes. It still isn't clear (at least for me) if he really meant overloading (he didn't answer the question, just put the words in a different order ).
|
|
|
|
|
DX Roster wrote: Polymorphism function overloading
Did you follow our discution ? If yes, do you understand the difference between function overloading (two functions with the same name but different arguments) and function overriding (a function which is redefined in a child class) ?
So please, indicates which is the exact case you are interested in, because these are two completely different cases.
|
|
|
|
|
As strange may appear (at least it appears strange to me), overloading is considered polymorphism (after all, you are issuing the same request on objects of different nature and the behaviour may be different on such different types).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Yeah, that's what Rajesh also said but I honnestly don't think that's what the OP meant by polymorphism
|
|
|
|
|
The OP request was fully polymorphic: it generated completely different reactions from the different subjects... If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|