Quantcast
Channel: Visual C forum
Viewing all 15302 articles
Browse latest View live

Some way to find out what dll's are installed with each version of Visual C++ Redistributable?

$
0
0

Windows 8.1 on an HP Envy m6-n010dx.

The Remote Access Connection Manager on my wife's computer fails to start because it's unable to load one or more connection dll's. Looking inside rasman.dll, I see it referencing the following dll's: api-ms-win-core-delayload-l1-1-1, api-ms-win-core-errorhandling-l1-1-1.dll, api-ms-win-core-handle-l1-1-0.dll, api-ms-win-core-heap-l1-2-0.dll, api-ms-win-core-heap-obsolete-l1-1-0.dll, api-ms-win-core-kernel32-legacy-l1-1-1.dll, api-ms-win-core-libraryloader-l1-2-0.dll, api-ms-win-core-processenvironment-l1-2-0.dll, api-ms-win-core-processthreads-l1-1-2.dll, api-ms-win-core-profile-l1-1-0.dll, api-ms-win-core-psapi-obsolete-l1-1-0.dll, api-ms-win-core-registry-l1-1-0.dll, api-ms-win-core-string-l1-1-0.dll, api-ms-win-core-string-l2-1-0.dll, api-ms-win-core-string-obsolete-l1-1-0, api-ms-win-core-synch-l1-2-0.dll, api-ms-win-core-sysinfo-l1-2-1.dll, api-ms-win-security-base-l1-2-0.dll, api-ms-win-security-sddl-l1-1-0, api-ms-win-service-management-l1-1-0, api-ms-win-service-winsvc-l1-2-0.

Is there any way I can find a list of dll's that are installed with each version of Visual C++ Redistributable, to see if any of them will install the dll's that rasman.dll is looking for on my wife's computer?


IPropertySetStorage / IPropertStorage Interfaces.

$
0
0

Hello, 

           I have successfully applied custom properties to a file .It works fine after writing and reading the properties. But when I modify/Edit the file all the custom properties are lost .Any solution to retain the properties after modifying the file?

Thnk you in advance!

Track click event

$
0
0

Hi,

In my MDI application I have a button in a CDockablePane. When clicking the button I am displaying a popup modeless dialog . When clicking outside of the newly created popup dialog I am destroying that dialog.

In the newly created dialog, I overrode the OnActivate() and when getting  nstate as WA_INACTIVE, I am destroying the dialog.

Now My requirement is 

1. When I click the button second time if the popup dialog is destroyed by clicking outside of the dialog other than this button, I have to display the popup dialog again.

2.When I click the button second time if the popup dialog is destroyed by clicking on this button , I should not display the dialog.

OnActivate event of the new popup dialog is getting called before the OnButtonClick of theCDockablePane. Whenever I go to OnButtonClick the new popup dialog is in destroyed state only.

In onActivate the pWndOther is always giving cmainframe window when nstate is WA_INACTIVE.

How to get whether user clicked on the button or any other control or dialog or mainframe or view?

Wheras if the parent is CDialog instead of  CDockablepane when clicking the button second time OnActivate event of the new popup dialog is getting called and OnButtonClick  is not getting called.

Please help me to meet my requirement.


GetCurrentConsoleFontEx: What am I doing wrong? NVM, found it.

$
0
0

Couldn't figure out why this code wasn't working. The documentation didn't mention that I needed to set the cbSize property. I remember seeing it needed on another function, and I'm guessing that's common practice in the Windows API.

#include <Windows.h>
#include <iostream>
int main()
{
	CONSOLE_FONT_INFOEX cfo;
	cfo.cbSize = sizeof(CONSOLE_FONT_INFOEX); //Forgot this line. Here's the bug.
	if(!::GetCurrentConsoleFontEx(GetStdHandle(STD_OUTPUT_HANDLE), FALSE, &cfo)) {
		std::wcout << GetLastError() << std::endl;
		return -1;
	}
	std::wcout << cfo.FaceName << std::endl;
	return 0;
}


Using QueryPerformanceCounter and Auto-Parallelization

