I can't set a bookmark for any article. The bookmark sign is missing. I'm running Firefox 67.0.2
Theo Buys
Posts
-
Missing bookmark for articles -
create a dpi-aware applicationThanks! This is the info where I was looking for!
-
create a dpi-aware applicationBecause the Microsoft Surface is default at 150% system scaling, I must do dialog development in 1024 x 768 pixels at 96 dpi to match the full screen for a dpi-aware application. Right?
-
create a dpi-aware applicationNot true... When I created a dialog template that is at 96 dpi full screen. With a system dpi scaling of 150% ( 144 dpi) the bottom and right are not visible with the same screen size.
-
create a dpi-aware applicationYes I can use GetSytemMetrics for the custom drawings. But not the dialogs templates in resource which are sized by the system.
-
create a dpi-aware applicationI try to find out what the best strategy is to create a MFC based application that is dpi-aware. Windows is based on 96 dpi for years. Today there are pc's like the Microsoft Surface that have lot more dots per inch. In windows you can set the screen scaling factor to 100%, 125%, 150%, etc. If you build the application with a manifest that set DPI Awareness with High DPI Aware, then the resource templates like dialogs scale automatically. Only the custom drawings must be scaled with extra code like:
int DpiScale(int val)
{
const HDC hDC = ::GetDC(NULL);
const UINT dpix = ::GetDeviceCaps(hDC, LOGPIXELSX);
::ReleaseDC(NULL, hDC);
return ::MulDiv(val, dpix, 96);
}int DpiPerc()
{
return DpiScale(100);
}DpiScale you can for coordinates or font points. DpiPerc you can use to select the a icon or picturewith the right resolution from resource. My question is, must I develop the application for 1024 x 768?
-
Toolbar ResizingThe link is out of date. I found the page with Google by enter "TN031 Control Bars".
-
How to setup a local database for my applicationI need this database to contain meta-data for a language parser. With a lexicon with 8000 words, 8000 embeded MP3 and 60 video-files.
-
How to setup a local database for my applicationWhat is the best replacement for the MS-Access database: SQL Server Compact or SQL Server Express? I want a silent setup easy to do by users.
-
How to setup a local database for my applicationHello experts, I have build C++/MFC windows desktop applications which using MS-Access databases with ADO. The MS-Access databases which containing data are easy to include in the setup executable. My applications also have access to a MS-SQLServer database in a cloud location. Now I like to replace the MS-Access databases with local MS-SQLServer database. I only have to change the connection-strings for ADO in the applications. The only problem I think I have: 1. How to setup a local MS-SQLServer from my setup application. 2. How to deploy a not empty MS-SQLServer database. I don't know where to start, will you hint me in the right direction?
-
need help selecting a string typeSometimes you need both. For UTF-8 unicode I use std::string For UTF-16 unicode I use std::wstring
-
C++ 11 std::unique_ptr related compiling errorYour don't initialize x
-
Unicode and codeproject articleDaniel Pfeffer wrote:
Richard MacCutchan wrote:
If you make everything Unicode, you should not have any issues.
It depends on what you mean by Unicode... Windows API and UI use UTF-16 (started with Windows-NT 4.0) but if you generate output for a SMTP/email/WEB you must use UTF-8. For UTF-16 you can use CStringW or std::wstring but for UTF-8 CStringA or std::string. UTF-8 is a multibyte string format but it has nothing to do with the old MBCS which depend on codepages. In this case using CSting depended on the UNICODE define to make the code UTF-16 aware is now out of time and can shoot you in the foot. Conversions between UTF-16 and UTF-8 can be done with the current MultiByteToWideChar and WideCharToMultiByte. But if you write more general software, do it with the stl:
wstring_convert> converter;
The bad thing is that the current C++ Visual Studio editor can't handle utf-8 string literals. It is a Windows application you know...
-
where is WINVER set (resolved)With visual studio "find in files", you can find all #define WINVER when look in "visual c++ include directories" I get: winres.h, sdkddkver.h, vdssys.idl, WinDef.h, WinGDI.h, WinReg.h, WinResrc.h, winsdkver.h and WinUser.h But you have to start follow the includes in your stdafx.h to find the ones your application is including. I see: #include "targetver.h" which includes #include which is one on my list and contains #ifndef WINVER #ifdef _WIN32_WINNT // set WINVER based on _WIN32_WINNT #define WINVER _WIN32_WINNT #else #define WINVER 0x0601 #endif #endif So if you put in stdafx.h #ifndef WINVER #define WINVER 0x0400 #endif before #include "targetver.h" then it is not grey out.
-
scaling of GUI objects for touch screensThanks for reply. "Years ago" I have only to deal with visibility. With the mouse you can click them all. But today people like to foul the screen with their fingers. It seems that the API GetDeviceCaps did not work right with the new Windows Display Driver Model (WDDM) beginning with Windows Vista. I found out a way to get the screen driver info from registry but that don't work for old XP. I hope OS gets an upgrade to better support touchable objects for native desktop applications.
-
scaling of GUI objects for touch screensMy native C++/MFC desktop-application is hard to touch with the current high resolution touch-screens. The API GetDeviceCaps don't help because it don't reply the right sizes of the screen. The scaling of GUI-objects seems to become a nightmare to keep them touchable. The Windows OS also did not help. There is only a option to size the text in template resources with 100% (standard), 125% and 150%. But that resizes the complete desktop. There is no option for a single application. The size of template dialog-windows is based on the font points. But is seems hard to change this dynamical for all dialogs en message-boxes. Does anyone have a solution for this?
-
using friendfriend can be used to give another class access to the protected and private members of the class that specified friend. If C_Messages want to access the protected and private members of the class C_Configuration then C_Configuration specified C_Messages as friend. If you aggregate the class C_Messages so that is has a C_Configuration, you can only access the public members of C_Configuration in C_Messages. But with the friend specifier you can also access the protected and private members. Sample code:
class C2;
class C1
{
public:
int public_var;
protected:
int protected_var;
private:
int private_var;
friend class C2;
};class C2
{
public:
class C1 member;
void set_private_var (int v) { member.private_var = v; }
void set_protected_var (int v) { member.protected_var = v; }
};void Test()
{
C2 obj;obj.member.public\_var = 100; // ok // ERROR: can't access protected and private member // obj.member.protected\_var = 100; // obj.member.private\_var = 200; obj.set\_protected\_var(100); // ok obj.set\_private\_var(200); // ok
}
Another solution is working with an intermediate class which specifies the friend. In this case you get only access to public and protected members of the base class. Sample code:
class C1
{
public:
int public_var;
protected:
int protected_var;
private:
int private_var;
};class C1B : public C1
{
friend C2;
}class C2
{
public:
class C1B member;
void set_protected_var (int v) { member.protected_var = v; }
};void Test()
{
C2 obj;obj.member.public\_var = 100; // ok // ERROR: can't access protected and private member // obj.member.protected\_var = 100; // obj.member.private\_var = 200; obj.set\_protected\_var(100); // ok
}
-
Why calling sort() crashes?I think that equality don't work in sort. Why swap elements if they are equal?
-
Is MFC resources occupy memory?I found this in Charles Petzold programming windows book: Resources are data and they are often stored in a program's .EXE file, but they do not reside in the executable program's data area. In other words, the resources are not immediately addressable by variables in the program's code. Instead, Windows provides functions that explicitly or implicitly load a program's resources into memory so that they can be used.
-
"Shift+Delete" and "Ctrl+X"Check your (rc) resouce file. Do you have a multi language resource in it? A resource that deal with any language must be set [Neutral].