I was setting up a VB wrapper to call the AIMLbot.dll.
all went well untill I tried to set up the log.
I set up a test just like your GUI Example. So all can see
Public Class Form1
Dim myBot As New Bot
Dim MyUser As User
Dim lastrequest As Request = Nothing
Dim lastresult As Result = Nothing
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
MyUser = New User("Phil", myBot)
‘This is the line I am having problems with
‘I don’t have a WrittenToLog as part of the myBot Bot Class.
myBot.WrittenToLog += new Bot.LogMessageDelegate(myBot_WrittenToLog);
Other then not being able to get the log data, The Bot works great
Thanks for the feedback.
I'm assuming that you have a method called myBot_WrittenToLog in your form's class? Something like:
Private Sub myBot_WrittenToLog()
' Where you handle whatever is in myBot.LastLogMessage
You'll need it as this is what the delegate is expected to point to. See line 32 onwards in aimlForm.cs in the AIMLGui project to see how I've done it in C#.
Actually, you might be interested to know that I'm currently working on a new release that contains many improvements, including access to logging events, better event driven support and several bits of re-factoring to improve performance and readability of the code. Expect an announcement sometime this month...
Hope this helps and let me know how you get on,
Ya. I have a myBot_WrittenToLog ready to use.
I changed "Dim myBot As New Bot" to "Dim withevents myBot As New Bot"
But I still don't have a event of WrittenToLog.
The New Code Sounds Cool, Can't wait :)
Well. I think I am ready to Cry. I have been working on this and reading but I can't not find out why I am missing the WrittenToLog Event. It does not show up as a Event in VB. Is there anyone that know C and VB out there that can Help?
It must be some kind of compatibility issue, but I don’t know C well enough to C it. lol
Have just got back from my holidays and noticed your post. Perhaps you need to Google AddHandler? :-)
should be a good start...
Hope that helps,
I also forgot to mention that I just tried it out and it works for me.
That was it. Now I really feel like a PITA lol.