Forum Discussion
Hello,
I am accessing the control like this:
Set TestTool = Aliases.TestTool
Set MyControl = TestTool.myControl
Then I use a method like: MyLog.LogMessage("An error occured", pmHigher, "", MyControl)
In this method I call the standard log function:
sub LogMessage(message, priority, attributes, control)
Dim MyImage
MyImage = control.Picture
Log.Error(message, priority, attributes, MyImage)
End Sub
I also get the error if I get the control by calling:
Set MyControl = TestTool.WaitAliasChild("myControl")
- tristaanogre7 years agoEsteemed Contributor
Understanding that this used to work before... note that Log.Message has more parameters than you are using. So.... what you are passing in as priority is actually the parameter for "Additional Info", attribs is actuallyl priority, and where you have your control is actually the attribs.
What happens if you change your code to this:
sub LogMessage(message, priority, attributes, control) Dim MyImage MyImage = control.Picture Log.Error(message, "", priority, attributes, MyImage) End Sub
- Orvai7 years agoOccasional Contributor
Hi tristaanogre,
indeed my code already is like you suggested, I missed the 'additional Info' attribute in my example. I'm sorry.
Best regards
Christoph
- AlexKaras7 years agoChampion Level 3
Hi Christoph,
> MyLog.LogMessage("An error occured", pmHigher, "", MyControl)
> Log.Error(message, priority, attributes, MyImage)
Another note is that Attributes parameter for Log.Error is a structure and it is quite possible that the string that you pass as an actual argument cannot be converted to the required structure.
What if you change
MyLog.LogMessage("An error occured", pmHigher, "", MyControl)
to
MyLog.LogMessage("An error occured", pmHigher, Log.CreateNewAttributes(), MyControl)
?
Related Content
- 11 years ago
- 2 years ago
- 11 years ago
- 4 years ago
Recent Discussions
- 2 days ago
- 2 days ago
- 5 days ago