PDA

View Full Version : V6.5.6 Bugs bugs bugs....


binkle
12-Feb-2010, 09:55 AM
Hi,
it's really sad that the .NET version still that buggy.
We love the Delphi version, but the .NET version is not yet woth using as long as setting all options programmatically doesn't work.
If you get a my simple "ApplStandardSettings" method to run properly for both send modes I guess we will buy the .Net version too:
static class InstallProgram
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main(String[] args)
{
EurekaLogSystem.ExceptionHandler.Activate();
InstallProgram.ApplyStandardSettings("est@jam-software.de");

string text = null;
text.Clone();//invoke exception for testing

Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(fals e);
InstallForm eSTInstForm = new InstallForm();
eSTInstForm.DeInstallation = args.Length > 0;
Application.Run(eSTInstForm);
}

/// <summary>
/// Applies the standard settings of JAM-Software products to <see cref="T:EurekaLogSystem.ExceptionHandler"/>.
/// The default EmailSendMode is MailClient. For using SMTPClient as EmailSendMode call <see cref="T:Eurekalog.ApplyStandardSettings(pProductMailAddr ess,true)"/>
/// </summary>
/// <param name="pProductMailAddress">The product mail address.</param>
/// <author> binkle@jam-software.com </author>
public static void ApplyStandardSettings(string pProductMailAddress)
{
ApplyStandardSettings(pProductMailAddress, false);
}

/// <summary>
/// Applies the standard settings of JAM-Software products to <see cref="T:EurekaLogSystem.ExceptionHandler"/>.
/// </summary>
/// <param name="pProductMailAddress">The product mail address.</param>
/// <param name="pEMailSendModeSMTPClient">if set to <c>true</c> [EmailSendMode is SMTPClient] else [EmailSendMode is MailClient (Default)].</param>
/// <author> binkle@jam-software.com </author>
public static void ApplyStandardSettings(string pProductMailAddress, bool pEMailSendModeSMTPClient)
{
EurekaLogOptions options = EurekaLogSystem.ExceptionHandler.CurrentEurekaLogO ptions;
// Disable the following ELF contents: (Commented content stays enabled if enabled in Project options)
options.ShowOptions -= (
// Application
ShowOption.soExcAddress | ShowOption.soExcCount | ShowOption.soExcStatus | ShowOption.soExcNote
// User
| ShowOption.soUserID | ShowOption.soUserName | ShowOption.soUserEmail | ShowOption.soUserCompany
// Active Controls
| ShowOption.soCmpName | ShowOption.soCmpVideoCard
// Operating System
// Network
| ShowOption.soNetIP | ShowOption.soNetSubmask | ShowOption.soNetGateway | ShowOption.soNetDNS1 | ShowOption.soNetDNS2 | ShowOption.soNetDHCP
// Custom Data
| ShowOption.soCustomData);

// Disable Dialog Options
options.ExceptionDialogOptions -= (ExceptionDialogOptions.edoShowAttachScreenshotOpt ion | ExceptionDialogOptions.edoAttachScreenshotChecked | ExceptionDialogOptions.edoShowInDetailedMode);

Assembly entryAsm = Assembly.GetEntryAssembly();
AssemblyProductAttribute product = ReflectionUtils.GetAttribute<AssemblyProductAttribute>(entryAsm);

options.EMailSendMode = pEMailSendModeSMTPClient ? EmailSendMode.esmSMTPClient : EmailSendMode.esmEmailClient;
options.EMailSubject = String.Format(Properties.Resources.Eurekalog_Email SubjectStructure, product == null ? entryAsm.GetName().Name : product.Product, entryAsm.GetName().Version.ToString());
options.EMailAddresses = pProductMailAddress;
options.SMTPPort = 25;
options.SMTPHost = Constants.SMTPServer;
options.SupportURL = Constants.WebSite;

//set common send options
options.CommonSendOptions -= CommonSendOptions.sndAddComputerNameInFileName | CommonSendOptions.sndAddDateInFileName | CommonSendOptions.sndSendScreenshot | CommonSendOptions.sndSendXMLLogCopy;

if (pEMailSendModeSMTPClient)
{
options.CommonSendOptions |= CommonSendOptions.sndSendInSeparatedThread | CommonSendOptions.sndShowSuccessFailureMsg;
}
else
{
//options.CommonSendOptions -= CommonSendOptions.sndSendInSeparatedThread;
//options.CommonSendOptions -= CommonSendOptions.sndShowSuccessFailureMsg;
}

options.ExceptionDialogType = ExceptionDialogType.edtMSClassic;
options.ExceptionDialogOptions |= ExceptionDialogOptions.edoShowSendErrorReportOptio n | ExceptionDialogOptions.edoSendErrorReportChecked | ExceptionDialogOptions.edoShowCopyToClipOption | ExceptionDialogOptions.edoShowDetailsButton;

// Enable the following Log options:
options.LogOptions |= LogOptions.loDeleteLogAtVersionChange;
}
}

