Unresolved external SHCreateItemFromParsingName referenced VCL.LIB / Dialogs - vcl

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?

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.

Related

Xul.dll missing dependencies after upgrade from Xulrunner and Gecko 14 to 33 due to Xpcom.dll conflict

I'm using Xulrunner and GeckoFX in a vb application (version 33.0-0.1 for both), and when debugging the application, the line
Gecko.Xpcom.Initialize(System.IO.Directory.GetCurrentDirectory() & "\xulrunner")
throws the exception:
Unable to load DLL 'xul': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
Note that regardless of how I call the Initialize() function, the exact same exception comes up. I've tried:
Gecko.Xpcom.Initialize()
Gecko.Xpcom.Initialize(System.IO.Directory.GetCurrentDirectory() & "\xulrunner")
Gecko.Xpcom.Initialize(System.IO.Directory.GetCurrentDirectory() & "\bin\xulrunner")
Gecko.Xpcom.Initialize("C:\full path here\xulrunner")
This question Unable to load DLL (Module could not be found HRESULT: 0x8007007E) led me to use Dependency walker to check the dll.
Checking the dll showed that I was "missing" a slew of other things, as shown below:
That in turn led me to Win 7, 64 bit, dll problems, which also didn't help. While DW does show some of the same missing DLLs, it's also showing other ones that aren't listed in that question.
Of the offered solutions in that question, I've tried:
reinstalling the VS Redistributable Package
running 'sfc /scannow'
I've noticed in the aforementioned question that some people are saying it's an issue with OCX files instead of the DLL, but I'm not sure how to even start on that end. I couldn't find any OCX files in the project directory.
I realize that the problem may also lie in how I implemented GeckoFX and Xulrunner. Previously, this application was working using SkyboundGecko, GeckoFX, and Xulrunner. It seems that the previous developer working on this application followed this tutorial (or something very similar) using version 14 of GeckoFX and Xulrunner. However, this recently started causing problems for some customers using the application, as there was an Xpcom.dll conflict with a different application they were using. This issue only applies to those customers which had application X (I don't remember the name) installed on their computer. Other computers did not have this issue.
A bit of research has led me to believe that more current versions of GeckoFX and Xulrunner no longer require XPCom.dll, which means that an upgrade should in theory resolve this issue.
Thus, I started (loosely) following this tutorial in order to upgrade Gecko and Xulrunner. I removed the previous reference to the Skybound.Gecko.dll, and replaced Xulrunner with a newer version. I also downloaded and extracted the GeckoFX DLLs and files. My Bin now looks like this:
I added the reference to Gecko back to the project, and changed any references of Skybound.Gecko.xxxx to Gecko.xxxx. (Perhaps this tells you something that I don't know/haven't realized, since the tutorials I've seen never use Gecko.xxx - the function calls, for example, are Xpcom.Initialize() instead of Gecko.Xpcom.Initialize())
I'm running Windows 8 on Windows Server 2012 R2 Standard, 64 bit OS.
Is there another way to avoid the Xpcom.dll conflict, and if not, how do I resolve this issue?
If any other information is required, comment and I'll try my best to provide it.
In my case this error is caused because of I initialised xulrunner in Form1_Load function. I resolved it by initialising xulrunner in public Form1() function.
Try to initialise xulrunner as shown below,
public Form1()
{
InitializeComponent();
Gecko.Xpcom.Initialize(#"C:\Users\PAVILION\Documents\visual studio 2010\Projects\SiteFilterAutomation\SiteFilterAutomation\bin\Debug\xulrunner\");
}
private void Form1_Load(object sender, EventArgs e)
{
geckoWebBrowser1.Navigate("www.google.com");
}

Warnings on XCAbstractTest.h, XCTestCase.h, and XCTestSuite.h

I recently turned on stricter warnings for a project, and Xcode started throwing warnings on some of Apple's classes. I'm not sure if this is an Apple bug, or if I'm doing something wrong. I'm using Xcode 6.1.1 on Yosemite.
TL;DR: adding some strict warning flags to your project starts throwing warnings in various XC*Test*.h headers. The issue is intermittent, but the steps below have reproduced the issue on multiple computers.
Steps to reproduce:
Create a new Xcode project via File → New → Project.
Choose iOS → Application → Single View Application.
For Product Name, type MyApp. Choose Objective-C and Universal. Save the project.
Build the project with CommandB. Run the tests with CommandU. Observe that they both finish with no errors or warnings.
Click on the Project to go to the Project Settings.
Click on the blue MyApp Project (as opposed to MyApp or MyAppTests targets).
Click on the Build Settings tab.
Search for Other Warning Flags.
Enter the following string for the Other Warning Flags for the app:
-Weverything -Wno-objc-missing-property-synthesis -Wno-objc-property-synthesis -Wno-direct-ivar-access -Wno-assign-enum -Wno-float-equal -Wno-sign-compare -Wno-switch-enum -Wno-gnu -Wnewline-eof
Build the app again. You should see three or four warnings about treating #import as #import, which is expected given the warnings you just enabled.
Clean the project with CommandShiftK
Build again. You may see extra warnings. If not, then you need to…
Delete the DerivedData folder, at least for this project. It is located at /Library/Developer/Xcode/DerivedData/MyApp-*, where * is some random identifier string. You may also need to delete /Library/Developer/Xcode/DerivedData/ModuleCache.
Clean and build again. And again. It may take a few times. Eventually...
You will see code and documentation warnings on XCAbstractTest.h, XCTestCase.h, and XCTestSuite.h. Screenshot:
As you can see, these warnings would be quite valid on my own code, but this is Apple’s framework code. Is there any way to stop these weirdly intermittent warnings from appearing? Or is it an Apple bug that the file gets warnings at all? I’m leaning Apple bug, because plenty of other Apple headers use #import instead of #import, and none of them is throwing warnings.
Update: I filed a radar: http://www.openradar.me/20038246
Update 2: I was able to glean some more information that may be helpful:
The issue appears to be at least partly related to where Derived Data is stored. See this screen recording, courtesy of Sam Marshall for details: http://cl.samdmarshall.com/a4Hy
Note that, when I reproduce the same steps as in Sam's video on my computer, I am not able to get rid of the extra warnings. They always come back. Possible differences between my and Sam's setups:
Sam is on Xcode 6.1, while I am on 6.1.1.
Sam is on Mavericks, while I am on Yosemite (10.10.2).
When I build in Xcode 6.3b2, I get an additional warning about "building module 'UIKit'". See screenshot: http://cl.ly/a3sK
Update 4: Radar was closed as a duplicate of an issue.
Update 5: I have a workaround, which is to disable the problem warnings on the Tests target only. Here’s a partial diff. Xcode won’t add the $(inherited) automatically, so you’ll have to add it yourself.
+ WARNING_CFLAGS = (
+ "$(inherited)",
+ "-Wno-documentation-unknown-command",
+ "-Wno-auto-import",
+ "-Wno-incomplete-module",
+ );

Flash Builder - Platform conversion failed error during release build

This is a very annoying problem while generating release build files. Here is the steps I did while building:
Select Project > Export Release Build
Select Signed Native Installer
Import certificate
Click Next.
I always got the following error:
https://forums.adobe.com/servlet/JiveServlet/showImage/2-6524012-651585/build_error.png
Platform conversion failed. Process exited with error 5. Output was
"[ErrorEvent type="error" bubbles=false cancelable=false eventPhase=2
text="Unhandled exception Error: EndUpdateResource: Windows Error #5"
errorID=0]
I have the following setup:
OS: Windows 8.1
System type: 64-bit
Flash Builder Version: 4.6 Premium
Installed FB: FlashBuilder_4_6_LS10.exe
Please help. This is giving me a lot of headaches for a couple of days now.
Additionally, here's the stack trace:
java.io.IOException: Platform conversion failed. Process exited with
error 5. Output was "[ErrorEvent type="error" bubbles=false
cancelable=false eventPhase=2 text="Unhandled exception Error:
EndUpdateResource: Windows Error #5" errorID=0] " at
com.adobe.air.nai.NativePackager.conversionFail(NativePackager.java:222)
at
com.adobe.air.nai.NativePackager.invokePlatformConversion(NativePackager.java:203)
at
com.adobe.air.nai.NativePackager.createPackage(NativePackager.java:92)
at
com.adobe.flexbuilder.multisdk.apollo.export.AIRNativeInstallerPackager.create(AIRNativeI
nstallerPackager.java:129) at
com.adobe.flexbuilder.exportimport.releaseversion.ExportReleaseVersionManager.doExport(Ex
portReleaseVersionManager.java:586) at
com.adobe.flexbuilder.exportimport.releaseversion.ui.ExportReleaseVersionWizard$1.run(Exp
ortReleaseVersionWizard.java:208)
I also suspect this is because of the following settings:
Eclipse.ini
https://forums.adobe.com/servlet/JiveServlet/showImage/2-6525217-651726/eclipse.png
...
-startup plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher_library plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.1.100.v20110502.jar
...
Notice that the plugin used is not intended for x64 processors.
#ActionScript3030 is correct, for anyone finding this later on, if you re-link your Library Paths (even if they look correct) this should rectify your issue.
The issue is caused by the links not being able to resolve to their GUID counterparts in your AppData/Local folder. This happens quite commonly when you create a new user profile and try to copy over your old user profiles information.
I already figured this out. I created a virtual machine with windows 7 32bit operating system and I'm happy now :)
If you initially created your project on a different system then try to compile it in another system, the class source and swc paths may not match. These paths could be there but not being implemented in code, so you will not get any run time errors while debugging, but it will give you the error 5 during compilation.
Solution:
Remove the idle paths not directly in use in your code. You can identify them by simply checking the path.
Found the same issue when trying to use Microsoft Essential Security on my Windows 7 x32. When i uinstall it - problem gone. So try to check your firewall settings if stucking the same problem.
Just to add an alternative solution (I'm on an x64 Windows and want to keep build exported for x64), in my case the error popped up when building the project with the AIR SDK defined in the app.xml (an older one, 3.9) and went away when I explicitly used a newer SDK (19).
(Disclaimer: I used the command line adt tool from the SDK to build, not Flash Builder).
A little late, but might possibly help someone.
I had the same error recently with FlashDevelop. Figured out that the my path was too long. When I renamed some long folder and file names, the error disappeared.
Try to disable UAC on Windows 8. Change it to "Never notify". The problem

JNI UnsatisfiedLinkError- how do I load libraries correctly?

I'm trying to work with the Java sample Database program from the CardScan SDK.
I am working with files located in Java/JNI and Java/Database. The program must be run with a 32 bit JRE. I was able to do so on a 64 bit machine by uninstalling Java and installing the 32 bit version, then re-adding the system path for Java. I can run the program and interface with a CardScan database file (.cdb) successfully by double clicking the SDKData.bat file, but when I open the source files for editing and edit the Java.library.path to include the required library (CRTK_JNI.dll), I get UnsatisfiedLinkErrors everywhere:
Exception in thread "main" java.lang.UnsatisfiedLinkError: sdkdata.CRTK.CRTK_Init([I)I
at sdkdata.CRTK.CRTK_Init(Native Method)
at sdkdata.CRTK.(CRTK.java:239)
at sdkdata.SDKData.(SDKData.java:97)
at sdkdata.SDKData.main(SDKData.java:643)
Java Result: 1
Presumably this is happening because the library is not loading properly.
What do I need to do to run and edit the program at full capacity (with all the native functions from CRTK_JNI in working order)?
Presumably this is happening because the library is not loading properly.
On the contrary. The library load is complete. You aren't getting that from a System.load()/loadLibrary() call, you are getting the error when calling your native method, the one that should have the signature:
package sdkdata;
public class CRTK
{
public native int CRTK_Init(int[]);
}
So it isn't there, or you have changed the signature without regenerating the .h and .c files, or you have manually mangled the declaration some other way.
Post your code.
To clarify, this Java sample program is officially unsupported by the CardScan API - it was a bad idea to try to use the API with an unsupported language relying solely on an experimental implementation. I ended up using one of the supported languages (Visual Basic) to work with the SDK; if anyone looking at this question happens to be struggling with using the CardScan API, here is my VB implementation on Github.

Another JNI UnsatisfiedLinkError DLL problem

I've read lots of posts about this, but none address my problem.
I have a very small DLL that allows a Java process to send windows messages. It simply calls
FindWindowEx(...)
SendMessage(...)
I have compiled that with VS2005 and linked with /MT and all's fine, but if I try to make my DLL depend on MSVCRT and link with /MD then I get the unsatisfied link error.
java.lang.UnsatisfiedLinkError: MyDll.dll: Can't find dependent libraries
According to depends.exe it has two missing DLLs, GPSVC.DLL and IESHIMS.DLL. The first exists in c:\windows\system32 and the second is in a winsxs path. There are LOADS of other DLLs loaded from c:\windows\system32 and GPSVC.DLL is an odd one in that even as admin on my win7x64 machine, I cannot run depends on that - it says it's not found...
Anyway, I tried forcing a load of both of those DLLs in my Java by (simplified - I'm not in control of java.library.path)
Field field = ClassLoader.class.getDeclaredField("usr_paths");
field.setAccessible(true);
String[] paths = (String[]) field.get(null);
String[] tmp = new String[paths.length + 2];
System.arraycopy(paths, 0, tmp, 0, paths.length);
tmp[paths.length] = "c:/windows/system32";
tmp[paths.length + 1] = "c:/Windows/winsxs/amd64_microsoft-windows-ie-ieshims_31bf3856ad364e35_8.0.7601.17514_none_c06d7c9c27da8591";
field.set(null, tmp);
but that made no difference. I can fallback to make it statically linked, but I'd rather not.
Any ideas on what I can try next?
Antony
Well, I´m using Visual Studio 2010 but it could work on 2005 too.
You could try configuring the VC compiler using vcvarsall.bat that you can find in ProgramFiles in /MicrosoftVisualStudio20xx/VC .
You have only to launch vsvarsall.bat in Command Line with one of these options: x86 or ia64 or x86_amd64 or x86_ia64. I don´t know if it will help but it could be one of the problems that VC compiler is not configured to work with 64 bit machine.
When I´m working with JNI I use command line to compile the code and I had to configure the compiler on 64 bit machine.
Or you could pobably try to compile it via Command Line. Here is my favourite tutorial http://www.ibm.com/developerworks/java/tutorials/j-jni/index.html