Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Programming and Hacking > Development

Reply
 
Thread Tools Search this Thread Display Modes
Old Yesterday, 07:23   #1  |  Link
stax76
Registered User
 
Join Date: Jun 2002
Posts: 5,269
problem writing C++ application

It's been 10 I've not used C++ and even then I wasn't very good so please bear with me.

The very first line I wrote already causes an error.

Can anybody tell me what I miss?

Code:
// aviDrawDX.cpp : Defines the entry point for the application.
//

#include "framework.h"
#include "aviDrawDX.h"
#include "aviDrawDX.h"
#include "shellscalingapi.h"
#include "windows.h"
#include <winuser.h>

#define MAX_LOADSTRING 100

// Global Variables:
HINSTANCE hInst;                                // current instance
WCHAR szTitle[MAX_LOADSTRING];                  // The title bar text
WCHAR szWindowClass[MAX_LOADSTRING];            // the main window class name

// Forward declarations of functions included in this code module:
ATOM                MyRegisterClass(HINSTANCE hInstance);
BOOL                InitInstance(HINSTANCE, int);
LRESULT CALLBACK    WndProc(HWND, UINT, WPARAM, LPARAM);
INT_PTR CALLBACK    About(HWND, UINT, WPARAM, LPARAM);

int APIENTRY wWinMain(_In_ HINSTANCE hInstance,
                     _In_opt_ HINSTANCE hPrevInstance,
                     _In_ LPWSTR    lpCmdLine,
                     _In_ int       nCmdShow)
{
	SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE);
Code:
1>aviDrawDX.obj : error LNK2019: unresolved external symbol SetProcessDpiAwareness referenced in function wWinMain
1>C:\Users\frank\Daten\Projekte\CPP\aviDrawDX\x64\Debug\aviDrawDX.exe : fatal error LNK1120: 1 unresolved externals
1>Done building project "aviDrawDX.vcxproj" -- FAILED.
stax76 is offline   Reply With Quote
Old Yesterday, 08:08   #2  |  Link
stax76
Registered User
 
Join Date: Jun 2002
Posts: 5,269
Maybe I need to link against a lib file but how do I know what is the name of the lib file? It's not documented in the document for SetProcessDpiAwareness.
stax76 is offline   Reply With Quote
Old Yesterday, 08:23   #3  |  Link
stax76
Registered User
 
Join Date: Jun 2002
Posts: 5,269
Problem solved, I needed to add shcore.lib in the Linker options.
stax76 is offline   Reply With Quote
Old Yesterday, 08:28   #4  |  Link
Selur
Registered User
 
Selur's Avatar
 
Join Date: Oct 2001
Location: Germany
Posts: 5,795
Quote:
It's not documented in the document for SetProcessDpiAwareness.
Looking at https://docs.microsoft.com/en-us/win...ssdpiawareness which indicates taht SetProcessDpiAwareness belongs to Shellscalingapi.h (https://docs.microsoft.com/en-us/win...ellscalingapi/) and at the bottom of the page you see the requirements:
Quote:
Requirements

Minimum supported client Windows 8.1 [desktop apps only]
Minimum supported server Windows Server 2012 R2 [desktop apps only]
Target Platform Windows
Header shellscalingapi.h
Library Shcore.lib
DLL Shcore.dll
-> what documentation are you looking at?

Cu Selur

Ps.: LOL, you already solved it while I was writing up my reply. Note that this is not supported on Windows 7.
__________________
Hybrid here in the forum, homepage

Last edited by Selur; Yesterday at 08:29. Reason: already solved
Selur is offline   Reply With Quote
Old Yesterday, 09:52   #5  |  Link
nevcairiel
Registered Developer
 
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 9,601
Instead of using the SetProcessDpiAwareness call, I would personally recommend setting DPI Awareness in the manifest. That is fully compatible with any OS version.
__________________
LAV Filters - open source ffmpeg based media splitter and decoders
nevcairiel is offline   Reply With Quote
Old Yesterday, 09:55   #6  |  Link
stax76
Registered User
 
Join Date: Jun 2002
Posts: 5,269
Thanks, I missed it somehow. In the end if I can get it working it's gonna be a dll used in staxrip which sets DPI awareness already in a Win 7 compatible way.
stax76 is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 21:28.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.