$
0
0
Hello, for a project in my Computer Architecture class, I am trying to use QueryPerformanceCounter to measure the performance of <g class="gr_ gr_11 gr-alert gr_gramm gr_inline_cards gr_run_anim Grammar only-ins replaceWithoutSep" data-gr-id="11" id="11">auto-parallelized</g> and auto-vectorized code. This requires me to use the /<g class="gr_ gr_10 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling" data-gr-id="10" id="10">clr</g> flag along with /arch<g class="gr_ gr_13 gr-alert gr_gramm gr_inline_cards gr_run_anim Style replaceWithoutSep" data-gr-id="13" id="13">:SSE2</g> and /Qpar. However, when building the project, I receive this error:

Command line error D8016: '/<g class="gr_ gr_9 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="9" id="9">clr</g>' and '/Qpar' command-line options are incompatible.

I am quite new to using Visual Studio 2017. Is there any way to get rid of this error?

Visual Studio 2013 GivesExceptions at Memset function while using DirectX 9.

$
0
0

I am trying to program a RTS game. I did not know what to do for a minimap, so I bought a book called Programming a 3d RTS Game with Direct3D by Carl Granberg. When I tried to compile with the newer code (at this website: http://web.archive.org/web/20120112085635/http://www.cjgraphic.com/?page=rts-book    the you can see the full minimap code if you check chapter 16. I used that code for my game)

When I tried to compile it, I got an exception because I was using this function (can be found around line 54 in the mapObject.cpp file)

memset(bytes, 0, sRect.Pitch*sRect.Pitch);

I am using DirectX 9, and will convert to DirectX 12 when I get this issue out of the way. 

How can I fix this issue?

What I know is that this draws the black square that covers the minimap for the minimap's fog of war. When I comment out the code, the game runs fine, but I only get 1/3 of a minimap, which is an obvious problem.

If there are any other problems, just tell me.

-rydog

VS 2015 Build Error

$
0
0

I am trying to compile a simple C++ project using VS 2015. But as I try to do that, the build fails and it gives the below 4 errors. Please can somebody suggest what can I do. I tried re-installing the VS many times but still the same error.

1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeAnalysis\Microsoft.CodeAnalysis.targets(219,5): error MSB3758: An error has occurred during compilation. error CVT1101: cannot open 'c:\Users\a013.ENT\AppData\Local\Temp\skjgjrgp\CSC7E71C7AFEF934F0A8C83C9129E8BF2C1.TMP' for reading

1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeAnalysis\Microsoft.CodeAnalysis.targets(219,5): error MSB3758: An error has occurred during compilation. warning CS1668: Invalid search path 'Lib\um\x86' specified in 'LIB environment variable' -- 'The system cannot find the path specified. '

1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeAnalysis\Microsoft.CodeAnalysis.targets(219,5): error MSB3758: An error has occurred during compilation. error CS1583: 'c:\Users\a013.ENT\AppData\Local\Temp\skjgjrgp\CSC7E71C7AFEF934F0A8C83C9129E8BF2C1.TMP' is not a valid Win32 resource file

1>C:\Program Files (x86)\MSBuild\Microsoft\VisualStudio\v14.0\CodeAnalysis\Microsoft.CodeAnalysis.targets(219,5): error MSB4036: The "SetEnvironmentVariable" task was not found. Check the following: 1.) The name of the task in the project file is the same as the name of the task class. 2.) The task class is "public" and implements the Microsoft.Build.Framework.ITask interface. 3.) The task is correctly declared with in the project file, or in the *.tasks files located in the "C:\Program Files (x86)\MSBuild\14.0\bin" directory.

How do i get these include directives to work under visual studio 2017 ? (Linux project solution)

$
0
0

#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>

^^ it can't find the files for these. Whatever it is. It's underlined red. meaning it won't compile.

I know windows using winsocks and all. But if I'm coding for linux. I expected functionality for these, i mean cygwin provides the functionality so why can't visual studio.


How to create Console Application with "full" MFC support?

$
0
0

Hello,

