[Seaside] Squeak/.Net question

Valdas Bucinskas valdas.bucinskas at ipsistemos.lt
Wed Sep 14 10:30:25 CEST 2005

At last I managed to install Squeak/.NEt bridge R7 wihout any warnings &
errors. After executing

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

I get the error 'DotNetException: Error in the DLL'. Wooho! At least I know
where to start searching from! Though a bit more informative error message
(what kind of DLL error is that) would be nice.


-----Original Message-----
From: seaside-bounces at lists.squeakfoundation.org
[mailto:seaside-bounces at lists.squeakfoundation.org]On Behalf Of Valdas
Sent: Wednesday, September 14, 2005 9:50 AM
To: The Squeak Enterprise Aubergines Server - general discussion.
Subject: RE: [Seaside] Squeak/.Net question

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,

Seaside mailing list
Seaside at lists.squeakfoundation.org

More information about the Seaside mailing list