wxWidgets - wxUSE_UNICODE_MSLU not defined when building minimal sample using binary in Visual Studio - visual-studio-2019

I'm trying to build the minimal wxWidgets sample on Windows, using Visual Studio 2019 Commmunity Edition, following the instructions from this page for using wxwidget binaries
I opened the "minimal_vc9.vcxproj" file in Visual Studio. Visual Studio upgrades the project file.
I then added the wxwidgets.props property file to the property manager, and then tried to build ( Build | Build Solution )
It fails with the following error:
1>C:\Users\Administrator\Desktop\wxwidgets\include\wx\msw\chkconf.h(91,1):
fatal error C1189: #error: "wxUSE_UNICODE_MSLU must be defined."
I am trying to help a friend who knows C++ and uses Windows to set this up, but am not sure how to do so. Note both he and I are new to using Visual Studio as well, and I can't find any references on how to fix this by Googling.
Note I am using the project file that came with minimal (no solution file was there), and can see that in it's configuration that it says "Use Unicode Character Set" at `Project | Properties | Character Set"
EDIT: I'm attaching a picture of the IDE/files we downloaded, which I believe are the 3.1.5 version, ie release version as of Dec 4, 2021?

It looks like you're using wxWidgets 3.0, as support for MSLU was removed since v3.1.0 ~8 years ago. Please download 3.1.5 binaries and open minimal.vcxproj project file to build the sample, there is really no reason to use a 10 year old version if you're starting developing with wx.
Also, completely unrelated, but it's considered to be a bad idea to use administrator account for development. wxWidgets certainly doesn't require any special rights.

I
It is very easy to build the library yourself.
Download the source code archive and unpack it in, e.g. c:\wxWidgets
Start msvc, do ^File->Open", navigate to c:\wxWidgets\build\msw and open the file wx_vc15.sln
Select "Build->Batch Build...", click "Select All", then "Build".
When the build is finished successfully, open c:\wxWidgets\samples\minimal\minimal_vc9.sln, let msvc convert it and choose " Build->Build Solution".
Then when everything is ready, create a project as "desktop application", apply the properties file and start coding.
Thank you.

Related

Problem using the Find References (Inno Setup) feature in Visual & Installer

Let us say that I want to find all instances of where AddFileForDownload in used in my script to Visual & Installer in Visual Studio.
When I do it to usual way:
And it produces results as I expect:
But when I try to use the bespoke feature in Visual & Installer:
I end up with this:
If I drag the pane out it then looks like this:
I am using:
Visual Studio 2019 (16.6.2)
Visual & Installer (1.0.4.8)
This is an issue in VS 2019 which is caused by blocking any extension from synchronously autoloading since 16.1, see: https://devblogs.microsoft.com/visualstudio/updates-to-synchronous-autoload-of-extensions-in-visual-studio-2019/
In V&I this applies to Suggestions (Light Bulb actions - Add File(s) / Add Folder into script) and the References window. Both must be reworked/fixed for VS 2019.
The Suggestions are already done and we are currently working on the References window.
Both will be ready in next V&I release.
Update 27-11-2020: The transparent (blank) controls in References windows are caused by changes in .net DPI awareness: https://blog.jetbrains.com/dotnet/2019/06/11/blank-tool-windows-resharper-visual-studio-2019-net-framework-4-8-per-monitor-dpi-awareness/
Temporary solution is to uncheck Optimize rendering for screens with different pixel densities via Tools | Options, then Environment | General.
Update 2020-11-30: Today we have released an updated version of this tool where we have fixed this issue (it is necessary to reinstall the extension in Visual Studio 2019).
See the details and get latest version from official website: http://visual-installer.com/changelog.html#10410

Dotfuscator throwing error on Xamarin.Android project