I have a huge codebase, which is using a lot of MFC classes like CCriticalSection, originally developed for MFC GUI based application.

I need to create a Console Application, which should use some of this code.

When I create New Project Win32 Console, I am able to check the MFC Header option.

But, classes like CCriticalSection are still unknown.

What I have to do, to make such classes avaible ( I am talking only about non-gui classes!)

Do I need to add additional things in stdafx.h ?

Many thanks

Richard

How do I add C/C++ to Visual Studio 2015 Shell (Integrated)

$
0
0

Intel® Parallel Studio XE 2019 Update 1 Composer Edition for Fortran Windows* came with Visual Studio 2015 Shell (Integrated), which is now at Update 3.

Can I add C++ under the VS Shell?  If not, whats the best way to add Visual C++ that won't break my current setup?

I'm rebuilding a program compiled with Microsoft Visual Studio 9 (2008), so don't want to try gcc or something else.

Can't Use Alt Codes in MFC SDI Application with CMFCRibbonBar

$
0
0

i'm developing an application using MFC SDI.there is an issue here,
in the CMFCRibbonBar of running app when i used "alt key+code" in first time (for example Alt+0165 )it displays correctly (¥), but it's just for the first one and in the next times it doesn't appear any thing and no changes happen.my viewer drived from CRichEditView class.

Any soloutions will be greatly appreciated! 


Change mono/stereo audio accessibility setting via code.

$
0
0

I've been trying for more time than I'd like to admit now to set up a simple program that switches my default audio device between my headphones and my mono amplifier, just to automate this process without having to navigate through windows. I've managed to find a neat little program that switches the default audio device but I can't figure out how to change the accessibility setting via code to make it work outside of the Settings App. I've tried messing around with the registries and then forcing a WM_SETTINGCHANGE message, but that didn't work either. I'm running out of options and I'm pretty new to this stuff. (actually trying to make said program is what brought me here and made me install Visual Studio in the first place)

So the question would be: Does anyone know how to do it?

How to add category, panel and command to CMFCRibbonBar in the code?

$
0
0

I am trying to create a ribbon bar in our application which uses CMFCToolBar, so that the user can switch between menu/toolbar interface and ribbon iterface. The switch is working despite the fact that there is only one command without any icon added in the ribbon.

The ribbon bar is created using ribbon editor, but I could not add icons to the commands, the image index is always -1.

Is there any other ways to create the ribbon? Is it possible to add items into the ribbon in the code instead of ribbon editor? So that I can set the icon for each command using existing resources.

Thanks in advance.

ApiValidator (10.0.17763.0) Fails for function ImageGetCertificateData

$
0
0

Hi,

In my driver development I am trying to build a UWP driver. In my code I was using "ImageGetCertificateData" function to validate the certificate signature. But this function is failing at ApiValidation phase. 

"D:\Vamsee\TestDriver.sln" (Clean;Build target) (1) ->
"D:\Vamsee\TestDriver.vcxproj.metaproj" (default target) (3:3) ->
"D:\Vamsee\TestDriver.vcxproj" (default target) (5:3) ->
(ApiValidator target) ->
  ApiValidation : error : TestDriver.dll has unsupported API call to "imagehlp.dll!ImageGetCertificateData" [C:\TestDriver\TestDriver.vcxproj]
  ApiValidation : error : TestDriver.dll has unsupported API call to "imagehlp.dll!ImageGetCertificateHeader" [C:\TestDriver\TestDriver.vcxproj]
  c:\nice_tools\EWDK\Program Files\Windows Kits\10\build\WindowsDriver.common.targets(1783,5): error MSB3721: The command ""c:\Program Files\Windows Kits\10\bin\10.0.17763.0\x64\ApiValidator.exe" -DriverPackagePath:x64\x64
\Release\\OutDirUwp\TestDriver.dll -SupportedApiXmlFiles:"c:\Program Files\Windows Kits\10\build
\universalDDIs\x64\UniversalDDIs.xml" -ModuleWhiteListXmlFiles:"c:\Program Files\Windows Kits\10\build\
universalDDIs\x64\ModuleWhiteList.xml" -ApiExtractorExePath:"c:\Program Files\Windows Kits\10\bin\10.0.
17763.0\x64"" exited with code -1. [D:\Vamsee\TestDriver.vcxproj]

