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. |
17th March 2019, 07:23 | #1 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
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. |
17th March 2019, 08:28 | #4 | Link | ||
Registered User
Join Date: Oct 2001
Location: Germany
Posts: 7,259
|
Quote:
Quote:
Cu Selur Ps.: LOL, you already solved it while I was writing up my reply. Note that this is not supported on Windows 7. Last edited by Selur; 17th March 2019 at 08:29. Reason: already solved |
||
17th March 2019, 09:52 | #5 | Link |
Registered Developer
Join Date: Mar 2010
Location: Hamburg/Germany
Posts: 10,342
|
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 |
19th March 2019, 17:18 | #7 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
What I want to achieve is having a faster preview dialog in StaxRip, it uses GDI+/System.Drawing. The plan is to create a C++ DLL that takes a DIB pointer from the avifile API and renders it using DirectX. I want to create a bitmap from the DIB by calling the function GdipCreateBitmapFromGdiDib, I included the header Gdiplusheaders.h and added the Gdiplus.lib file to the linker options. Now there are many errors:
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\Gdiplusheaders.h(34): error C2504: 'GdiplusBase': base class undefined 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\Gdiplusheaders.h(39): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\Gdiplusheaders.h(39): error C2143: syntax error: missing ',' before '&' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\Gdiplusheaders.h(40): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\Gdiplusheaders.h(40): error C2143: syntax error: missing ',' before '&' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\Gdiplusheaders.h(40): error C2535: 'Region::Region(const int)': member function already defined or declared 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\Gdiplusheaders.h(39): note: see declaration of 'Region::Region' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\Gdiplusheaders.h(41): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\Gdiplusheaders.h(41): error C2143: syntax error: missing ',' before '*' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\Gdiplusheaders.h(41): error C2535: 'Region::Region(const int)': member function already defined or declared 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\Gdiplusheaders.h(39): note: see declaration of 'Region::Region' 1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\um\Gdiplusheaders.h(49): error C3646: 'MakeInfinite': unknown override specifier I'm using VS 2019 RC with newest SDK and plattform toolkit, in VS 2017 I can't compile anything C++, I've tried to compile my Open with++ shell extension and nomatter what I've tried it wouldn't compile successfully in VS 2017. What could be the reason for the errors? Do I have to add a search directory somewhere VS to look for headers? Did I meantion I'm not very good in C++? |
3rd April 2019, 15:19 | #10 | Link |
Registered User
Join Date: Jun 2002
Location: On thin ice
Posts: 6,837
|
Maybe someone can give me a hint which APIs or source codes I can use to draw a RGB 24 DIB returned by the avifile API. I want to draw to a win32 window handle and it has to be fast so no GDI+. I'm much of a C++ beginner but won't give up on this until I get something done that works.
|
3rd April 2019, 16:12 | #13 | Link |
Useful n00b
Join Date: Jul 2014
Posts: 1,667
|
That's horrible.
DGIndexNV uses the simple SetDIBitsToDevice() and plays UHD way, way faster than 2-3 fps. DGIndex also uses that function. Source code for DGIndex is available. See store.cpp. Use StretchDIBits() if you need to resize for display. Last edited by videoh; 3rd April 2019 at 16:38. |
Thread Tools | Search this Thread |
Display Modes | |
|
|