I followed the steps to integrate Dotfuscator into my Xamarin.Android project as described here, but when it's time to build the project, I'm getting the following error:
The "_DotfuscatorXamarin_DetermineDefaultInputsTask" task failed unexpectedly.
2>\path\to\PreEmptive.Dotfuscator.Xamarin.targets(570,5): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object.
2>\path\to\PreEmptive.Dotfuscator.Xamarin.targets(570,5): error MSB4018: at InlineCode._DotfuscatorXamarin_DetermineDefaultInputsTask.Execute() in \path\to\AppData\Local\Temp\eruovv3u.0.cs:line 106
2>\path\to\PreEmptive.Dotfuscator.Xamarin.targets(570,5): error MSB4018: at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
2>\path\to\PreEmptive.Dotfuscator.Xamarin.targets(570,5): error MSB4018: at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext()
I have looked and looked online, but no one seems to be having this issue. I think the problem has something to do with generating the default configuration file on the first build. Any ideas?
UPDATE: This issue has been fixed in newer versions of Dotfuscator. See the detailed instructions for the free Dotfuscator Community and for the commercially-licensed Dotfuscator Professional. The original answer follows below.
Full Disclosure: I am a developer of Dotfuscator at PreEmptive Solutions, and am answering this question in that role.
You're right, the problem is the default config file generation in the targets file (PreEmptive.Dotfuscator.Xamarin.targets) - sorry about that. Specifically, the build integration is attempting to discover project references, but expects the classic MSBuild project format, not the new minimal one used by .NET Standard.
You can work around this issue as follows:
In the targets file, locate the _DotfuscatorXamarinConfigTemplateLines property and copy its value (within the CDATA section) to a new file named DotfuscatorConfig.xml (or whatever value you supplied for the DotfuscatorXamarinConfigFileName property in your project file) in the same directory as your project file.
In Visual Studio, build your project once in a configuration you want to protect (e.g., AnyCPU|Release). It will error, because the new config file doesn't have any input assemblies yet, but by building now we get those assemblies in the right location for configuring Dotfuscator.
Open Dotfuscator's user interface.
For Community Edition, from Visual Studio, open the Tools menu and select PreEmptive Protection - Dotfuscator.
For Professional Edition, run Dotfuscator Professional Edition from the Start Menu.
In the user interface, File | Open the file created in step 1.
On the Inputs screen, click the "Add Input" button (a green plus-sign in Community Edition, a folder-opening icon in Professional Edition).
Browse to your project directory, then obj\Release\DotfuscatorXamarin\dfin, and then select the assemblies you want to protect.
Substitute Release with the appropriate directory for the configuration you built in step 2.
You should select assemblies that correspond to projects in your solution, and not select third-party and assemblies that are part of the framework.
Save the config file.
Navigate to the Project Properties editor.
In Community Edition, go to the Build Settings screen and select the Project Properties tab.
In Professional Edition, go to the Settings tab and select the Settings > Project Properties screen.
Add the following project properties (instructions for Community Edition, and for Professional Edition):
Property name InDir, value obj\Release\DotfuscatorXamarin\dfin
Property name OutDir, value obj\Release\DotfuscatorXamarin\dfout
Property name ReportDir, value DotfuscatorReports\Release
Substitute Release with the appropriate directory for the configuration you built in step 2. Note that the directories pointed to by OutDir and ReportDir won't exist on-disk yet.
Save the config file.
Return to the Inputs screen and select an input and click the pencil icon. Edit the path to the assembly from an absolute path to ${configdir}\${InDir}\AssemblyName.dll, substituting AssemblyName.dll for the actual name and extension of the assembly. Repeat for each input assembly.
Save the config file (and commit it to source control).
Rebuild the project in Visual Studio. The build integration will use your config file instead of trying to generate a new one.
on top of the Joe's marvelous solution I ended up changing one value from true to false with regards to the instructions on https://www.preemptive.com/dotfuscator/pro/userguide/en/getting_started_xamarin.html#pctoc-setup
to get my android solution to build/run.
<DotfuscatorXamarinGenerateNewConfigFile>false</DotfuscatorXamarinGenerateNewConfigFile>
I've been configuring the Dotfuscator Community Edition at Xamarin.Android project according to this user guide. And I also had the following build error (pretty the same as #AxiomaticNexus):
Error The "_DotfuscatorXamarin_DetermineDefaultInputsTask" task failed unexpectedly.
System.NullReferenceException: Object reference not set to an instance of an object.
at InlineCode._DotfuscatorXamarin_DetermineDefaultInputsTask.Execute() in c:\Users\user\AppData\Local\Temp\wqhfhbsk.0.cs:line 106
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() eKey.Droid C:\VSProjects\dotFuscatorTest\PreEmptive.Dotfuscator.Xamarin.targets 570
I've fixed this issue using #Joe Sewell's Full Disclosure.
I hope PreEmptive Solutions will realese the fixed version asap!!!
At some point I was missing the file PreEmptive.Dotfuscator.Xamarin.targets in the root of project. I already executed the instructions above described by Joe Sewell, but later noticed the missing file.
Error were like this:
Error The "_DotfuscatorXamarin_DetermineDefaultInputsTask" task failed unexpectedly.
System.NullReferenceException: Object reference not set to an instance of an object.
at InlineCode._DotfuscatorXamarin_DetermineD efaultInputsTask.Execute() in c:\Users\hieta\AppData\Local\Temp\k3a5f2bj.0.cs:line 106
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() WorkSafe.Droid
Just FYI if anyone else could avoid waste of time.