Could you please let me know the similar UWP API for validating the certificate.

Thanks in advance,

Vamsee

get_responseXML returns an empty object

$
0
0
I am coding a simple application which will consume RSS feeds. The aplication uses WinInet to connect & retrieve the RSS Feed, then it will create a DOM document to extract information out of it.

Although I have come up with code that does what I want, I have found that for some RSS feeds it will fail by creating an DOM document wich is empty... this is a little test app I created to ilustrate the issue:

#import "msxml3.dll"  
using namespace MSXML2;     // For Msxml3.dll.  
 
#include "stdio.h"
#include "tchar.h"  
#include <regex>  
 
using namespace std;  
using namespace std::tr1;
#define URL_SIZE            2048  
#define TITLE_SIZE          1024
#define DILBERT_RSS_FEED    "http://www.stickfigurehamlet.com/stickfigurehamlet.rss"   
//#define DILBERT_RSS_FEED    "http://www.phdcomics.com/gradfeed_justcomics.php"   
//#define DILBERT_RSS_FEED    "http://feedproxy.google.com/DilbertDailyStrip"  
 
//#pragma comment(lib, "rpcrt4")  
 
HRESULT __fastcall UnicodeToAnsi(LPCOLESTR pszW, LPSTR* ppszA)  
{  
 
    ULONG cbAnsi, cCharacters;  
    DWORD dwError;  
 
    // If input is null then just return the same.  
    if (pszW == NULL)  
    {  
        *ppszA = NULL;  
        return NOERROR;  
    }  
 
    cCharacters = wcslen(pszW)+1;  
    // Determine number of bytes to be allocated for ANSI string. An  
    // ANSI string can have at most 2 bytes per character (for Double  
    // Byte Character Strings.)  
    cbAnsi = cCharacters*2;  
 
    // Use of the OLE allocator is not required because the resultant  
    // ANSI  string will never be passed to another COM component. You  
    // can use your own allocator.  
    *ppszA = (LPSTR) CoTaskMemAlloc(cbAnsi);  
    if (NULL == *ppszA)  
        return E_OUTOFMEMORY;  
 
    // Convert to ANSI.  
    if (0 == WideCharToMultiByte(CP_ACP, 0, pszW, cCharacters, *ppszA,  
                  cbAnsi, NULL, NULL))  
    {  
        dwError = GetLastError();  
        CoTaskMemFree(*ppszA);  
        *ppszA = NULL;  
        return HRESULT_FROM_WIN32(dwError);  
    }  
      
    return NOERROR;  
}  
 
 
HRESULT __fastcall AnsiToUnicode(LPCSTR pszA, LPWSTR* ppszW)  
{  
    ULONG cCharacters;  
    DWORD dwError;  
 
    // If input is null then just return the same.  
    if (NULL == pszA)  
    {  
        *ppszW = NULL;  
        return NOERROR;  
    }  
 
    // Determine number of wide characters to be allocated for the  
    // Unicode string.  
    cCharacters =  strlen(pszA)+1;  
 
    // Use of the OLE allocator is required if the resultant Unicode  
    // string will be passed to another COM component and if that  
    // component will free it. Otherwise you can use your own allocator.  
    *ppszW = (LPOLESTR) CoTaskMemAlloc(cCharacters*2);  
    if (NULL == *ppszW)  
        return E_OUTOFMEMORY;  
 
    // Covert to Unicode.  
    if (0 == MultiByteToWideChar(CP_ACP, 0, pszA, cCharacters, *ppszW, cCharacters))  
    {  
        dwError = GetLastError();  
        CoTaskMemFree(*ppszW);  
        *ppszW = NULL;  
        return HRESULT_FROM_WIN32(dwError);  
    }  
 
    return NOERROR;  
}  
 
