Subj : Common Dialog Memory Leak? To : borland.public.cpp.borlandcpp From : akuma Date : Tue Jun 07 2005 08:24 pm I'm using Windows XP and writing a file to open text file with the GetOpenFileName API funciton. Everytime when call to the common dialog function, it spends about 2 seconds to show it and the memory required by my program increases serval KB each time. The following is the code: OPENFILENAME fn; ZeroMemory(&fn, sizeof(fn)); fn.lStructSize = sizeof(fn); fn.lpstrFilter = "Text files\0*.txt\0\0"; fn.lpstrInitialDir = "C:\\Windows\0"; fn.nMaxFile = 256; fn.hwndOwner = GetFocus(); fn.lpstrTitle = "Open file\0"; fn.nMaxFileTitle = 256; fn.nFilterIndex = 1; fn.FlagsEx = OFN_EX_NOPLACESBAR; fn.Flags = Dlg->Flags | OFN_ENABLEHOOK | OFN_EXPLORER; GetOpenFileName((OPENFILENAME*)&fn); Please help me to optimize the code, so that it can display the dialog more efficiently with the explorer style. .