|
I didn't find LOCALE_SSHORTTIME in GetLocaleInfo, so how can I find short time format ?
modified 6-Jan-14 8:22am.
|
|
|
|
|
|
Yes, that I had checked in MSDN help, but none of these shows the short time format, just long time format ...
|
|
|
|
|
It was introduced with Windows 7. In any case, the short format is typically the long format minus the "ss" pattern.
"One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
Yes, indeed, I saw no short time format in XP ... thank you all.
|
|
|
|
|
|
i have main.cpp ,makefile , build.bat
//----------main.cpp----------------------------
#include <iostream>
int main()
{
std::cout << "hello world." << std::endl;
return 0;
}
//--------------makefile-------------------------
foo: main.cpp
CL main.cpp
//-------------build.bat--------------------------
@echoOFF
echo buid by commnand line
nmake
echo =============================
echo run main.exe
echo =============================
main.exe
i use "Visual Studio command prompt " to run build.bat file .
+ with visual studio 2010 : ok
+ with visual studio 2008 : error
please help me how to fix on visual 2008 .
Thanks
Thong LT
============================visual studio 2010================
C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>cd c:\Users\ttle\Desktop\
demo
c:\Users\ttle\Desktop\demo>build.bat
buid by commnand line
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
CL main.cpp
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
main.cpp
c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\INCLUDE\xlocale(323) : wa
rning C4530: C++ exception handler used, but unwind semantics are not enabled. S
pecify /EHsc
Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:main.exe
main.obj
=============================
run main.exe
=============================
hello world.
//====================Visual studio 2008 ----------------
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01 for 80x86
Copyright (C) Microsoft Corporation. All rights reserved.
main.cpp
C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\INCLUDE\xlocale(342) : war
ning C4530: C++ exception handler used, but unwind semantics are not enabled. Sp
ecify /EHsc
Microsoft (R) Incremental Linker Version 9.00.30729.01
Copyright (C) Microsoft Corporation. All rights reserved.
/out:main.exe
main.obj
LINK : fatal error LNK1104: cannot open file 'kernel32.lib'
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 9.0\
VC\BIN\CL.EXE"' : return code '0x2'
Stop.
=============================
run main.exe
=============================
'main.exe' is not recognized as an internal or external command,
operable program or batch file.
|
|
|
|
|
Thong LeTrung wrote: LINK : fatal error LNK1104: cannot open file 'kernel32.lib' You should investigate why this message is being produced, and what directories are missing or not available in the 2008 build.
Veni, vidi, abiit domum
|
|
|
|
|
Hi,
I am a beginner in QT. I need to take static build of my QT application. (I am working in windows platform.)
I have done the following steps for the same.
1. Edit the qmake.conf file in C:\QtSDK\Desktop\Qt\ mkspecs\win32-g++ With
QMAKE_LFLAGS = -static -static-libgcc -enable-stdcall-fixup -Wl,-enable-auto-import -Wl,-enable-runtime-pseudo-reloc
2. Run command prompt
And change the path to C:\QT\QtSDK\Desktop\Qt\4.8.0\mingw
3. Run command configure -static –release.
4. Edit the project’s .pro file with
CONFIG += static
5. Restart QT.
But error occured in step3. The error was as follows .
unable to detect the platform from environment. Use -platform command lineargunt or set the QMAKESPEC environment variable and run configure again. See the README file for a list of supported operating systems and compilers.
I would like to know, how to set the QMAKESPEC environment variable and is there any other way to build qt application statically, to create independent executable files?
Thanks in advance,
Neethu.
modified 6-Jan-14 0:00am.
|
|
|
|
|
|
Most probably the QTDIR environment variable is not set. You can set it in your system [...]
How to set an environment variable[^]
Veni, vidi, caecus | Everything summarizes to Assembly code
|
|
|
|
|
I have set the QTDIR Variable with value D:\Qt\4.8.0
and QMAKESPEC=win32-msvc2008.
Updated PATH variable to include %QTDIR%\bin.
But still it is not possible to build the standalone executable file. On running my exe, it says that mingwm10.dll is missing. On copy pasting the same it asks for another dll QTCore4.dll.
|
|
|
|
|
Running Qt-Code has some pre-conditions. Try to copy the contents of %QTDIR%\bin into the folder which is your executable is located in and try to run the program again.
Veni, vidi, caecus | Everything summarizes to Assembly code
|
|
|
|
|
But my requirement is like I have to run the exe without copying any dependent dlls like mingwm10.dll.
Is it possible?
I have updated the myproject.pro file with the following code.
static { # everything below takes effect with CONFIG += static
CONFIG += static
CONFIG += staticlib # this is needed if you create a static library, not a static executable
DEFINES += STATIC
message("~~~ static build ~~~") # this is for information, that the static build is done
mac: TARGET = $$join(TARGET,,,_static) #this adds an _static in the end, so you can seperate static build from non static build
win32: TARGET = $$join(TARGET,,,s) #this adds an s in the end, so you can seperate static build from non static build
}
|
|
|
|
|
|
ok thank you. I shall try again.
|
|
|
|
|
> and QMAKESPEC=win32-msvc2008.
But in the original message you tried to use MingW??
Gisle V.
# rm -vf /bin/laden
/bin/rm: success
|
|
|
|
|
I am still having problems to make a static build of QT application
My exe is not working in any other systems which may or may not have QT. Can anybody help me with exact steps? As a beginner I don't have much idea about this
|
|
|
|
|
You should joint the Qt-interest mailing list interest@qt-project.org
and ask there.
Gisle V.
# rm -vf /bin/laden
/bin/rm: success
|
|
|
|
|
Suppose we have a class:
class container
{
public:
container(sometype *itp)
{
item = itp;
}
~container();
private:
sometype *item;
};
It's possible to use the class object in these ways:
void function()
{
sometype item;
sometype *pitem;
container ct1(&item);
pitem = new sometype;
container ct2(pitem);
}
I'd like to destroy sometype pointer in class's destructor provided it was created on the heap by new operator but not that on the stack. How to make it?
modified 5-Jan-14 0:22am.
|
|
|
|
|
There is no way to tell just by the variable itself, but you could provide a flag to the constructor to indicate the difference:
class container
{
public:
container(sometype *itp, bool HeapFlag)
{
item = itp;
Flag = HeapFlag;
}
~container();
{
if (Flag)
delete item;
}
private:
sometype *item;
bool Flag;
};
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I think I've just found pretty good solution which, however, may not work well in multithreaded environment. Let's add a static variable bool heapcreated , a flag createdflag and overload operator new . That would look like this:
class sometype
{
protected:
static bool heapcreated;
bool createdflag;
public:
sometype()
{
createdflag = heapcreated;
heapcreated = false;
}
bool IsHeapCreated()
{
return createdflag;
}
void *operator new(size_t n)
{
sometype *stp=::new sometype;
heapcreated = true;
return stp;
}
class container
{
public:
container(sometype *itp)
{
item = itp;
}
~container();
{
if (item->IsHeapCreated())
delete item;
}
private:
sometype *item;
};
The new destructor of container would behave different depending on mode of sometype creation. I've searched this solution to be used when you build a library and you do not want a caller to have to do an overhead work adding a flag parameter. If you had to make many calls to container constructor with pointers to sometype it would be slightly difficult to save somewhere the pointers and then delete them. Also, you should be able to pass a pointer to stack variable which must not be deleted explicitly.
It's a bit tricky but my simple test works.
|
|
|
|
|
Good on you! That's a clever solution.
The difficult we do right away...
...the impossible takes slightly longer.
|
|
|
|
|
I was able to find the answer to this question at the end of this post:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/3c4c722d-eecd-49ce-98f9-5948b656bd93/wsextoolwindow-doesnt-give-look-i-want-in-windows-8?forum=vcgeneral[^]
=========
I am creating a window with the WS_EX_TOOLWINDOW style on Windows 8, and the window ends up with the full-height title bar instead of the expected half-height title bar of a tool window.
Does Windows 8 not support this half-height title bar for tool windows, or am I doing something wrong?
Here is the window creation:
hWnd = CreateWindowEx(WS_EX_TOOLWINDOW | WS_EX_TOPMOST, _TEXT("Class"), _TEXT("Caption"), WS_SYSMENU | WS_VISIBLE | WS_SIZEBOX | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInstance, NULL);
EDIT:
I just tested this in a Win 7 virtual machine, and I get the expected half-height title bar, so apparently this has something to do with Windows 8. Does anyone have any idea how to get the half-height title bar in Windows 8?
The difficult we do right away...
...the impossible takes slightly longer.
modified 3-Jan-14 9:37am.
|
|
|
|
|
I am working on a Windows program in C++ that downloads a variable number of files into a directory. Before I do the download, I want to delete all the files in the directory before downloading them. I do not want to write a separate script to do this. I want the C++ program to do it. What is the easiest way to do this?
Bob
|
|
|
|