void dump_com_error(_com_error &e)  
{  
    printf("Error\n");  
    printf("\a\tCode = %08lx\n", e.Error());  
    printf("\a\tCode meaning = %s", e.ErrorMessage());  
    _bstr_t bstrSource(e.Source());  
    _bstr_t bstrDescription(e.Description());  
    printf("\a\tSource = %s\n", (LPCSTR) bstrSource);  
    printf("\a\tDescription = %s\n", (LPCSTR) bstrDescription);  
}  
 
int main()  
{  
    HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED);  
    if (hr != S_OK)  
        return 0;  
 
    bool encounteredError = false;  
 
    IXMLHTTPRequestPtr pXMLHTTPReq = NULL;  
    MSXML2::IXMLDOMDocumentPtr pXMLDocPtr = NULL;  
    MSXML2::IXMLDOMNodeListPtr pItemNodeList = NULL;  
    MSXML2::IXMLDOMElementPtr pItemElement = NULL;  
      
    try 
    {  
        // Create an XMLHTTPRequest object to request the feed  
        hr = pXMLHTTPReq.CreateInstance(__uuidof(MSXML2::XMLHTTP30));  
        if (FAILED(hr))  
            throw hr;  
          
        // open the request  
        hr = pXMLHTTPReq->open(_bstr_t(_T("GET")), _bstr_t(DILBERT_RSS_FEED), _variant_t(VARIANT_TRUE));  
        //hr = pXMLHTTPReq->open(_bstr_t(_T("GET")), _bstr_t(DILBERT_RSS_FEED), _variant_t(VARIANT_FALSE));  
        if (FAILED(hr))  
            throw hr;  
          
        // Set the headers  
        hr = pXMLHTTPReq->setRequestHeader(_bstr_t(_T("charset")), _bstr_t(_T("UTF-8")));  
        if (FAILED(hr))  
            throw hr;  
          
        // Send the request  
        hr = pXMLHTTPReq->send(NULL);  
        if (FAILED(hr))  
            throw hr;  
 
        long readyState = READYSTATE_UNINITIALIZED;       
        MSG msg;          
        while (readyState != READYSTATE_COMPLETE)  
        {  
            // Without this message pump, readyState does not change.  
            if (PeekMessage(&msg, 0, 0 ,0, PM_REMOVE))  
            {  
            TranslateMessage(&msg);  
            DispatchMessage(&msg);  
            }  
 
            readyState = pXMLHTTPReq->GetreadyState();  
        }  
                  
        long nStatus = 0;  
        hr = pXMLHTTPReq->get_status(&nStatus);  
        if (FAILED(hr))  
            throw hr;  
 
        // Process the feed if the response was received successfully  
        if (nStatus == 200)  
        {  
            // Retrieve the RSS XML DOM Document to process the RSS   
            // Feed results and extract the comic strip's images info  
              
            // Retrieve the XML DOM Document from the response  
            BSTR bstrString = NULL;  
            hr = pXMLHTTPReq->get_responseText(&bstrString);  
            printf("Response Body:\r\n%S\r\n", bstrString);  
 
            hr = pXMLHTTPReq->get_responseXML((IDispatch **) &pXMLDocPtr);  
            if (FAILED(hr))  
                throw hr;  
 
            BSTR bstrXMLDoc = NULL;  
            pXMLDocPtr->get_text(&bstrXMLDoc);  
            printf("XML Response:\r\n%S\r\n", bstrXMLDoc);  
              
            // Retrieve the list of "item" elements  
            pItemNodeList = pXMLDocPtr->getElementsByTagName(_bstr_t(_T("item")));  
            if (FAILED(pItemNodeList))  
                throw hr;  
              
            //Here, if we're in error pDomNode is NULL  
            if (pItemNodeList != NULL)  
            {  
                long nItems = 0;  
                hr = pItemNodeList->get_length(&nItems);  
                if (FAILED(hr))  
                    throw hr;  
 
                for (int i = 0; (i < (int)nItems) && (encounteredError == false); i++)  
                {  
                    WCHAR rssTitle[TITLE_SIZE];  
                    WCHAR rssLink[URL_SIZE];  
                    WCHAR rssComicURL[URL_SIZE];  
                    WCHAR rssComicFileName[MAX_PATH+1];  
                                          
                    // Retrieve the ith item element  
                    pItemElement = pItemNodeList->item[i];  
                    if (pItemElement != NULL)  
                    {  
                        // Retrieve the title text  
                        _tcscpy_s(rssTitle, pItemElement->firstChild->text);  
 
                        // Retrieve the link element  
                        MSXML2::IXMLDOMNodeListPtr pLinkNodes = NULL;  
                        MSXML2::IXMLDOMElementPtr pLinkElement = NULL;  
 
                        pLinkNodes = pItemElement->getElementsByTagName(_T("link"));  
                        if (pLinkNodes != NULL)  
                        {  
                            long nLinkElements = 0;  
                            hr = pLinkNodes->get_length(&nLinkElements);  
                            if (FAILED(hr))  
                                throw hr;  
 
                            if (nLinkElements == 1)  
                            {  
                                pLinkElement = pLinkNodes->item[0];  
 
                                // Retrieve the link  
                                if (pLinkElement != NULL)  
                                    _tcscpy_s(rssLink, pLinkElement->text);  
                            }  
                        }  
 
                        // Retrieve the description element  
                        MSXML2::IXMLDOMNodeListPtr pSummaryNodes = NULL;  
                        MSXML2::IXMLDOMElementPtr pSummaryElement = NULL;  
 
                        pSummaryNodes = pItemElement->getElementsByTagName(_bstr_t(_T("description")));  
                        if (pSummaryNodes != NULL)  
                        {  
                            long nSummaryElements = 0;  
                            hr = pSummaryNodes->get_length(&nSummaryElements);  
                            if (FAILED(hr))  
                                throw hr;  
 
                            if (nSummaryElements == 1)  
                            {  
                                pSummaryElement = pSummaryNodes->item[0];  
 
                                // Retrieve the description  
                                if (pSummaryElement != NULL)  
                                {  
                                    LPSTR szRssSummary;  
                                    CHAR szRssComicURL[MAX_PATH+1];  
                                    UnicodeToAnsi(pSummaryElement->text, &szRssSummary);  
 
                                    // Retrieve the image URL  
                                    const regex imageurl("\\b(https?|ftp)://([-a-zA-Z0-9.]+)(/[-a-zA-Z0-9+&@#/%=~_|!:,.;]*)?(gif|png|jpg)");  
                                    cmatch matches;  
 
                                    if (regex_search(szRssSummary, matches, imageurl))  
                                    {  
                                        strcpy_s(szRssComicURL, matches[0].str().c_str());
#ifdef _UNICODE  
                                        LPWSTR pszRssComicURL;  
                                        AnsiToUnicode(szRssComicURL, &pszRssComicURL);  
                                        _tcscpy_s(rssComicURL, URL_SIZE, pszRssComicURL);
#else  
                                        _tcscpy_s(rssComicURL, URL_SIZE, matches[0].str().c_str());
#endif  
                                    }  
                                    else 
                                    {  
                                        _tcscpy_s(rssComicURL, URL_SIZE, _T("Not found"));  
                                    }  
                                      
                                    //const regex imageFileName("\\b(https?|ftp)://([-a-zA-Z0-9.]+)(/[-a-zA-Z0-9+&@#/%=~_|!:,.;]*)?(gif|png|jpg)");  
                                    const regex imageFileName("[\\w_.-]*?(?=\\?)|[\\w_.-]*$");  
                                    if (regex_search(szRssComicURL, matches, imageFileName))  
                                    {
#ifdef _UNICODE  
                                        LPWSTR pszImageFileName;  
                                        AnsiToUnicode(matches[0].str().c_str(), &pszImageFileName);  
                                        _tcscpy_s(rssComicFileName, MAX_PATH+1, pszImageFileName);
#else  
                                        _tcscpy_s(rssComicFileName, MAX_PATH+1, matches[0].str().c_str());
#endif  
                                    }  
                                    else 
                                    {  
                                        _tcscpy_s(rssComicFileName, MAX_PATH+1, _T("Not found"));  
                                    }  
                                }  
                            }  
                        }  
                    }  
                    else 
                    {  
                        encounteredError = true;  
                    }  
                }  
                encounteredError = false;  
            }  
            else 
            {  
                encounteredError = true;  
            }  
        }  
        else 
        {  
            encounteredError = true;  
            //cout << "Error selecting XML single node" ;  
        }  
    }  
    catch(_com_error &e)  
    {  
        bool encounteredError = true;  
        dump_com_error(e);  
    }  
 
    return 0;  
}  
 
 
If I run it for http://feedproxy.google.com/DilbertDailyStrip it would retrieve & parse the feed without problems... but for http://www.stickfigurehamlet.com/stickfigurehamlet.rss the call to get_responseXML and then pXMLDocPtr->get_text(&bstrXMLDoc) will result in an empty string... although the call to pXMLHTTPReq->get_responseText(&bstrString) does retrive the response (XML document).

