I'm using DWT from the GitHub repository (the latest version) with recomended building parameters for Windows:
dmd "myGuiApp.d" -IC:\\D\\dwt\\imp ^
-JC:\\D\\dwt\\org.eclipse.swt.win32.win32.x86\\res ^
-L+C:\D\dwt\lib\ -L+org.eclipse.swt.win32.win32.x86.lib ^
-L+dwt-base.lib -L/SUBSYSTEM:windows:4
The GUI applications may run on Win XP and Win 7, but the DWT-controls style is like from the older Windows versions like it was on Win 98 (without color gradient on the buttons, with strict corners). My first idea was to change parametr SUBSYSTEM to windows:5 or windows:6, but it didn't help. And I failed to find any mention about similar problems in google.
So maybe anyone knows or guesses, what am I doing wrong?
You probably need a manifest for the exe and might have to call InitCommonControlsEx (I don't know if DWT does this or not; I've never actually used it) http://msdn.microsoft.com/en-us/library/windows/desktop/bb775697%28v=vs.85%29.aspx
The manifest is explained here, along with an overview of how to do it:
http://msdn.microsoft.com/en-us/library/windows/desktop/bb773175%28v=vs.85%29.aspx
The manifest is the XML stuff a bit down on that page. The D compiler doesn't have the pragma to add the xml right in, but you can compile it into a resource file or just name the XML file yourexename.manifest and put it in the same directory as the exe.
From the MSDN link:
"Manifests are written in XML. The name of the application manifest file is the name of your executable followed by the file name extension .manifest; for example, MyApp.exe.manifest. The following sample manifest shows that the first section describes the manifest itself. The following table shows the attributes set by the assemblyIdentity element in the manifest description section."
Related
I want to build C++ desktop applications using visual studio and wxWidgets on windows 7. I'm coming from C++ Builder.
I downloaded and built the wxWidgets libraries successfully and I can run the minimal_vc14 solution just fine. Now it comes time to create my Hello World app. I've created a new, empty C++ project and using NuGet added the wxWidgets template. Then I use class wizard to add a new class (Test3) with a base class of wxApp.
I immediately get 45 errors. The first of which is
Severity Code Description Project File Line Suppression State
Error (active) cannot open source file "../../../lib/vc_dll/mswud/wx/setup.h" Test3 c:\wxWidgets-3.1.0\include\msvc\wx\setup.h 121
digging into that file I find the following bit. The last include statement is the problem line identified above, but the problem I think is in the wxConcat6 statement. All of those ../ lead nowhere. Shouldn't that point to $(WXWIN)?
// the real setup.h header file we need is in the build-specific directory,
// construct the path to it
#ifdef wxSUFFIX
#define wxSETUPH_PATH \
wxCONCAT6(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, wxSUFFIX, /wx/setup.h)
#else // suffix is empty
#define wxSETUPH_PATH \
wxCONCAT5(../../../lib/, wxLIB_SUBDIR, /, wxTOOLKIT_PREFIX, /wx/setup.h)
#endif
#define wxSETUPH_PATH_STR wxSTRINGIZE(wxSETUPH_PATH)
#include wxSETUPH_PATH_STR
Also, smaller problem but further up the setup.h file I see that WXUSINGDLL has been defined, but I want to use libs. I can't figure out where that is being set either.
Obviously there is a configuration step I missed somewhere. Please advise.
As usual the answer can be found by reading EVERYTHING.
There are 2 things that need to be configured for this process to work correctly.
After creating the project go to the project properties and set the character set to Unicode. The default is Multi-Byte. My next quest will be to find where to change the default!
After installing the package template (or is it a template package?) go to the project properties and set shared to "statically linked build".
Presto changeo, you are ready to go. Add the following for the absolute minimum to make a compilable application. This is based on the tutorial here:creating-wxwidgets-programs-with-visual-studio-2015
bool MyProjectApp::OnInit()
{
wxFrame* mainFrame = new wxFrame(nullptr, wxID_ANY, L"MyProject");
mainFrame->Show(true);
return true;
}
wxIMPLEMENT_APP(MyProjectApp);
I suggest you make a copy of minimal sample (or widgets, as it uses more controls and links more libs), in the same location, and modify the source file as you need.
When you have played enough with it, for sure you'll find it quite easy to change the project file so that it'll use $(WXWIN) or any other custom settings.
p.s. I don't know what "wxWidgets template" from NuGet contains, but I strongly doubt it is provided by wxWidgets maintainers.
i'm trying to build a simple Audio plugin using WDL-OL (a library that helps porting the plugin on various platforms) on OSX. The plugin builds ok on Windows
as soon as it tries to load a resource background file, i got an ASSERT warning that the file isn't found
1 my files are present in the Copy Bundle Resources part
2 i've tried all kind of combinations with/without subfolder, with caps or not
i'm lost there i don't get why it doesn't find the file
if i create a simple test it works, it finds the file knob.png but with my project it doesn't work
also if i point to the file knob.png (that should work), it doesn't work in my new project, so my guess is that it isn't the png files that are wrong. It comes from somewhere else...
here is what i used in the resource.h:
#define BCKG_ID 102
#define BCKG_FN "resources/img/background2.png"
and i call the background using this code :
pGraphics->AttachBackground(BCKG_ID, BCKG_FN);
please help, thanks
Jeff
EDIt1 : okay i found something interesting
in MyProject-OSXAPP-Info.plist, "Bundle Identifier" is set to : com.Khaelis.standalone.${BINARY_NAME}
but if i stop the program at the function LoadImgFromResourceOSX(...) and look at the variable "bundleID", it shows:
"bundleID = com.Khaelis.standalone.test"
even if i entered another BINARY_NAME (in MyProject.xcconfig)
how come ? the compiler doesn't apply the name i put.
the variable "bundleID" should be com.Khaelis.standalone.PerfectEQ not com.Khaelis.standalone.test
is there a file that i should update?
ok found it
if you ever encounter this kind of error (resource not found) check if the Bundle Name (in resource.h) and BINARY_NAME (in Project.xcconfig) are the same
then it should work
Jeff
I've created Qt project using Visual studio 2012 32 bit and Qt5 SDK with the help of Visual studio Qt addon. I'm using Windows 7 ultimate OS.
I have created QApplication GUI Project which basically uses the following libraries:
qtmain.lib
Qt5Core.lib
Qt5Gui.lib
Qt5Network.lib
Ws2_32.lib
Winhttp.lib
Winmm.lib
Qt5Widgets.lib
Qt5PlatformSupport.lib
imm32.lib
And I have succeed in building the application binary without any errors.
I’m trying to run this application on test machine windows 7 desktop having following dlls copied there:
icudt51.dll
icuin51.dll
icuuc51.dll
libEGL.dll
libGLESv2.dll
Qt5Core.dll
Qt5Network.dll
Qt5GUI.dll
Qt5Widgets.dll
qwindows.dll [copied from msvc2012\plugins\platform folder ]
I’m getting the error:
Failed to load platform plugin “windows”. Available Platform are : while trying to run the application.
What would i have missed? How to make it run on windows platform? Please Help me to troubleshoot this.
I've followed the links posted about this problem previously. but none of them are solved my problem. What configuration I am missing?
The platform plugin dlls would need to be put into the platforms subfolder and then it will work.
Yet another solution: Early in your main function or whatever, call QCoreApplication::addLibraryPath(). A simple example:
std::ifstream configurationStream("whateverNameYouWant.conf");
std::stringstream configurationText;
configurationText << configurationStream.rdbuf();
auto ct = configurationText.str();
if (!ct.empty())
QCoreApplication::addLibraryPath(QString::fromStdString(ct));
Here I load the path from a .conf file of my own invention, so that the path won't be hardcoded into my program. Since I invented this file, I control its format; in this case it contains nothing but the path. The actual path I'm using is C:/qt5/qtbase/plugins; that directory contains platforms/qwindows.dll and other such files. One may adjust the paths for one's own case according to where one's Qt files are installed.
I guess it is also supposed to be possible to use a standard qt.conf file, using a format specified by Qt, to automatically load some special paths (including this plugins path) without having to add special code to your own program for the purpose: http://doc.qt.io/qt-5/qt-conf.html ...But I haven't ever managed to get that to work, for whatever reason. Maybe I'm making some simple mistake, I dunno.
An other solution is to add arguments to the QApplication object (or to the starting application).
For instance, you want to load qwindow.dll from C:\test\platforms.dll, you can instanciate QApplication object with the following code :
int ac = 4;
static char * av[] = {"myappli.exe","C:\\\\path\\to\\myappli.exe","-platformpluginpath","C:\\\\test"};
m_qApp = new QApplication(ac, av);
Be careful, the QTCore dll can't be into the directory C:\test (loading dll conflict)
If you specify a working directory different than the one where your executable is located, no matter the plugins are there, it will fail.
So, in that case, copy your file with a post build event.
And in:
Configuration properties->Debugging->Command
specify the full path of the executable.
This was tested on VStudio 2008.
I have some vb6 code I have not compiled in a long time. The last compile is in production. Now I get an error "User-defined type is not defined" when I do a full compile. I'm sure there is a reference missing. But there is no code that is hi-lighted. And I cannot seem to find what reference might be lost.
Any clues as to what I can do to find the missing reference would be very helpful.
Thanks!
Dave
I've had that happen before it drove me crazy!! But then I found this:
http://support.microsoft.com/kb/190197
Occurs when compiling with binary compatibility on. The above solution suggests turning off binary compatibility and re-compiling - then missing reference will then be highlighted.
Other steps you can try:
Rather than turning off BC for everything look for ones that have
been recently changed
search C: drive and dev folder and delete any
*.oca files
also look in the vbp file for any oca references
You need to ensure that you have the appropriate items checked in the References dialog. This is outside the code and they are listed in the VBP file (text file).
EDIT Corrected reference storage. Thanks MarkJ
Make sure all of your object types are spelled right. A simple error like spelling Variant Varient can cause this error as well.
Are you still using the same machine in which the original compile was made and / or with the same OS
?
If the answer is no, then there is a chance that VB6 or its like linked to a reference which is no longer available in Win7 or later, this may also include the compiler if you are using a modern version of studio.
Since the code is also in VB6, if you are using any outside commercial controls, and again if not on the same machine, you would loose those links as well if you did not port over the library.
I have to create (or rather modify) software package for MacOSX on Windows. I can do what I need with .pax files, so the only thing left is bill-of-material.
Does anyone know of a library that can do it? Is there BOM file format (Apple-version) available?
TIA
There is now an open source version of mkbom which also compiles for windows at:
http://hogliux.github.io/bomutils/
The windows version still contains some bugs (no special characters in file names and limitations on file path length). However, it should work for simple installers.
The website also has an easy to follow step-by-step tutorial on how to create a Mac OS X installer (however, the tutorial is for linux, see http://hogliux.github.io/bomutils/tutorial.html ).
Well, BOM is not necessary, MacOSX package is a simple directory structure with optional elements, BOM being one of them.