[Seaside] Squeak/.Net question

Valdas Bucinskas valdas.bucinskas at ipsistemos.lt
Wed Sep 14 08:50:15 CEST 2005

Sry. my initial intention wasn't clearly stated in the first post. I wanted
to make seaside app, which allow the user to press button and get COM object
window.  I found tutorial at http://minnow.cc.gatech.edu/squeak/3773 and
started walking trough it.

You mentioned Squeak/.NET Bridge version R9. I see only R7 in my package
loader :(
I tried installing it with VMMaker, but then I get primitive fail error
executing DotNet startNew. So I switched back to R5, which seemed to work

The tutorial I mentioned above uses *.ocx file. I tried doing the same with
*.tlb file (generated it with Gupta SQL Windows). The only difference from
tutorial was that I generated DLL pointing tlbimp utility to *.tlb instead
of  *.ocx. There are two methods (sayThis and sayOne) in my file. Here is
what I got (taken from Lutz Roeder's .NET Reflector):

namespace guptacomtest2
      [ComImport, CoClass(typeof(DoerClass)),
      public interface Doer : IDoer

      [ComImport, TypeLibType(2), DefaultMember("sayThis"),
Guid("CD60B8E2-627E-4B06-A75B-B57A48002FBF"), ClassInterface(0)]
      public class DoerClass : IDoer, Doer
            // Methods
            [PreserveSig, MethodImpl(MethodImplOptions.InternalCall,
MethodCodeType=MethodCodeType.Runtime), DispId(1)]
            public virtual extern void sayOne();
            [PreserveSig, MethodImpl(MethodImplOptions.InternalCall,
MethodCodeType=MethodCodeType.Runtime), DispId(0)]
            public virtual extern void sayThis([In,
MarshalAs(UnmanagedType.BStr)] string sParm);

      [ComImport, InterfaceType(2), DefaultMember("sayThis"),
Guid("3F6D4C7A-B79B-4078-8689-F5876695D3AC"), TypeLibType(0x1000)]
      public interface IDoer
            [PreserveSig, MethodImpl(MethodImplOptions.InternalCall,
MethodCodeType=MethodCodeType.Runtime), DispId(0)]
            void sayThis([In, MarshalAs(UnmanagedType.BStr)] string sParm);
            [PreserveSig, MethodImpl(MethodImplOptions.InternalCall,
MethodCodeType=MethodCodeType.Runtime), DispId(1)]
            void sayOne();

Now I try calling these methods this way:

DotNet Assembly loadFrom: 'guptacomtest2.dll'.
DotNet startNew.
shell := DotNet DoerClass new.

And the Squeak hangs on the execution of the last line. I have to terminate
process with ALT+dot. I see (last 2 lines).


So the questions are:
1. Is there any differences between generation of DLL using *.tlb instead of
*.ocx? Any info about what program to use to build the ocx or tbl that
Squeak understands would be very much appreciated.
2. Any other ideas what I did wrong?

Best regards,

More information about the Seaside mailing list