|
It is only required if you want ot have notifications about the progress of download process, if you just want to download a file without any progress bars use this
HRESULT hr = URLDownloadToFile(NULL,"http://...",szFilename,255,NULL);
if(FAILED(hr))
{
MessageBox(NULL,szFilename,"FAILED",MB_OK);
}
Hope it Helps
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
URLDownloadToFile(NULL,"http://...",szFilename, BINDF_GETNEWESTVERSION, NULL);
greatest thing is to do wot others think you cant suhredayan@omniquad.com>
messenger :suhredayan@hotmail.com
|
|
|
|
|
Hey thanx for the help guys got it working now , till next time.............
[] /\ () X
|
|
|
|
|
Hello everyone:
Is there some WTL structure like POSITION of MFC?
Thank you.
-Freehawk
|
|
|
|
|
No.
I suspect you want the collection classes, use STL instead.
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
Thank you for the reply.
Please tell me How to use STL instead to it?
-Freehawk
|
|
|
|
|
To do what?
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
ATL also has their own array classes that produce smaller object code that STL but aren't as near as powerful.
Pick up a good book on STL. It is really some nice stuff. I personally use the collection classes. Some of the other stuff can be problematic.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
It's a steep learning curve if u don't even have MFC Background.
To start with ATL suggested by Tim, u got to know where to get the documentation from.
Look into \vc98\ATL\ATLwin.h for example. U get all the ATL helper classes.
STL is purely for C++ gurus only, ATL is a build up from STL. U need to know ur STL before u know what's happening in ATL. ATL is sort of superceded by WTL now. So look up WTL for better wrapper classes which are equivalents of those classes in MFC.
|
|
|
|
|
Try this link, should be helpful for u to know what new template classes are out there for u to use.
http://www.viksoe.dk/wtldoc/
|
|
|
|
|
Anonymous wrote:
It's a steep learning curve if u don't even have MFC Background.
We can assume that freehawk already has an MFC background since he refers to POSITION.
Anonymous wrote:
STL is purely for C++ gurus only
No, it's not. I'm nowhere near being a C++ guru and use STL comfortably. In any case, it is now part of Standard C++ and anyone wanting to be a professional programmer needs to know how to use it. You do not need to understand everything about it to benefit from it. Just start slowly...
Kevin
|
|
|
|
|
There are plenty of articles here at CodeProject.
You might also try looking at the numerous examples in the VC online help. That's how I got going initially with basic use of strings, vectors, lists and so on.
There's also quite a good online tutorial here. http://www.sgi.com/tech/stl/[^]
Kevin
|
|
|
|
|
|
Hi all
I little messy in ATL conversion macros such as A2BSTR T2BSTR and so on.
I can't realize should i free returned buffer.
For instance:
//This is unicode project
USES_CONVERSION;
WCHAR wchr[] = L"XXXX";
BSTR str = W2BSTR(wchr);
/*
Ok returned buffer i should free by SysFreeString(str)
Because of
inline BSTR W2BSTR(LPCWSTR lp) {return ::SysAllocStrin (lp);}
*/
Now other shred of code:
//Unicode project
USES_CONVERSION;
WCHAR wchr[] = L"XXXX";
TCHAR* str = W2T(wchr);
//I can't free str by delete [] str; cause is same
//pointer as wchr
Do this meant whats all BSTR returned ATL macros
should be free directly , but allother returned pointers not.
THANKS
|
|
|
|
|
BSTR are an example of managed string that require you to use the Sys**** routines to manage the memory. However, other strings such as simple char or WCHAR strings are just arrays of characters. ATL uses this fact to store the temporary strings created by A2W or W2A (etc) on the stack (ATL3). Thus when the routine returns, the stack is automatically freed and the memory goes away properly.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
|
Hello everyone:
I need a WTL control in which tree and list is mixed. Please tell me where it is and some sample about it.
Thank you.
-Freehawk
|
|
|
|
|
|
Iam currently in the processing of producing a 3d vector graphics control that is based in an activeX control. Currently all of my data to define the 3d objects used in this control in hardcoded into the control. Obviously Iam very keen to remove this hardcoded data and the control retrieve the data from an external source IE a file.
Ive done some research into this and it seems like I may be wanting to use URLdownloadToFile to retrieve the information from a file. Is it correct that I will need to use this? And also how will I bind this data to a property of the activeX control? Obviously it would be desirable to have this information assigned to a property of the control after its instantiation in the HTML page or have it declared as a parameter upon control creation? Ideas n e 1???
(PS if it helps my control is very similar to such controls as macromedia shockwaves and cult3d which are all data driven exactly like I want mine to be)
[] /\ () X
|
|
|
|
|
Hi gurus,
I'm working on a ATL plug-in for MS Outlook, but I would like to make it work on Outlook Express as well. I understand that it's not possilble via COM technology (as OE does not expose any COM interfaces ), but something with hooks? Any documentation on the subject?
Any help / hint would be much appreciated.
Thanks in advance,
Doru K.
|
|
|
|
|
Hi everybody,
Does anybody know, how I can derive from an ATL object?
I have an ATL 3.0 project and I want to have a base class (suppose CMyBase) with some members, and an interface (suppose IMyBase) with some exposed methods and properties. how do I create a new ATL object that is derived from that class? I mean that the new ATL object inherits members from CMyBase and methods and properties from IMyBase.
Regards,
Roozbeh.
|
|
|
|
|
I am new to C++ and the container classes provided by the standard library (i.e. vector, list, map). Is it bad practice to subclass from a container class in order to add some specific semantics about a desired operation? A simple example would look like:
class MyClassContainer : vector<MyClass><br />
{<br />
bool addMyClass(MyClass &myObject)<br />
{<br />
push_back(myObject);<br />
};<br />
};
or is it better to create a class that contains a vector and define operations in terms of the member variable? The vector would be returned via some type of accessor method.
|
|
|
|
|
Actually, you can approach this two ways:
You already have a MyClass type stl::vector . Do you really need a class?
typedef MyClassVector vector<MyClass>;
The above is sufficient if you don't need anything more than MyClass vector functionality.
The other way is to contain a vector<MyClass> member variable and have type-safe accessors for your containing class as well as validation checks.
Either way is ok. The decision lies in how you will use it. The former would have no additional functionality while the latter can provide more services.
|
|
|
|
|
Thanks for response Ian. This information is helpful. I guess I will attack my problem with your second method. My goal is to provide a container class that will provide some functionality above that provided by the standard container classes. I also want to be able to use some of the standard algorithims (for_each, remove_if, sort) on the class. My original thinking was to subclass a container class so that:
1. I could add the additional services that I need (e.g. a time stamp of when the collection was generated and a method for updating the objects in the collection)
2. Have access to the iterators of the standard container classes...
3. Prevent my application from knowing whether a list, vector, map, multimap... etc. was used to contain the objects so that I could change this at some later date.
As I think that I have a finite number of operations that I wish to inherit from the base class (i.e. begin(), end(), insert()/push_back(), size(), at(), []) I think that I can wrap these calls inside of member functions and still accomplish goal numbers 2 and 3.
Again thanks.
|
|
|
|
|
If you don't want to expose the underlying collection as in 3; for number 2, you could provide an enumerator class (only creatable by your collection class) which exposes these methods:
MoveNext - which moves the iterator, e.g., it++ and returns a bool of true if the next item exists, false if not.
GetCurrent - which returns the current MyClass item, e.g., *it , or NULL if it doesn't exist.
|
|
|
|