Le 16 janv. 07 à 18:37 Soir, [EMAIL PROTECTED] a écrit:
On Jan 16, 2007, at 17:29 UTC, Arnaud Nicolet wrote:
I put a breakpoint at the w.ShowModal line. Then, w is shown as
modal. When w is closed, I get an OutOfBounds Exception "at" the
w.ShowModal line.
What can cause a ShowModal method to generate such an exception after
it has been executed?
That's a weird one. I suggest the standard procedure of
checking/deleting code in your Close events, and then deleting
controls
one by one. (I presume you don't see this with just a plain empty
window, so it must be something IN that window that triggers it... so
you just have to narrow it down.)
Ok, here's what I have:
my dialog has 2 editfields, 2 push buttons and a SMTP socket (for the
interesting part). One push button is "Send" and the other is
"Cancel". When I hit "Send", the SMTP socket sends an e-mail. If the
e-mail has been sent, the "Cancel" button becomes "Close" and the
"Send" becomes "Save".
The OutOfBounds exception comes when I hit the "Send" button (but
there's no self.close or self.hide in that button, nor in the socket).
So, I have commented out all the non-required codes. Now, if I
comment anything more, nothing will work anymore. So either I keep it
like it is now, either I remove all the code. Here's what I have:
sub MySMTP.SendComplete
LblProgress.Text="Terminated"
LblProgress.TextColor=RGB(0,127,0)
PBCancel.Cancel=True
PBCancel.Caption="Close"
PBSend.Enabled=True
PBSend.Caption="Save..."
end sub
sub PBSend.action
dim e As EmailMessage
dim p As SMTPSecureSocket
if me.Caption<>"Save..." then
LblProgress.TextColor=RGB(0,0,0)
LblProgress.Visible=True
LblProgress.Text="Sending e-mail..."
SMTP1.Address=app.CurrentPreferences.EMailSendServer
SMTP1.Port=app.CurrentPreferences.EMailSendPort
e=new EmailMessage
e.BodyPlainText=EFMessage.Text
e.Headers.AppendHeader "Styled informations",EncodeBase64
(EFMessage.TextStyleData)
e.FromAddress=app.CurrentPreferences.EMailSendAddress
e.Subject=EFSubject.Text
e.AddRecipient Destination
SMTP1.Messages.Append e
SMTP1.Connect
EFMessage.Enabled=False
EFSubject.Enabled=False
PBCancel.Cancel=False
PBSend.Enabled=False
end if
end sub
As you can see, there's nothing about bounds.
Also, the window can be shown by clicking on a push button in either
a window or in another window. The problem only happens when the
click is made on one of these.
I'm puzzled._______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>