Resource TMDIChild not found - delphi-10.4-sydney

I am writing an MDI application. It works fine in Delphi 10.3 + Windows 10, but I get the error "Resource TMDIChild not found" in Delphi 10.4 + Windows 10. What is the problem, and how to solve it? Thanks.
if frmMDIChild = nil then
frmMDIChild := TMDIChild.Create(Application); { errors occur here!!! }
frmMDIChildForm.Show;

Related

Python 3.8.1 subprocess call/Popen methods not working

I recently updated my python package from 3.6.8 to 3.8.10 , from what I've read there is no much difference between the versions.
But I've encountered some problems in my code speficially with the subprocess.Popen() method not working as expected.
commands = ["sc start " + service_name_string]
command_executions =
subprocess.Popen('cmd.exe', shell=True,stdin=subprocess.PIPE,stdout=subprocess.PIPE, stderr=subprocess.PIPE)
for cmd in commands:
command_executions.stdin.write(str(cmd + "\n").encode())
time.sleep(1)
command_executions.stdin.close()
another option
or another example is running the following command :
uninstall_process = subprocess.call(uninstall_string,shell=True)
this really puzzling me because there is no problem or exception (i did not inlcude the exception wrapping)

Does Win32::OLE::Const->Load('Microsoft Excel'); depends on Excel version

