# \[4.6\] Compilation error when adding MainFrame module ?

**URL:** <https://forums.unrealengine.com/t/4-6-compilation-error-when-adding-mainframe-module/299096>\
**Category:** Community & Industry Discussion\
**Tags:** modules, loading, unreal-engine, question\
**Created:** [November 16, 2014, 1:59pm UTC](https://forums.unrealengine.com/t/4-6-compilation-error-when-adding-mainframe-module/299096 "2014-11-16T13:59:58Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [November 16, 2014, 1:59pm UTC](https://forums.unrealengine.com/t/4-6-compilation-error-when-adding-mainframe-module/299096/1 "2014-11-16T13:59:58Z")

</div>

Hi,

I need a ParentWindowWindowHandle for a call to OpenFileDialog.

Apparently i need the IMainFrameModule to get it, but when i add this module to my build:

```
PrivateDependencyModuleNames.AddRange(new string[] { "MainFrame" });

```

I get the following error at compilation:

```
1>C:/Program Files/Unreal Engine/4.6/Engine/Source/Editor/UnrealEd/Classes/Editor/EditorUserSettings.h(83): error : In EditorUserSettings: Invalid reference to unparsed class: '/Script/Kismet.BlueprintPaletteFavorites'

```

Am i doing anything wrong ?

Thanks

Cedric

---

<div class="post-metadata">

**Author:** ![Jamie\_Dale](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamie_dale/32/1165413_2.png) [@Jamie\_Dale](https://forums.unrealengine.com/u/Jamie_Dale)\
**Post date:** [November 16, 2014, 2:10pm UTC](https://forums.unrealengine.com/t/4-6-compilation-error-when-adding-mainframe-module/299096/2 "2014-11-16T14:10:23Z")

</div>

You don’t strictly speaking need the parent window to be MainFrame, we just use that when we’re unsure which window to use (if you don’t provide a parent window, Windows does weird things to the window focus when the dialog is closed). If this is a window you’ve made yourself, then you could, and should, use that window as the parent instead of MainFrame.

Also remember that MainFrame is editor-only, so won’t build in game configurations. Which configuration are you trying to build?

---

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [November 16, 2014, 2:33pm UTC](https://forums.unrealengine.com/t/4-6-compilation-error-when-adding-mainframe-module/299096/3 "2014-11-16T14:33:15Z")

</div>

Hi Jamie,

Thanks for your answer.

To be honest, i am playing apprentice sorcerer here.

I never had the need to dig this module thing, so i tried the quick and dirty way, as i just need an openfiledialog from within the game (i need to load a file from disk at runtime).

The parent window should be the game window, as i create no window during the game, if there is an easy way to get it, i would be quite happy to read it here, but of course, otherwise i will do my homework and go for the long and clever way of understanding what i do.

Thanks

Cedric

---

<div class="post-metadata">

**Author:** ![Jamie\_Dale](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamie_dale/32/1165413_2.png) [@Jamie\_Dale](https://forums.unrealengine.com/u/Jamie_Dale)\
**Post date:** [November 16, 2014, 2:45pm UTC](https://forums.unrealengine.com/t/4-6-compilation-error-when-adding-mainframe-module/299096/4 "2014-11-16T14:45:02Z")

</div>

This should get you your game window:

```
UGameEngine* GameEngine = Cast<UGameEngine>(GEngine);
GameEngine->GameViewportWindow;

```

We typically don’t use DesktopPlatform functionality in games, as that functionality is only available for desktop platforms (Windows, Mac, Linux), additionally, opening a OS file picker dialog _may_ do undesirable things to full-screen windows, so I’d advise you test that.

If we needed to pick a file in a game, we’d typically implement a custom Slate widget to handle it without having to spawn any additional windows, or rely on OS behaviour.

---

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [November 16, 2014, 2:54pm UTC](https://forums.unrealengine.com/t/4-6-compilation-error-when-adding-mainframe-module/299096/5 "2014-11-16T14:54:59Z")

</div>

Thank you very much.

Desktop only is not a problem for me (aiming only windows/mac).

Oh, i didn’t think making a dedicated widget was possible for that, so i started to look for some window to do the job, but a widget would be a much better solution, as it would give a more natural integration in my UI. I’ll search in this direction now that i know it’s feasible.

Again, thanks a lot for your time, advices, and answer !

Cedric

---

<div class="post-metadata">

**Author:** ![Jamie\_Dale](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/jamie_dale/32/1165413_2.png) [@Jamie\_Dale](https://forums.unrealengine.com/u/Jamie_Dale)\
**Post date:** [November 18, 2014, 10:55am UTC](https://forums.unrealengine.com/t/4-6-compilation-error-when-adding-mainframe-module/299096/6 "2014-11-18T10:55:28Z")

</div>

Another reason to avoid DesktopPlatform for your game, as I realised when answering another question on this topic, is that DesktopPlatform is a Development module, and it’s against the EULA to distribute use them with shipped games.

Other question for reference: [Loading DesktopPlatform module - Programming & Scripting - Epic Developer Community Forums](https://answers.unrealengine.com/questions/134107/loading-desktopplatform-module.html)

---

<div class="post-metadata">

**Author:** ![uced](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@uced](https://forums.unrealengine.com/u/uced)\
**Post date:** [November 18, 2014, 11:00am UTC](https://forums.unrealengine.com/t/4-6-compilation-error-when-adding-mainframe-module/299096/7 "2014-11-18T11:00:23Z")

</div>

woo, thanks, i wasn’t aware of that. Anyway, i am currently working on my super widget, but it’s good to have this in mind for other dev modules.

Thanks again Jamie