Missing dependency for .ocx on Windows CE 6.0

I'm trying to make an ActiveX control for an application on a Windows CE 6.0 device, but I can't get it to register on the device. When I transfer the .ocx file over to the device and try to register it using regsvrce.exe, it fails with error 7e, which I've learned means a dependency is missing. How can I identify which dependency is missing? Alternatively, have I gone about creating the ActiveX control wrongly?
I have loaded the .ocx in Dependency Walker on my development machine (running Windows 7 64-bit, if that matters) and all of the top-level dependencies it lists are present on the CE device. I can't check further down the tree since Depends then looks for the top-level dependencies on my development machine, half of which are missing since they're CE-specific. Dependency Walker doesn't run on the CE device (unless there's a CE version I've missed?). I tried to copy the DLLs from the CE device to a flash drive so I could load them into DW on my development machine, but the device won't allow me to do so. The OEM tool I have for transferring files unfortunately only transfers to the device. [Edit: I haven't tried writing my own tool to try to pull files from the device to development machine.]
Some details on how I've set up the project, in case I have some wrong assumptions on that end. I have tried with two projects. One has my code in it (the ActiveX Control itself is just a graphical representation of some data, which I had originally set up in a win32 ActiveX control to see how it looks), and one is a clean project - created from template, compiled, downloaded to device; no code added or configuration changed. Both have the same result when trying to register.
Using VS2005, created a project using the "MFC Smart Device ActiveX Control" template, targeting the SDK I received from the OEM.
In the case of the project with my code in it, I copied my drawing code into the project and created the necessary properties for the data input. I can provide more details on my code if it would help, but my issue happens even without the code. I am assuming that since it compiles successfully when targeting the SDK from the OEM that the functions I am using are supposed to be available on the target device.
Build the project in Release configuration (I wondered if the debug libraries were missing on the target device and causing the issue).
Transfer the .ocx file to the target device using an OEM tool.
Start command line on target device, move to directory the .ocx is in, run "regsvrce.exe .ocx". I have also tried transferring all of the files that VS leaves in the build output folder, but the result is the same.
Many thanks in advance for any answers! If you see something obvious point it out - this is my first ActiveX project and my first CE project, so it's very possible I'm missing something basic.
Since you build OCX I assume that you are using MFC. How do you link with MFC? Look in project settings|General, try to select "Use MFC in a Static Library". Same goes for ATL - try selecting "Static Link to ATL" (if you use ATL). This goes also for VCRT - in C/C++|Code Generation, in "Runtime Library" try selecting options without the 'DLL' (i.e. - statically link with VCRT).
Since the default empty OCX does not work for you - this is the only thing I can think of...
Another thing - I assume you have a reason for working with Visaul Studio 2005? Why not a newer version?
Good luck, PazO

OpenCV 2.4.2 library files using CMake and MinGW - Target IDE CodeBlocks

I have been having this issue with OpenCV 2.4.2 that it doesn't really get installed properly with Microsoft VS 2010 Express; It is always missing a dll file or two doesn't matter what I follow by Googling. Also, Visual Studio 2010 Express is only valid for a few days, so it is acceptable that VS will not behave well with OpenCV at that point. However, when I changed my IDE to CodeBlocks, it is even stranger because now I have missing dll files and also "Missing Entry Point" error because of a duplicate .dll file. I found this guide and followed what it told me to do:
http://conanhung.wordpress.com/2012/05/23/opencv-2-2c-codeblocks-and-mingw-got-it-working-on-windows/
But it still doesn't work!! What I am after is a complete and definitive solution to integrating OpenCV (preferrably 2.4.2 version) on a Windows 7 64-bit machine. I have been turning Stackoverflow inside out but no solution is working for me. The problems are
WHEN USING VISUAL STUDIO:
Missing dll file (e.g. libopencv_core242d.dll, etc.)
WHEN USING CODE BLOCKS:
First it complains that libstdc++-6.dll is missing. When I download it to my C:\MinGW\libexec\gcc\mingw32\4.7.0 folder, it stops complaining about this. But now it complains that there is any entry point problem and some other .dll file is missing!!!
If someone has managed to make it work by hook or crook, I will be more than happy to know what it is, IN DEPTH. I don't believe that such an important library can be so stupidly distributed so that developers have to struggle night and day to make this work.
FYI, I have tried even the OPenCV website and frankly their instructions are a bit useless. Also, all the necessary information e.g. adding PATH, adding includes and libraries, etc. Please someone point me to the right direction as it has been two days and I cannot get anywhere. It is literally stopping my job now :(
As an answer, but probably a very simple one, I did the following and got rid of the problem:
1) Uninstalled code::blocks completely from the PC and downloaded the IDE-only version (i.e. withouth MinGW compiler), then installed it.
2) Downloaded the latest stable version of MinGW, installed, and added C:\MinGW\bin to PATH
3) Followed rest of the instructions from [link] http://conanhung.wordpress.com/2012/05/23/opencv-2-2c-codeblocks-and-mingw-got-it-working-on-windows/
4) Just to be sure, copied the opencv .dll files from the build folder (i.e. the one that you have created "make" and "install" files using CMake) to the debug (i.e. the executables') folder.
This will fix the problems. In case, it doesn't it might be that you need to add some environment variables.

Srctool.exe returns -1 error code in TFS

We just set up TFS 11 for the first time. Running a gated check in, it succeeds but returns this message:
'srctool.exe' returned an unexpected exit code: '-1'. An error
occurred when opening a file "CustomDllName.dll": Assembly
"CustomDllName.dll" is not a valid .NET assembly and will be skipped
for analysis.
Well, it's right: that file is a legacy Visual Basic 6 DLL that we don't have much control over. It's included in the project for COM access to some of the methods.
Is there a way to instruct srctool.exe/TFS to skip that file when doing the inspection? Or another way to attack this?
Here is the solution that ultimately worked for me
A member of the TFS 11 team at Microsoft mentioned to me that the problem is due to a change in behavior that the Windows 8 team made to the srctool.exe tool.
By copying this file from the Windows 7 SDK (WinDBG) toolkit and overriding the one included in TFS 11 Beta, I was able to successfully run a build without any errors.
Is this a srctool.exe error from the shipped IndexSources activity? srctool.exe in this activity does one thing, which is to list the source files information in the pdb. I am not a srctool expert so I don't know why it fails in this case. I do know that srctool.exe has some behavioral changes in version 11, most of those are fixes from the previous version.
There is a workaround which requires udpating the build template. It is not very nice but it works. Srctool.exe is run (inside IndexSources activity) for each pdb file in the SymbolFiles collection. Now that you know which pdb fails, you can update the build template to add a RemoveFromCollection activity before the IndexSources activity that remove the troubled pdb from the SymbolFiles collection. This is by far the most straightforward workaround I can think of.
Alternatively, you can edit FindMatchingFiles activity's search pattern to exclude the pdb files you don't want to have sources indexed.
Based on the error message you got, it doesn't seem to be related to the known issue Ed mentioned. We fixed this issue for the next release, so if it's related, it should be fixed :-)
Let me know if you have any issue with VS11 Beta around the build templates.
Thanks.

Resources