SMTPSecureSocket Xojo 2015 R3

My WebApp compiling fine in 2015 R2.2 is now giving syntax error 2015 R3 :
LoginPage.MailSocket1.Name Layout(property name) Syntax error.
Mailsocket1 => Super : SMTPSecureSocket

Dont drop an instance on a layout
That’s the cause

You can add a property and handle the events using addhandler

but Norman, the Xojo example apps for email all implement an instance of the socket as a “control” on the layout.

All my web apps have always implemented in this way, and compiled fine, up until 2015r3.

Is this a rule that only applies to web apps, or are the Xojo - supplied examples wrong? Is this rule documented?

Cheers,
Tony

There was the same problem with HTTPSecureSocket (fixed for a future release now).

I’d suggest:

  1. Create a subclass of SMTPSecureSocket
  2. Add a property of your new type (“mySMTPSecureSocket”)
  3. In the Open event handler, assign a method to it using AddHandler

To give an idea, here an example for HTTPSecureSocket:

Me.Socket1 = New imHTTPSecureSocket(Self) AddHandler Me.Socket1.PageReceived, AddressOf Me.Socket1.PageReceived_S1

In this example, my subclass “imHTTPSecureSocket” contains a method PageReceived_S1:

[code]Sub PageReceived_S1(Sender As HTTPSecureSocket, url as string, httpStatus as integer, headers as internetHeaders, content as string)
#pragma Unused url
#pragma Unused httpStatus
#pragma Unused headers

If content <> “” Then

// Do stuff here, for instance:
wPage.ContainerSaferpay1.HTMLViewer1.URL=content

End If

End Sub
[/code]

Thank you Oliver for all the info.

Yes, I have now implemented the SMTPSecureSocket as a property (instead of a layout control) and it works fine, and no compiler errors.

I am still baffled as to why this is not shown in Xojo’s example apps - maybe the implementation of SecureSockets could be discussed in more detail in Xojo’s framework documentation (gentle hint to Xojo’s developers!)

Tony

[quote=225812:@Tony Davies]<…>
I am still baffled as to why this is not shown in Xojo’s example apps <…>[/quote]
It did work in the past and it will work again with future version, I guess. Errors like this one can sneak in and can be overlooked by everybody, including beta testers.

What you could do is to open a feedback case, just to make sure it won’t get forgotten.