diff --git a/PROMS/Volian.Base.Library/vlnStackTrace.cs b/PROMS/Volian.Base.Library/vlnStackTrace.cs index 7da23a44..d945daf9 100644 --- a/PROMS/Volian.Base.Library/vlnStackTrace.cs +++ b/PROMS/Volian.Base.Library/vlnStackTrace.cs @@ -2,6 +2,7 @@ using System; using System.Collections.Generic; using System.Text; using System.Diagnostics; +using System.Runtime.InteropServices; namespace Volian.Base.Library { @@ -223,4 +224,34 @@ namespace Volian.Base.Library #endif } } + public static class HWndCounter + { + [DllImport("kernel32.dll")] + private static extern IntPtr GetCurrentProcess(); + + [DllImport("user32.dll")] + private static extern uint GetGuiResources(IntPtr hProcess, uint uiFlags); + + private enum ResourceType + { + Gdi = 0, + User = 1 + } + public static void GetWindowHandlesForCurrentProcess(IntPtr hWnd) + { + GetWindowHandlesForCurrentProcess(hWnd, ""); + } + private static uint lastUserObject = 0; + public static void GetWindowHandlesForCurrentProcess(IntPtr hWnd, string str, params object[] objects) + { + IntPtr processHandle = GetCurrentProcess(); + uint gdiObjects = GetGuiResources(processHandle, (uint)ResourceType.Gdi); + uint userObjects = GetGuiResources(processHandle, (uint)ResourceType.User); + if (lastUserObject != userObjects) + Console.WriteLine("winhandle count = {0} GDIObjs {1} UserObjs {2} dif {3} {4}", gdiObjects + userObjects, gdiObjects, userObjects,(int)userObjects - (int)lastUserObject, string.Format(str, objects)); + lastUserObject = userObjects; + //return Convert.ToInt32(gdiObjects + userObjects); + } + } + } diff --git a/PROMS/Volian.Controls.Library/DSOTabPanel.cs b/PROMS/Volian.Controls.Library/DSOTabPanel.cs index 94968751..654ff1b3 100644 --- a/PROMS/Volian.Controls.Library/DSOTabPanel.cs +++ b/PROMS/Volian.Controls.Library/DSOTabPanel.cs @@ -161,9 +161,11 @@ namespace Volian.Controls.Library try { this._MyDSOFramer.Open(MyDSOFile.MyFile.FullName); + //this._MyDSOFramer.Open(MyDSOFile.MyFile.FullName,false,"Word.Document","",""); } catch (Exception ex) { + _MyLog.Warn("dso fraimer error", ex); // put exception message in the error log System.IO.FileStream fs = MyDSOFile.MyFile.Create(); using (DocumentAuditInfoList dail = DocumentAuditInfoList.Get(MyDocumentInfo.DocID)) { diff --git a/PROMS/Volian.Controls.Library/FindReplace.cs b/PROMS/Volian.Controls.Library/FindReplace.cs index 89eb46a8..5e1de848 100644 --- a/PROMS/Volian.Controls.Library/FindReplace.cs +++ b/PROMS/Volian.Controls.Library/FindReplace.cs @@ -218,7 +218,7 @@ namespace Volian.Controls.Library { next = (cbxReverse.Checked) ? next.SearchPrev : next.SearchNext; } - if (next != null) Console.WriteLine("next {0} {1}", next.ItemID, next.MyContent.Text); + //if (next != null) Console.WriteLine("next {0} {1}", next.ItemID, next.MyContent.Text); if ((next == null) || next.IsSection) { if (!findingbookmarks)