SUMMARY:
The only functionality is parameter passing and return values.
The test data can be hard-coded. This is a very simple project.
Pass in a simple COM object from a VBScript and return an safearray of? other COM objects. Details Below:
Write a very simple Microsoft Windows COM component in C++ that can be called from VBScript and C++.? This project should be entirely written in C++ without using the Active template Library (ATL). (I need to see how everything works).
This is the pseudocode showing the details of the interface:
(This pseudocode is written in C/C++ instead of IDL)
struct RECTANGLE {? ? // Single Parameter
? Integer top;
? Integer left;
? Integer bottom;
? Integer right;
}
struct MatchedItem { // One element of a safearray?
? RECTANGLE BoundingBox;?
? BSTRING String;? ? ? ? ? ?
};?
// The only function
MatchedItem[] ReadScreen(RECTANGLE& BoundingBox);
ReadScreen(RECTANGLE& BoundingBox), and return an array of MatchedItem.? This project should compile under Visual Studio 2008.? The function does not have to really do anything besides return hard coded test data.? The function takes a single RECTANGLE parameter.
The purpose of this project is to teach me these details of COM.? The code must be as easy to understand as possible, and well documented, and extensible.? The documentation should explain how to extend the code, especially? how to add functions with different parameters.
From what I understand this will involve created three COM Objects:
{RECTANGLE, MatchedItem, and ScreenReader}. Apparently VBScript can not deal with structures in any other way.
The project should implement the dual interface so that VBScript clients and C++ clients can easily use the interface.
The? deliverables of the project will include the C++ Code and all files used in development along with a? VBScript and C++ test driver.