You may need to adjust the out-commented lines of EMailSubject and SMTPHost .

When running this code you will get two Eureklog bugs:
1. the one I reported before: http://news.eurekalog.com/showthread.php?t=2613
2. Call Stack Information:
------------------------------------------------------------------------------------------------------------------------------------------------------------------
|Address |Module |Unit |Class |Procedure/Method |Line |
------------------------------------------------------------------------------------------------------------------------------------------------------------------
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|System.NullReferenceException - Der Objektverweis wurde nicht auf eine Objektinstanz festgelegt. |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------|
|0000029D|EurekaLog|SendHandler.cs |EurekaLogSystem.Dialogs.Main.SendHandler |ProcessOutData() |250[21]|
|00000021|EurekaLog|SendHandler.cs |EurekaLogSystem.Dialogs.Main.SendHandler |SendMessage() |79[13] |
|0000000C|EurekaLog|DialogLauncher.cs |EurekaLogSystem.Dialogs.Main.DialogLauncher |EntireSends() |67[13] |
|00000032|EurekaLog|DialogLauncher.cs |EurekaLogSystem.Dialogs.Main.DialogLauncher |RunSend(ExceptionData exceptData) |59[18] |
|0000007D|EurekaLog|MsDialog.cs |EurekaLogSystem.Dialogs.Main.MsStyle.MSDialog|sen dErrorReport_Click(Object sender, EventArgs e) |195[13]|
|00000019|EurekaLog|System.Windows.Forms.dll|Syste m.Windows.Forms.Control |OnClick(EventArgs e) | |


Greeetings

Harry

