Home     Products      Support      Corporate     Sign In 
Support Knowledge Base, Article 13
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:
  1. Can SA-FileUp be invoked from within another component?
  2. Are the interfaces only IDispatch, or dual?
  3. How do find all the methods and properties to use from with my C++ based component?
  4. What threading model should I be using?
  5. 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.
  1. 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.
  2. 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.
  3. Use Visual C++ 5. It has the wonderful and useful #import directive. The entire type library is contained within SAFILEUP.DLL
  4. 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.
  5. 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)
Rate this article!
 
Comments