ASP Public Class and COM

Results 1 to 3 of 3

Thread: ASP Public Class and COM

  1. #1
    Mark A Guest

    Default ASP Public Class and COM

    I have been trying (unsuccesfully) to pass a class from ASP to an ActiveX DLL.<BR><BR>eg (sort of).<BR><BR>&#060;%<BR>dim obj as Server.CreateObject("Test.MyClass")<BR>dim mc<BR>dim ret<BR><BR>class myClass<BR> public nme<BR> public age<BR>end class<BR><BR>set mc = myClass<BR>mc.nme = "Boris"<BR>mc.age = 102<BR><BR>ret = obj.show_age(mc)<BR>%&#062;<BR><BR>Inside the DLL, I have created a public data type that mirrors the public class myClass.<BR><BR>eg.<BR><BR>Public Type PublicClass<BR>nms as string<BR>age as integer<BR>End Type<BR><BR>Public Function show_age(mc as PublicClass) as boolean<BR>...<BR>End Function<BR><BR>I have absolutely no problems with the DLL building and other methods within the class are functioning as expected, until I call this class!!!!<BR><BR>Is there a trick to this, or is it a limitation?

  2. #2
    Join Date
    Dec 1969

    Default RE: ASP Public Class and COM

    VB has a problem passing user defined types between objects. The way around this is to pass mc into the show_age function as a variant and then create a local version of the type and set it equal to mc and then operate on it.

  3. #3
    Mark A Guest

    Default RE: ASP Public Class and COM

    Aaaah, light dawns on marble head.<BR><BR>Thankyou

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts