P3D v4 Cannot export P3D4 MDL or BGL

#24
That depends on the SDK you are using and if the xtomdl version is 32 or 64 bit.

I tried to collect some info here:

https://www.scenerydesign.org/2018/01/which-visual-c-runtime-files-does-xtomdl-use/
I installed Microsoft Visual C++ 2013 Redistributable (x64) and now the first part of Tom Gobson's tutorial(chapter 2-4) works OK.

My setup is now:
ModelConverterX V 1.4.0.0 33818d9c DEV 2019-05-04
Windows 10 home at ASUS laptop
Microsoft Visual C++ 2005 Redistributable
Microsoft Visual C++ 2008 Redistributable - x64
Microsoft Visual C++ 2008 Redistributable - x86
Microsoft Visual C++ 2010 Redistributable - x86
Microsoft Visual C++ 2012 Redistributable (x64)
Microsoft Visual C++ 2013 Redistributable (x64)
Microsoft Visual C++ 2015 Redistributable (x64)
Microsoft Visual C++ 2017 Redistributable (x86)
DirectX version: DirectX 12
 
#26
I solved my problem. First, all my C++ redistributables were installed and up to date. Second, I opened SlimDX.dll with CFF Explorer and a number of the DirectX 9 dependencies were missing. I went to the MS DirectX download page, downloaded and installed DirectX 9 and now everything works. The files that were missing have file names like D3DX9_43.dll and are located in C:\windows\system32. How I lost DirectX 9 in my Windows 10 installation is a mystery, but the version number of DirectX 9 might also be a factor. DirectX 9 is not automatically installed with Windows 10, but I have enough older 3D apps installed that it should have still been available.
 

tgibson

Resource contributor
#27
Thanks for the info. I have those files (24 through 43) in my system32 folder. I tried installing DX9.0c and it doesn't install anything, it just says the installed components are ready to use.
 
#28
It's not slimDX.dll that's missing but other DLLs that it calls. You need to check slimDX.dll with a dependency walker to see what's missing. CFF Explorer can be found here:

https://ntcore.com/?page_id=388

Run CFF Explorer on the version of slimDX.dll that you want to use and then run the dependency walker. Missing references will show up with a red tag.
 

tgibson

Resource contributor
#29
Thanks Jay, that was helpful to pinpoint the problem, but I don't have a solution.

The problem appears to be that SlimDX.dll is hard coded to look for DLL files in the System32 folder, but on my Win 7 system that folder contains 64 bit DLL files and this DLL file wants 32 bit versions (even the ones in the _x64 SDK folders). The SysWOW64 folder contains the 32 bit DLL files. According to the web this is actually correct, and Windows is supposed to redirect the DLL to look in the SysWOW64 folder for it's DLL files, but that doesn't happen. Once I add the missing DLL files to the System32 folder, the error changes to "SlimDX.dll or one of its dependencies is not a valid Win32 application".

While I changed the missing DLL files to their 32 bit version to see if this would fix this problem, there are many other dependent DLL files there that are 64 bit and thus the error does not go away. Too bad...
 

tgibson

Resource contributor
#30
So I found every dependent DLL file in their 32 bit version (either downloaded or from the SysWOW64 folder) and put them into the same folder as the SlimDX.dll file I was using (in the 3DSM2012_x64 folder) and then CFF Explorer said that all DLL files were then 32 bit in the Dependency Walker. Didn't matter - I still get the "not a valid Win32 application". Oh well.
 
#31
I suppose that you could try copying the Directx libraries from their present location to the folder where SlimDX.dll is located. It should find those first. Every version of SlimDX.dll on my computer is 64 bit, so you need the 64 bit versions of the dependencies.
 
Last edited:

tgibson

Resource contributor
#32
Well Jay, thanks so much.

After doing just what you said above it worked! I downloaded all the DLLs that I didn't have in 64 bit versions. Then placed all dependent DLLs into the folder next to SlimDX.dll. The error message that it is not a valid Win32 application tricked me into thinking that I needed 32 bit DLLs. Silly me, this is Microsoft. :)

No error message and a valid MDL file. Yea!

Thanks again,
 
Last edited:
Top