|
Product |
FileUp |
Version |
2.x |
Title |
Invoking SA-FileUp from within another component |
Problem |
If you are developing other Active Server components and wish to encapsulate
upload functionality within them, you probably have some of the following
questions:
- Can SA-FileUp be invoked from within another component?
- Are the interfaces only IDispatch, or dual?
- How do find all the methods and properties to use from with my C++ based component?
- What threading model should I be using?
- Are there any private interfaces I should know about?
|
Solution |
SA-FileUp can be invoked from with another Active Server component with relative
ease. It is dependent upon the Active Server Pages execution context, so it
cannot be invoked outside of IIS/ASP.
- Yes, but it must be instanciated with IServer::CreateObject, not CoCreateInstance.
SA-FileUp uses the OnStartPage event to get necessary pointers. It also uses
the OnEndPage event to clean up unsaved cache files. Only instanciation from
IServer::CreateObject will create the necessary context.
- All of the interfaces are dual. They can be invoked directly from any language
that supports early binding, such as Visual Basic or C++. Only Automation-compatible
types are supported.
- Use Visual C++ 5. It has the wonderful and useful #import directive.
The entire type library is contained within SAFILEUP.DLL
- SA-FileUp supports both apartment and free-threading. Your component should
be marked as apartment or both. Marking as Single, as with with Visual Basic 5 prior
to Visual Studio Service Pack 2, is a bad idea.
- There are private interfaces, but there should be no need to know or use them. If there is some property or method which you find lacking, please let us know.
See also: Microsoft's "HOWTO: Create ATL COM Wrapper for ATL COM Component to be Used With ASP" |
Created : 12/1/2002 12:00:00 AM (last modified : 11/29/1999 2:27:00 PM) |
|