I'm using Win32::OLE::Const->Load() in perl :
$xl = Win32::OLE::Const->Load('Microsoft Excel');
then I test if scalar(keys %{$xl}) is zero :
if (scalar(keys %{$xl})==0) {
return False;
}
else {
return True;
}
I tested this code in machine which supports Microsoft Excel 2003 it gives True, but when I tested the same code in machine where there is Microsoft Excel 2013 it gives me False!
I also printed the scalar(keys %{$xl} in the first machine it gives 2023, in the second machine it is 0!
Best Regards
after searching I found the solution.
it gives 0 in the second machine cuz there is no win32 Excel key in the registre.
the solution is adding win32 key in HKEY_CLASSES_ROOT\TypeLib\{00020813-0000-0000-C000-000000000046}\1.8\0\

Windows 8.1 | Code d'erreur : 0x80073712

When I try to enable IIS, Windows PowerShell 2.0 (this what I really need because SQL server needs it), I get the following error:
Code d'erreur : 0x80073712
I tried all solutions that I found on the Internet like:
http://windows.microsoft.com/fr-xf/windows-8/windows-update-error-0x80073712
but no luck. Help please.

"Too many connections" error in a PHPUnit using Zend Framework

I'm unit testing a Zend Framework based project with PHPUnit, it seems like there's too many tests.
Symptoms : I'm writing another test and launching this test on this specific function caused the test to fail with error
Stacktrace :
Zend_Db_Adapter_Exception: SQLSTATE[08004] [1040] Too many connections in /Users/MyUser/workspaces/gitrepo/myprojectcom/webapp/library/Zend/Db/Adapter/Pdo/Abstract.php on line 144
Call Stack:
0.0002 639184 1. {main}() /Users/MyUser/pear/bin/phpunit:0
0.0036 1243552 2. PHPUnit_TextUI_Command::main() /Users/MyUser/pear/bin/phpunit:46
0.0036 1244568 3. PHPUnit_TextUI_Command->run() /Users/MyUser/pear/share/pear/PHPUnit/TextUI/Command.php:130
0.0036 1244568 4. PHPUnit_TextUI_Command->handleArguments() /Users/MyUser/pear/share/pear/PHPUnit/TextUI/Command.php:139
0.0202 5745936 5. PHPUnit_Util_Configuration->getTestSuiteConfiguration() /Users/MyUser/pear/share/pear/PHPUnit/TextUI/Command.php:671
0.0202 5747448 6. PHPUnit_Util_Configuration->getTestSuite() /Users/MyUser/pear/share/pear/PHPUnit/Util/Configuration.php:768
0.0539 6143840 7. PHPUnit_Framework_TestSuite->addTestFiles() /Users/MyUser/pear/share/pear/PHPUnit/Util/Configuration.php:848
0.8321 26889016 8. PHPUnit_Framework_TestSuite->addTestFile() /Users/MyUser/pear/share/pear/PHPUnit/Framework/TestSuite.php:419
0.8329 27067008 9. PHPUnit_Framework_TestSuite->addTestSuite() /Users/MyUser/pear/share/pear/PHPUnit/Framework/TestSuite.php:392
0.8329 27068424 10. PHPUnit_Framework_TestSuite->__construct() /Users/MyUser/pear/share/pear/PHPUnit/Framework/TestSuite.php:318
0.8554 27706232 11. PHPUnit_Framework_TestSuite->addTestMethod() /Users/MyUser/pear/share/pear/PHPUnit/Framework/TestSuite.php:214
0.8555 27706384 12. PHPUnit_Framework_TestSuite::createTest() /Users/MyUser/pear/share/pear/PHPUnit/Framework/TestSuite.php:831
0.8556 27719664 13. ControllerTestCaseAbstract->__construct() /Users/MyUser/pear/share/pear/PHPUnit/Framework/TestSuite.php:554
0.8586 27775696 14. Zend_Application_Bootstrap_BootstrapAbstract->bootstrap() /Users/MyUser/workspaces/gitrepo/myprojectcom/webapp/tests/ControllerTestCaseAbstract.php:24
0.8586 27775696 15. Zend_Application_Bootstrap_BootstrapAbstract->_bootstrap() /Users/MyUser/workspaces/gitrepo/myprojectcom/webapp/library/Zend/Application/Bootstrap/BootstrapAbstract.php:586
0.8586 27775696 16. Zend_Application_Bootstrap_BootstrapAbstract->_executeResource() /Users/MyUser/workspaces/gitrepo/myprojectcom/webapp/library/Zend/Application/Bootstrap/BootstrapAbstract.php:629
0.8586 27776040 17. Bootstrap->_initDb() /Users/MyUser/workspaces/gitrepo/myprojectcom/webapp/library/Zend/Application/Bootstrap/BootstrapAbstract.php:669
0.8590 27782440 18. Zend_Db_Adapter_Abstract->getConnection() /Users/MyUser/workspaces/gitrepo/myprojectcom/webapp/application/Bootstrap.php:97
0.8590 27782440 19. Zend_Db_Adapter_Pdo_Mysql->_connect() /Users/MyUser/workspaces/gitrepo/myprojectcom/webapp/library/Zend/Db/Adapter/Abstract.php:315
0.8591 27782440 20. Zend_Db_Adapter_Pdo_Abstract->_connect() /Users/MyUser/workspaces/gitrepo/myprojectcom/webapp/library/Zend/Db/Adapter/Pdo/Mysql.php:109
To avoid doubt here's my database bootstrap function:
protected function _initDb() {
$databaseConfig = $this->_getDbConfig(); //loaded from an .ini file
$resource = Zend_Db::factory($databaseConfig);
$resource->getConnection();
Zend_Db_Table::setDefaultAdapter($resource);
return $resource;
}
Various other elements :
Commenting one class's test method let me add a this new test case without problem, so the problem doesn't came from my specific new case, but from the amount of test done
I have a very basic _initDb bootstrap function as you can see
This fail also when launching the whole test suite without using "--filter"
My environment is : Mac OS X 10.7.3 Lion, XAMPP's MySQL server 5.1.44, PHPunit 3.6.11 installed through PEAR, PHP 5.3.8
I do close my connection in the tear down [EDIT]
What I'm looking for : any explanation and above all a workaround
Workaround already found : adding a dirty fix in the [mysqld] of /Applications/XAMPP/etc/my.cnf :
set-variable=max_connections=200
You should use closeConnection() from Zend_Db_Adapter.
When you write your web app, there is (usually) no need to explicitly close the connection, because your script starts, executes few queries and ends clearing out all opened connections. In case of your test, you most likely have some long running script, which opens many connections, but since script is not ended, those connections are not cleared out, so yu will have to close them explicitly when you don't need them.

UnsatisfiedLinkError when starting GWT's hosted mode

I can't start my GWT application in hosted mode (Debug as -> web application) using Eclipse. It throws me the exception mentioned in the title. Eclipse debug shows me the following code:
/*
* GOOGLE: Since we're bundling our own version of SWT, we need to be
* able to tell SWT where its dynamic libraries live. Otherwise we'd
* have to force our users to always specify a -Djava.library.path
* on the command line.
*/
String swtLibraryPath = System.getProperty ("swt.library.path");
try {
String newName = name + "-" + platform + "-" + version; //$NON-NLS-1$ //$NON-NLS-2$
if (swtLibraryPath != null)
System.load(swtLibraryPath + System.mapLibraryName(newName));
else
System.loadLibrary (newName);
return;
} catch (UnsatisfiedLinkError e1) {
try {
String newName = name + "-" + platform; //$NON-NLS-1$
if (swtLibraryPath != null)
System.load(swtLibraryPath + System.mapLibraryName(newName));
else
System.loadLibrary (newName);
return;
} catch (UnsatisfiedLinkError e2) {
throw e1;
}
}
The exception being thrown is e1. I have not made any changes to the application, just created it and fired the debug.
What am I missing? I'm using Ubuntu 9.04 64 bits (don't know if this matters)
EDIT: stack trace
Exception in thread "main" java.lang.UnsatisfiedLinkError: /home/rafael/.eclipse/640022211/plugins/com.google.gwt.eclipse.sdkbundle.linux_1.7.0.v200907291526/gwt-linux-1.7.0/libswt-pi-gtk-3235.so: /home/rafael/.eclipse/640022211/plugins/com.google.gwt.eclipse.sdkbundle.linux_1.7.0.v200907291526/gwt-linux-1.7.0/libswt-pi-gtk-3235.so: wrong ELF class: ELFCLASS32 (Possible cause: architecture word width mismatch)
at java.lang.ClassLoader$NativeLibrary.load(Native Method)
at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1767)
at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1663)
at java.lang.Runtime.load0(Runtime.java:787)
at java.lang.System.load(System.java:1022)
at org.eclipse.swt.internal.Library.loadLibrary(Library.java:132)
at org.eclipse.swt.internal.gtk.OS.(OS.java:22)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:63)
at org.eclipse.swt.internal.Converter.wcsToMbcs(Converter.java:54)
at org.eclipse.swt.widgets.Display.(Display.java:126)
at com.google.gwt.dev.SwtHostedModeBase.(SwtHostedModeBase.java:82)
Could not find the main class: com.google.gwt.dev.HostedMode. Program will exit.
Solved the issue. After reading the stack trace more carefully (thanks Warren!), I ended up googling for different terms, and determined the cause to be the word width issue indeed.
The solution was to install a 32-bit JVM and tell Eclipse to use it instead of the 64-bit one. This is done by installing the new JVM, going to Window > Preferences > Java > Installed JREs in Eclipse and adding your new JVM (remember to point to the jre dir). Then I set it as the default one, and managed to run the example.
Including the stacktrace, at least a few lines of it, can really help with these ones as it generally means your system is missing a system library of some form. I think the variable 'newname' actually will list the missing library if you're going through with a debugger.
I also run Ubuntu 9.04, though not 64 bit and when I hit an UnsatisfiedLink error, it was due to the wrong version of libstdc++. This fixed it for me:
sudo apt-get install libstdc++5