Notifications
Clear all

[Closed] File Dialogs

Hello, Im creating simple dialog for my 3DXI exporter, so i want specify some specific folders and Im trying to show DoMaxBrowseForFolder

INT_PTR CALLBACK ExportOptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) 
{ 
 switch(message) { 
 case WM_COMMAND:
 switch (LOWORD(wParam)) 
 { 
 case IDC_BTN_MESH:
 pathControl = IDC_PATH_MESH;
 initPath = params.m_meshPath;
 
 Interface13* imax = GetCOREInterface13();
 imax->DoMaxBrowseForFolder(hWnd, _M(""), initPath);
 //..

The dialog is showing, but buttons or other controls don`t work, I’ve tried pass NULL or MaxhWnd as hWnd to DoMaxBrowseForFolder.
I’ve checked in the debugger that the threads locks in NtPeekMessage, may be i have specify something?
Here i’m creating dialog:

if (!suppressPrompts && !DialogBoxParam(hInstance, MAKEINTRESOURCE(IDD_PANEL), pInterface->GetMAXHWnd(), ExportOptionsDlgProc, (LPARAM)(LPVOID)this))
 return 1;

Is it OK that parent for FolderDialog also dialog?
MaxSDK 13.

1 Reply

I’ve tried a lot of things, but, unfortunately without success.
The exception still occur.
Here a code of FileDialog creation:


MSTR title = _M("Save as File"), _fname = _M(""), _path = _M(""); 
Interface13* imax = GetCOREInterface13(); 
FilterList filterList;
imax->DoMaxSaveAsDialog(imax->GetMAXHWnd(), title, _fname, _path, filterList));

In the samples the code is same, i don’t know why my isn’t work.
Here is exception:

Unhandled exception at 0x0000000140496249 in 3dsmax.exe: 0xC000041D: An unhandled exception was encountered during a user callback.

Here is a callstack

 	3dsmax.exe!0000000140496249() 	
 	[Frames below may be incorrect and/or missing, no symbols loaded for 3dsmax.exe]	
 	3dsmax.exe!000000014049d24c() 	
 	3dsmax.exe!00000001400fd819() 	
>	MyExport_x64.dle!ExportOptionsDlgProc(HWND__ * hWnd, unsigned int message, unsigned __int64 wParam, __int64 lParam)  Line 139 + 0x95 bytes	C++
 	user32.dll!UserCallDlgProcCheckWow()  + 0x11b bytes	
 	user32.dll!DefDlgProcWorker()  + 0xba bytes	
 	user32.dll!DefDlgProcW()  + 0x36 bytes	
 	user32.dll!UserCallWinProcCheckWow()  + 0x11d bytes	
 	user32.dll!CallWindowProcAorW()  + 0x78 bytes	
 	user32.dll!CallWindowProcW()  + 0x18 bytes	
 	uicontrols.dll!000000002e804633() 	
 	user32.dll!UserCallWinProcCheckWow()  + 0x11d bytes	
 	user32.dll!DispatchClientMessage()  + 0x5f bytes	
 	user32.dll!__fnDWORD()  + 0x2d bytes	
 	ntdll.dll!KiUserCallbackDispatcherContinue() 	
 	user32.dll!ZwUserMessageCall()  + 0xa bytes	
 	user32.dll!SendMessageWorker()  - 0x3118 bytes	
 	user32.dll!SendMessageW()  + 0x5d bytes	
 	comctl32.dll!Button_ReleaseCapture()  + 0x157 bytes	
 	comctl32.dll!Button_WndProc()  + 0xcde bytes	
 	user32.dll!UserCallWinProcCheckWow()  + 0x11d bytes	
 	user32.dll!CallWindowProcAorW()  + 0x78 bytes	
 	user32.dll!CallWindowProcW()  + 0x18 bytes	
 	uicontrols.dll!000000002e80432b() 	
 	user32.dll!UserCallWinProcCheckWow()  + 0x11d bytes	
 	user32.dll!DispatchMessageWorker()  + 0x12a bytes	
 	user32.dll!IsDialogMessageW()  + 0x102 bytes	
 	user32.dll!DialogBox2()  + 0x174 bytes	
 	user32.dll!InternalDialogBox()  + 0x111 bytes	
 	user32.dll!DialogBoxIndirectParamAorW()  + 0x56 bytes	
 	user32.dll!DialogBoxParamW()  + 0x66 bytes	
 	MyExport_x64.dle!IsolationAwareDialogBoxParamW(HINSTANCE__ * hInstance, const wchar_t * lpTemplateName, HWND__ * hWndParent, __int64 (HWND__ *, unsigned int, unsigned __int64, __int64)* lpDialogFunc, __int64 dwInitParam)  Line 640 + 0x33 bytes	C++
 	MyExport_x64.dle!EngineExport::DoExport(const wchar_t * name, ExpInterface * pExpInterface, Interface * pInterface, int suppressPrompts, unsigned long options)  Line 190 + 0x4b bytes	C++

Help please. Is there any examples except standart from SDK?