Hello,
I'm using your sample applications as a base for our own implementation right now.
Along the way I have found some useless lines:
Dim bCheckChanged As Boolean = bFromVDataOut ^ e.Item.Checked
If bCheckChanged Then
If e.Item.Checked Then
vDataIn = 1
Else
vDataIn = 0
End If
Try
AxCoPDFXCview1.SetProperty(sVerb, vDataIn)
Catch ex As Exception
ShowErrorMessage(System.Runtime.InteropServices.Marshal.GetHRForException(ex))
End Try
End If
Obvisiously the marked query doesn't make any sense. It's always true and furthermore the syntax is a bit circular.
I'm wondering now how this lines end up in this sample? Did you use some kind of converter which build this up?
Thanks and regards
Tobias Herold
EbbinghausTeam
Found strange code snippet in sample
Moderators: PDF-XChange Support, Daniel - PDF-XChange, Chris - PDF-XChange, Sean - PDF-XChange, Vasyl - PDF-XChange, Ivan - Tracker Software, Stefan - PDF-XChange
-
- Site Admin
- Posts: 19885
- Joined: Mon Jan 12, 2009 8:07 am
Re: Found strange code snippet in sample
Thanks Tobias,
I have asked one of the guys working on the code samples to check this and we will advise later on how the investigation on this is going.
Best,
Stefan
I have asked one of the guys working on the code samples to check this and we will advise later on how the investigation on this is going.
Best,
Stefan
-
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: Found strange code snippet in sample
Hello Tobias,
Actually this code filters unnecessary call to ActiveX SetProperty function. It will work only when old value of property is unequal to the new value from checkbox. However all indeed will work fine without this code.ebbiTeam wrote: Dim bCheckChanged As Boolean = bFromVDataOut ^ e.Item.Checked
If bCheckChanged Then
-
- User
- Posts: 17
- Joined: Fri May 27, 2011 7:20 am
Re: Found strange code snippet in sample
Yes, I see.
Though in every case bCheckChanged will have
a "true" value. It doesn't matter if one of both
variables on the right side have a "false" value.
Is this a .net behaviour?
Though in every case bCheckChanged will have
a "true" value. It doesn't matter if one of both
variables on the right side have a "false" value.
Is this a .net behaviour?
Corwin - Tracker Sup wrote:Hello Tobias,Actually this code filters unnecessary call to ActiveX SetProperty function. It will work only when old value of property is unequal to the new value from checkbox. However all indeed will work fine without this code.ebbiTeam wrote: Dim bCheckChanged As Boolean = bFromVDataOut ^ e.Item.Checked
If bCheckChanged Then
-
- User
- Posts: 664
- Joined: Tue Nov 14, 2006 12:23 pm
Re: Found strange code snippet in sample
You are right. That was bad code conversion form C#. In VB.Net environment should be used "xor" operator:ebbiTeam wrote:Yes, I see.
Though in every case bCheckChanged will have
a "true" value. It doesn't matter if one of both
variables on the right side have a "false" value.
Is this a .net behaviour?
Code: Select all
Dim bCheckChanged As Boolean = bFromVDataOut Xor e.Item.Checked