Skip to content

Commit

Permalink
fix encoding initialization (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
JesperMonsted authored Nov 12, 2020
1 parent 795b0e7 commit a216985
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions Source/NDde/Advanced/DdeContext.cs
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,6 @@ public sealed class DdeContext : IDisposable, ISynchronizeInvoke
/// </remarks>
public DdeContext()
{
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
_Encoding = Encoding.GetEncoding(1252);
}

/// <summary>
Expand Down Expand Up @@ -234,6 +232,11 @@ public Encoding Encoding
{
lock (_LockObject)
{
if (_Encoding == null)
{
Encoding.RegisterProvider(CodePagesEncodingProvider.Instance);
_Encoding = Encoding.GetEncoding(1252);
}
return _Encoding;
}
}
Expand Down Expand Up @@ -769,7 +772,7 @@ protected override CreateParams CreateParams
{
get
{
const int WS_POPUP = unchecked((int) 0x80000000);
const int WS_POPUP = unchecked((int)0x80000000);
const int WS_EX_TOOLWINDOW = 0x80;

var cp = base.CreateParams;
Expand Down

0 comments on commit a216985

Please sign in to comment.