binkle
12-Feb-2010, 11:04 AM
I'm sorry,
the error described above is still an error, but using using the right operator to remove the desired flags it works for me.
The "-=" operator has a strange behavoir on flags:
it removes the flag if it's included but it adds the flag if it's not included.
So this is the code running fine for me now:
public static void ApplyStandardSettings(string pProductMailAddress, bool pEMailSendModeSMTPClient)
{
EurekaLogOptions options = EurekaLogSystem.ExceptionHandler.CurrentEurekaLogO ptions;
// Disable the following ELF contents: (Commented content stays enabled if enabled in Project options)
options.ShowOptions &= ~( // "flags &= ~ falg" is equivalent to "flags = flags ^flag" for removing a flag
// Application
ShowOption.soExcAddress | ShowOption.soExcCount | ShowOption.soExcStatus | ShowOption.soExcNote
// User
| ShowOption.soUserID | ShowOption.soUserName | ShowOption.soUserEmail | ShowOption.soUserCompany
// Active Controls
| ShowOption.soCmpName | ShowOption.soCmpVideoCard
// Operating System
// Network
| ShowOption.soNetIP | ShowOption.soNetSubmask | ShowOption.soNetGateway | ShowOption.soNetDNS1 | ShowOption.soNetDNS2 | ShowOption.soNetDHCP
// Custom Data
| ShowOption.soCustomData);

// Disable Dialog Options
options.ExceptionDialogOptions &= ~(ExceptionDialogOptions.edoShowAttachScreenshotOp tion | ExceptionDialogOptions.edoAttachScreenshotChecked | ExceptionDialogOptions.edoShowInDetailedMode);

//Assembly entryAsm = Assembly.GetEntryAssembly();
//AssemblyProductAttribute product = ReflectionUtils.GetAttribute<AssemblyProductAttribute>(entryAsm);

options.EMailSendMode = pEMailSendModeSMTPClient ? EmailSendMode.esmSMTPClient : EmailSendMode.esmEmailClient;
//options.EMailSubject = String.Format(Properties.Resources.Eurekalog_Email SubjectStructure, product == null ? entryAsm.GetName().Name : product.Product, entryAsm.GetName().Version.ToString());
options.EMailAddresses = pProductMailAddress;
options.SMTPPort = 25;
options.SMTPHost = Constants.SMTPServer;
options.SupportURL = Constants.WebSite;

//set common send options
options.CommonSendOptions &= ~(CommonSendOptions.sndAddComputerNameInFileName | CommonSendOptions.sndAddDateInFileName | CommonSendOptions.sndSendScreenshot | CommonSendOptions.sndSendXMLLogCopy);

if (pEMailSendModeSMTPClient)
{
options.CommonSendOptions |= CommonSendOptions.sndSendInSeparatedThread | CommonSendOptions.sndShowSuccessFailureMsg;
}
else
{
options.CommonSendOptions &= ~(CommonSendOptions.sndSendInSeparatedThread | CommonSendOptions.sndShowSuccessFailureMsg);
}

options.ExceptionDialogType = ExceptionDialogType.edtMSClassic;
options.ExceptionDialogOptions |= ExceptionDialogOptions.edoShowSendErrorReportOptio n | ExceptionDialogOptions.edoSendErrorReportChecked | ExceptionDialogOptions.edoShowCopyToClipOption | ExceptionDialogOptions.edoShowDetailsButton;

// Enable the following Log options:
options.LogOptions |= LogOptions.loDeleteLogAtVersionChange;
}

Boro
12-Feb-2010, 12:53 PM
Hi,

I'm sorry, but I don't understand what the problem is.

Using -= operator never was a proper way to remove flags.
You are aware that it is a single integer value that we're talking about, and the flags are at bit level, right?
You cannot use -= or += to add/remove flags in none of the C family languages. You need to work with the bit operators.

binkle
12-Feb-2010, 01:12 PM
Please read my second post(reply to my own post).
I know the "-= " operator is not documented, but IT IS defined.
In opposite to "+=" and "*=" the operator "-=" is defined and "triggers" a flag.
So like in my reply post described:
it removes the flag if it's included but it adds the flag if it's not included.
So the options are still a valid integer when using "-=" they are still a valid set of enum values.

The method I wrote simply creates a set of options which result in an Eurekalog exception.
Debug it, have a look at the options and you wiill see the set of options causing the bug.
It just don't have the time to create the options causing the Eurekalog exception using a way "valid" for you.

Boro
12-Feb-2010, 01:36 PM
Harry,

Of course, using any of those operators on a integer you get another integer, but by using -= or *= or any of the rest of the integer operators for flags may result in an integer value that doesn't have a recognizable flag bound to it.
All of those operators are defined because you're using integers.
So, please, use the single standard way flags are used and you won't get any problems.
I'm not asking you to use a "valid way for me", I'm asking you to use flags like the rest of the world does. There is a reason why "operator -= is *not documented* for flags".
Since you're so busy, if you want, I can look up a few tutorials online about using flags and send it to you.

binkle
12-Feb-2010, 01:51 PM
Boro,
again:
In opposite to "+=" and "*=" the operator "-=" is defined and "triggers" a flag.All not defined operator cause compiler errors.
when using "-=" they are still a valid set of enum values.
With Visual Studio debugging you can see all flags of the options.

Do you like an remote desktop session?
I can show you all three bug posted.

Greetings

Harry

binkle
12-Feb-2010, 02:02 PM
Hi,
while creating a the test project for you I noticed this seems to be the same bug like: http://news.eurekalog.com/showthread.php?t=2614

Biljana
22-Jul-2011, 03:12 PM
Duplicate thread (http://news.eurekalog.com/showthread.php?t=2614), thread is closed.