Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
T

Theo Buys

@Theo Buys
About
Posts
27
Topics
5
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Missing bookmark for articles
    T Theo Buys

    I can't set a bookmark for any article. The bookmark sign is missing. I'm running Firefox 67.0.2

    Site Bugs / Suggestions

  • create a dpi-aware application
    T Theo Buys

    Thanks! This is the info where I was looking for!

    C / C++ / MFC question c++ wpf learning

  • create a dpi-aware application
    T Theo Buys

    Because 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?

    C / C++ / MFC question c++ wpf learning

  • create a dpi-aware application
    T Theo Buys

    Not 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.

    C / C++ / MFC question c++ wpf learning

  • create a dpi-aware application
    T Theo Buys

    Yes I can use GetSytemMetrics for the custom drawings. But not the dialogs templates in resource which are sized by the system.

    C / C++ / MFC question c++ wpf learning

  • create a dpi-aware application
    T Theo Buys

    I 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?

    C / C++ / MFC question c++ wpf learning

  • Toolbar Resizing
    T Theo Buys

    The link is out of date. I found the page with Google by enter "TN031 Control Bars".

    C / C++ / MFC question help

  • How to setup a local database for my application
    T Theo Buys

    I need this database to contain meta-data for a language parser. With a lexicon with 8000 words, 8000 embeded MP3 and 60 video-files.

    Database c++ database hosting cloud help

  • How to setup a local database for my application
    T Theo Buys

    What 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.

    Database c++ database hosting cloud help

  • How to setup a local database for my application
    T Theo Buys

    Hello 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?

    Database c++ database hosting cloud help

  • need help selecting a string type
    T Theo Buys

    Sometimes you need both. For UTF-8 unicode I use std::string For UTF-16 unicode I use std::wstring

    ATL / WTL / STL c++ csharp visual-studio com design

  • C++ 11 std::unique_ptr related compiling error
    T Theo Buys

    Your don't initialize x

    ATL / WTL / STL help c++ visual-studio performance tutorial

  • Unicode and codeproject article
    T Theo Buys

    Daniel 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...

    ATL / WTL / STL c++ com tutorial question

  • where is WINVER set (resolved)
    T Theo Buys

    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.

    ATL / WTL / STL c++ csharp visual-studio com question

  • scaling of GUI objects for touch screens
    T Theo Buys

    Thanks 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.

    Windows API c++ json help question

  • scaling of GUI objects for touch screens
    T Theo Buys

    My 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?

    Windows API c++ json help question

  • using friend
    T Theo Buys

    friend 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	
    

    }

    ATL / WTL / STL c++ question csharp visual-studio com

  • Why calling sort() crashes?
    T Theo Buys

    I think that equality don't work in sort. Why swap elements if they are equal?

    ATL / WTL / STL graphics help question

  • Is MFC resources occupy memory?
    T Theo Buys

    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.

    C / C++ / MFC c++ performance question

  • "Shift+Delete" and "Ctrl+X"
    T Theo Buys

    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].

    C / C++ / MFC c++ help tutorial question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups