Status update (July 5th – midterm)

Below is my status update from July 5th. I am leaving Krakow for a few days, so this is my last status report before the midterm evaluations.

I was planning to work on constructors, constants and enums this week, but instead I started playing around with IDispatch. It turned out that IDispatch is much easier to implement than I had anticipated. To be honest I have only worked with regular (or, as MSDN documentation calls them, VTBL) objects before and thought of IDispatch as a scary, weird API that takes ages to implement and get right. But then I found out about the helper functions in the Win32 API and they seem to be really well suited for my task. The bottom line is that the current code in Subversion fully supports IDispatch, both for the module class and for the proxy classes. This makes it possible to use the wrapped objects in WSH scripts (VBScript and JScript) and also to embed the generated objects in HTML pages and use the browser’s JavaScript to access them. Also the objects still support the regular (non-IDispatch) COM interfaces, and work in Delphi as before. I still haven’t had the opportunity to test with VB and VB.NET, but do not expect major problems (of course I will still test them, but I will need to get them from my university’s library first).

Another thing I have been working on since Monday is support for member variables (static and non-static). I am happy to say that they are implemented now. I have also modified the code to support COM properties – now if you access the wrapped code from Delphi or VBScript you don’t have to use getter/setter methods to access global and member variables. This means you can now write:

wrappedObject.memberVar := 15;

instead of


This is only ‘syntactic sugar’, but it was almost trivial to do, so I decided to implement this feature.

I have also modified the COM module to generate a .rc file, which includes the type library (.tlb) file for the wrapped module. I think this might be helpful for people who do not know (or do not want to know) too much about Win32 oddities. This can be turned off by a command line switch (-norcfile). I plan to make the initialization routine (DllMain), the class factory function (DllGetClassObject) and the registration functions (Dll[Un]LoadNow) more flexible for people who might want to have multiple wrapped objects in one DLL, or who have other requirements.

To sum up my work since May 26th – I haven’t completed some of the things I planned to do during the first half of SoC, e.g. constants/enums (which I have not really looked at yet), constructors and method overloading. On the other hand I have already done some things that I intended to do much later – those are the factory methods, component registration and IDispatch. The code currently in Subversion is reasonably functional and can already be used in some scenarios – notably functions and variables are made available through COM and can be accessed/modified/executed in a natural way. The creation and registration of a COM server does not require much manual work for the user – only compilation, linkage and registration. Overall I think I am on track with my project and I have a good chance of completing it by the end of this year’s Summer of Code.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: