Search code examples
vcl

Unresolved external SHCreateItemFromParsingName referenced VCL.LIB / Dialogs


I have a C++ Builder application I'm porting from C++ Builder 6 to XE on Windows XP.

A number of 3rd party controls are in use as well.

I'm compiling with Dynamic RTL = False

If I compile without run time packages I get the subject error message:

[ILINK32 Error] Error: Unresolved external 'SHCreateItemFromParsingName' referenced from C:\PROGRAM FILES\EMBARCADERO\RAD STUDIO\8.0\LIB\WIN32\RELEASE\VCL.LIB|Dialogs

If I compile with run time packages the error goes away.

Googling around reveals the SHCreateItemFromParsingName has to do with common control dialogs one can invoke with WinAPI calls.

All 3rd party controls I use work in a new/separate project; thus this problem does appear to be a simple #define or something.... (not sure)

I can not find anything in my project source that would cause this. I do have an TOpenDialog and a TSaveDialog in my project that replaced an older TMC components of the same names (TntOpenDialog, TntSaveDialog) that were used in CBuilder6 to give Unicode support for the same. Converted to the ones that ship with the VCL has not resolved this problem.

There is an Embarcadero thread on this but that person appear to solve by creating #define's to build their app for WinXP and new compatibility. Under XE, I set the C++ Compiler option to target Windows XP and newer and that did not work either.

Tried adding:

"#define WINVER 0x0502"

"#define _WIN32_WINNT 0x0502"

per MSDN link here: http://msdn.microsoft.com/en-us/library/aa383745%28v=vs.85%29.aspx

to no avail.

Other than the Open/SaveDialog components, anyone have any advise or seen this before?


Solution

  • OK, spent two days on this and as soon as I post it here, I found the solution.

    Under the Build Configuration (right click | edit )

    Under Application there is a check box "Enable runtime themes" that was unchecked.

    Checked it and problem now gone.