I can not spot the problem with my code... any ideas?

Download samples links not working in the Windows Dev Center

$
0
0

The code samples associated with this article https://docs.microsoft.com/en-us/windows/desktop/learnwin32/simple-drawing-sample appears to be unavailable for download. Same as any other sample download links in these tutorial series.

Is there any way to get these code samples? Thanks.

What is the equivalent in the manifest for the Override DPI scaling "Application" on Windows 10?

$
0
0

I have a multimonitor, full screen application that gets the screen resolution using

setSize( sf::Vector2u(
    GetSystemMetrics( SM_CXVIRTUALSCREEN ),  GetSystemMetrics( SM_CYVIRTUALSCREEN ) ) );

The application should ignore the system DPI settings and return not scaled screens resolutions

When I set the "Override high DPI scaling" in the file properties under Compatibility tab to "Application" the app ignores the DPI scaling of the screen and GetSystemMetrics returns the native resolution of the screen. When I set the dpiAware/dpiAwareness in the manifest the application crashes or returns wrong( scaled ) value of the native resolution of both screens. I've tried all possible combinations in the manifest, bt none seem to work.

So the question is How can I reproduce the behaviour of "Override high DPI scaling" = "Application" in the manifest?

This is my manifest:

<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" ><asmv3:application><asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"><dpiAware>true</dpiAware></asmv3:windowsSettings><asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings"><dpiAwareness>permonitorv2</dpiAwareness></asmv3:windowsSettings></asmv3:application></assembly>


