Results 1 to 3 of 3

Thread: Bug in VB6 or SP3??

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 1999
    Location
    Vancouver, BC, Canada
    Posts
    32
    This is bizarre to say the least...

    I have a single form, and a class module in a small project.
    In my class I have a method called 'Sendmail' that looks like this:

    Public Sub SendMail(strFrom As String, strSubject As String, strBodyText As String)

    <code deleted cuz it's not relevant to the problem>

    End Sub


    The code that calls this method is:

    objGWMail.SendMail("Davis", "test1", "test1")


    REALLY SIMPLE!! Or so it should be...Problem is, I get the following error every time:

    "COMPILE ERROR, Expected: = "

    So apparently VB thinks my method is a FUNCTION which it clearly is not. BUT when I make it into a function, it works fine!

    I've built plenty of classes and COM components, so this is not new to me, but am I missing something totally obvious here?? (Haven't had lunch yet so it's possible Or is this a known bug of some kind?

    As a last resort I'm about to strip out all the code and put it in a new module.

  2. #2
    Addicted Member
    Join Date
    Jan 2000
    Location
    Oshkosh, WI
    Posts
    163
    Try calling the method without the parentheses.

    objGWMail.SendMail "Davis", "test1", "test1"

    When its called with the parantheses VB assumes it's a function. I thing you could also call it this way:

    call objGWMail.SendMail("Davis", "test1", "test1")






    Glenn D
    Development/Analyst

  3. #3

    Thread Starter
    Member
    Join Date
    Jan 1999
    Location
    Vancouver, BC, Canada
    Posts
    32
    Aargh! Ya that's it, I missed the Call statement. Man that's so obvious (told ya it was probably something obvious That's what happens when you go without food too long!

    <blush>

    Thx.

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