Now there is problems on resource file... How sad...
I restored to the original windres.exe (from 64 bit download)
-------------- Build: Debug in MYYYYYYYYYYYYYYYYYYYY (compiler: GNU GCC Compiler)---------------
x86_64-w64-mingw32-g++.exe -LC:\wxWidgets-3.0.0\lib\gcc_dll -o bin\Debug\MYYYYYYYYYYYYYYYYYYYY.exe obj\Debug\MYYYYYYYYYYYYYYYYYYYYApp.o obj\Debug\MYYYYYYYYYYYYYYYYYYYYMain.o obj\Debug\resource.res -m32 -mthreads -lwxmsw30ud -mwindows
c:/tdm-gcc-64/bin/../lib/gcc/x86_64-w64-mingw32/4.8.1/../../../../x86_64-w64-mingw32/bin/ld.exe: i386:x86-64 architecture of input file `obj\Debug\resource.res' is incompatible with i386 output
collect2.exe: error: ld returned 1 exit status
Process terminated with status 1 (0 minute(s), 0 second(s))
0 error(s), 0 warning(s) (0 minute(s), 0 second(s))
I replaced the windres.exe by the 32 bit version, the application is compiled but when running it I see a windows application error (so not started correctly (0x000007b))
I also restored windres to the 64 bit version and put :
windres.exe -F pe-i386
in the resource compiller.
The appli compiles wll but 0x000007b error takes place.
Can I use the 32 bit version of TDM-GCC-32 to run get_accName?
No! I gave a try and get_accName returns to the jump initial problem
wxmsw30u_gcc_custom.dll MUST be placed in the same folder as your application, a wrong version could be loaded. Did you put old DLL in system32 by any chance ?
Start your program from windows explorer.
It appears you are loading a 64-bit DLL into a 32-bit process or vice versa. That error means STATUS_INVALID_IMAGE_FORMAT.
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
IEHIMS.DLL
Error: At least one module has an unresolved import due to a missing export function in an implicitly dependent module.
Error: Modules with different CPU types were found.
Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.
...
wtsapi.dll x64
XMLLITE:DLL x64
IEHIMS.DLL x86
wxmsw30ud_gcc_custom.dll x86
Thre rest of the modules dll are all x64 (suppressed with ... )
May be the solution is to roolback everything to the mingw 32 bit version and implement, as a lib, the get_accName using the mingw and ultimate++. Then I link that lib with the wxwidget application. what do you think?
I uploaded project bundle to: http://www.filedropper.com/swswsw
REM: that project was created just for testing (do not ‘look’ for indentation and code structure either :-) . Just for testing! )
The problem is with the application manifest, wxwidgets is picking the one for amd64 wrongly. possible fix, add __i386__ to prepocessor definitions and REBUILD.
If that does NOT work edit the file C:\wxWidgets-3.0.0\lib\gcc_dll\mswud\wx\msw\rcdefs.h, for some reason #define WX_CPU_AMD64 is wrongly there, it should be WX_CPU_X86.
After you succeed that, we can talk about errors I've found in your code, like improper use of BSTR, char and LPCWSTR (casting between them is VERY bad !!!).
Then, keeping #define WX_CPU_X86 in the rcdefs.h I added __i386__ to the #define tab of debug and release build options. Cleaned and rebuild and got 0xc000007b error.
(may be it is time to install and compile everything from ground up...)
No way...
As far as "talk about errors I've found in your code" is concerned, I will appreciate it very much, but remember, due to the need to use get_accName it is my first time dealing with Win32 nacked API ;-) which is very confused, lots of string types and etc.
OK. The final fix (and this will work 100 %) is to edit C:\wxWidgets-3.0.0\include\wx\msw\amd64.manifest and C:\wxWidgets-3.0.0\include\wx\msw\wx.manifest to read this:
Clean rebuild => ||Execution of C:\swswsw\bin\Release\swswsw.exe" ' in 'C:\swswsw' failed.|
I roolbaked previous changes (__i386__) and kept changes in amd64.manifest and wx.manifest and Clean, rebuild => ||Execution of C:\swswsw\bin\Release\swswsw.exe" ' in 'C:\swswsw' failed.|
when executing exe in explorer I see:
It wos not possible to statrt application because of incorrect side.by-side configuration
OK. This is the correct code for converting BSTR to wchar_t (not to char, but you don't need it anyway):
1 2 3 4 5 6 7 8 9
UINT length = SysStringLen(str_name); // Ask COM for the size of the BSTR
wchar_t *buf = newwchar_t [length + 1]; // Note: SysStringLen doesn't
// include the space needed for the NULL
wcscpy(buf, str_name); // Or your favorite safer string function
// ...
MessageBox(NULL, buf, buf, MB_OK);
delete buf; // Done