Several Problems with VS Debugger

$
0
0

I have several problems with my VS debugger, I don't recall changing any relevant settings. The problems are:

-Applications do not close when I click on stop in the debugger, I can see an "inactive" process in the task manager and it can not be killed unless I close VS.

-pdb files are not loaded in release mode, even though they definitely exist and were loaded correctly before.

-Apps start extremely slow in the debugger, an app that takes 1-2 seconds to start normally can take minutes when debugged, even in release mode.

Any tips on how to fix it?

GDI+ problem with clipping using regions.

$
0
0

Hi

I've got code, which should do drawing clipping using regions. Regarding setting region code is very simple and typical taken from examples. Problem is when trying to draw clipped graphics, e.g. paths. When used simple syntax, like:

graphics.DrawPath(pen, path);

everything works, my drawing is clipped as should be. But trying to use more complicated method, like GraphicsPathIterator, then drawing is not visible, (is clipped completely)? e.g:

Gdiplus::GraphicsPath path;

pathIterator.Rewind();

while(0 != pathIterator.NextMarker(&path)) {
    graphics.DrawPath(pen, &path);
When not clipped code using path iterators draws fine.

ucrtbased.dll missing when debbugging

$
0
0

Hello, I have the VS 2017 installed with Desktop Development for C++ installed to run C code. When running the code I get the error message shown in the picture 

I have reinstalled VS and manually downloaded this dll and copied into SysWOW64 folder but nothing worked. What would it be?

Thank you for your time.

Viewing all 15302 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>