Results 1 to 3 of 3

Thread: Passing Custom Com objects

  1. #1

    Thread Starter
    New Member
    Join Date
    May 2002
    Posts
    7

    Passing Custom Com objects

    Hope someone can help me!

    I am resonabley new to COM / COM + and I am having problems passing com objects around.

    I have created an ActiveX .dll call AXCLogger. This dll has two classes PhoneCall and PhoneCallAdmin.

    Class PhoneCall has some private variables and the relevant property gets and lets and holds just string and intger info. Class: PhoneCallAdmin has a method called LogCall which will save the infomation within a sql database. I have no problems with the SQL/ado coding but I am cannot pass the PhoneCall object into the PhoneCallAdmin class.


    I am using the following Sub declaration within my PhoneCallAdmin class.

    Public Sub LogCall( myPhoneCall as AXCLogger.PhoneCall )

    End Sub


    I am testing the dll in a standard project as follows

    Dim aPhoneCall as AXCLogger.PhoneCall
    Dim aPhoneCallAdmin as AXCLogger.PhoneCallAdmin

    Set aPhoneCall = New AXClogger.PhoneCall
    Set aPhoneCallAdmin = New AXCLogger.PhoneCallAdmin

    'put some random info in the object
    aPhonCall.ContactName = "Mr Bob Fish"
    aPhoneCall.CallDay = "WednesDay"
    'etc.

    PhoneCallAdmin.LogCall(aPhoneCall)

    At this Point I get the error Object doesn't support the property or method. If I change the LogCall procedure to accept another type of varaible it works fine.

    Hope someone can shed some light on this please

  2. #2
    Frenzied Member DeadEyes's Avatar
    Join Date
    Jul 2002
    Posts
    1,196
    VB Code:
    1. Call PhoneCallAdmin.LogCall(aPhoneCall)
    2. 'or
    3. PhoneCallAdmin.LogCall aPhoneCall
    4.  
    5. 'not sure if your need this
    6. Public Sub LogCall( myPhoneCall as AXCLogger.PhoneCall )
    7. try
    8. Public Sub LogCall( myPhoneCall as PhoneCall )

  3. #3

    Thread Starter
    New Member
    Join Date
    May 2002
    Posts
    7
    Thanks Dead Eyes. It seems obvoius now I now the answer.

Posting Permissions

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



Click Here to Expand Forum to Full Width