Passing Objects as Parameters

Results 1 to 3 of 3

Thread: Passing Objects as Parameters

  1. #1
    Walt Phillips Guest

    Default Passing Objects as Parameters

    I believe I asked this question before, yet I wanted to see if anyone could shed some light on the situation. <BR> VB DLL<BR>Public Function AddTitle(pub_title As String, MyErrors as adminerrs.Errors)<BR> ASP Call<BR>call select_criteria.AddTitle(cstr(title), MyErrors)<BR><BR>where MyErrors is an instatiated class of adminerrs.Errors and select_criteria is an instatiated class that includes the AddTitle function.<BR><BR>Well, what happens is I get a type mismatch run-time error. What I suppose is happening is that MyErrors becomes a Variant and a variant is passed in instead of an adminerrs.Errors object. Although I thought that VB was supposed to be able to figure it out, it doesn&#039;t, so ByRef doesn&#039;t work and the only ways that do work are taking the MyErrors out completely or changing the function to:<BR><BR>Public Function AddTitle(pub_title As String, MyErrors as Variant)<BR> &#039; check MyErrors to see if it is compatible with adminerrs.Errors<BR><BR>The kicker is that I would rather not go in and change EVERY function that needs an object parameter. So if there is another way to send the object w/o the error or changing the DLL I&#039;d really like to know..<BR><BR>Thanks...

  2. #2
    Bluebird Guest

    Default More importantly

    No object seems to work as a parameter. Other than that I know of nothing. Maybe someone else can help?

  3. #3
    Join Date
    Dec 1969

    Default RE: Passing Objects as Parameters

    Have you tried passing the reference by value?<BR><BR>Also, maybe don&#039;t use the property of the object, but instead receive the entire object in.

Posting Permissions

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