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

CreateFont / DeleteObject leaves font file locked on application exit

$
0
0

Hello,

I use the CreateFont/DeleteObject functions to load/create and release a custom font in my Win32 Application as follows:

hFont = CreateFont(fontHeight, 0, 0, 0, 0, 0, 0, 0, OEM_CHARSET, 0, CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, FIXED_PITCH, szFontName); ... if (hFont != NULL) { BOOL bResult = DeleteObject(hFont); hFont = NULL; if (!bResult) { throw new std::runtime_error("Cannot delete font"); } }

The DeleteObject correctly returns "1 = success", but even after the WinMain() of the application has ended and the application is terminated, the font file (in a subdirectory besides the .exe) remains locked and causes problem when the next build tries to overwrite it.

Do you have any ideas why or what I could do differently to fix this?

Best regards, Peter.


Connecting to a client program and retrieving a data string

$
0
0


Hi 

I have a VC++ code  (Application A which is a "dialog window" using MFC )  thatFindWindow a "window S" and then GetWindowText from it, then copies it on a CopyDataStruct and then SendMessage it to another window X....

The "window S" is on a network, running on window embedded OS,i believe it is a tcp client program.
The "Application A" is the code to find the window,get the text string in it and then send it to another window.

So basically i realize i need to write and add a server program to Application A so that the server program able to connect to the Window S and then let application A to find the window S on the network and retrieved the data from it. 

so basically i have Application A and SENSOR_B which i refer as window_S above.

Application A is a code to find the SENSOR_B window/process and get the data string from it.  

SENSOR_B have a IP address,login & password. 

DEVICE A need to connect to sensor B and get some data from it.

SENSOR_B which runs on windows embedded will have a dialog/process process running, referred a window_S above.

DEVICE A  will find the Dialog/process running in sensor B using Application A and then get the data as explain above.

so i already have the part of the code (Application A) to find and get the data of the sensor B, but as sensor is on a network, i need access sensor B through network and get the data. 

so my question to basically how to architect the software to access the sensor, what are usually concept
used to achieve this?? i think i need a write a server program to connect to the sensor B using it ip address
and its login credentials, and then start the application A software which should be able to find the process running in the 
sensor B.

i have no much info on sensor B, other than it runs on window embedded, i have its ip address, i know its login credentials
and i also have a program(application A) that will read the data of the sensor, i just dont have the server program?? how do start to think and write the server program...i just exepecting some hints tips and idea on moving forward with this limited infomation.....

CMFCToolBar backgroung color

$
0
0

Hi, 

I'm trying to change the background color of my toolbar.

class CMyToolBar : public CMFCToolBar{void OnFillBackground(CDC* pDC) ;};

voidCMyToolBar::OnFillBackground(CDC* pDC){CRect crect;this->GetClientRect(&crect);CDC *pdcCtrl = this->GetDC();CDC dcDst;dcDst.CreateCompatibleDC(pdcCtrl);dcDst.FillSolidRect(&crect,RGB(255,0,0));} The function is being called from CMFCToolBar::DoPaint(CDC* pDCPaint), but no color change.

Thanks,

Alex

Not creating exe file

$
0
0

I am a beginning C++ programming student. I'm doing my midterm exam, and the software isn't creating an exe file! It did it just fine for the first five projects! I'm still 48 hours away from deadline and my instructor may be able to help.

I am puzzled and frustrated. Any idea why the exe file isn't being created?

I hope I can find my way back here to find your suggestions. Thanks!

Win API to compare 2 directories

$
0
0
Hi All,
Is there an existing Win API which can be used to compare two different directories, find the extra files in destination directory and print them? Or if there is any other way. I am trying to compare folder contents based on file size and file name and print extra files in destination folder.

I tried to find out on internet, but could not find any relevant links.
Could you please help here?
Thanks in advance for your help!

How to get portable device windows path?

$
0
0
I am trying to open from my c++ application the folder location of the newly connected portable device.
The device when in opened in explorer, it is in "Computer/Xperia Z2". But when I try to use this directly or simply hardcoding this path, path was not found.

I was able to get

    dbcc_name = "\\\\?\\USB#VID_0FCE&PID_01AF#CB5A20JNTB#{6ac27878-a6fa-4155-ba85-f98f491d4f33}"
    Device Friendly Name = "Xperia Z2" 
Can you please help me get the file system location?

Filex.cpp line 117 -> Exception Unhandled

$
0
0

/////////////////////////////////////////////////////////////////////////////
// CFileException helpers

void __declspec(noreturn) AFXAPI AfxThrowFileException(int cause, LONG lOsError,
LPCTSTR lpszFileName /* == NULL */)
{
#ifdef _DEBUG
LPCSTR lpsz;
if (cause >= 0 && cause < _countof(rgszCFileExceptionCause))
lpsz = rgszCFileExceptionCause[cause];
else
lpsz = szUnknown;
TRACE(traceAppMsg, 0, _T("CFile exception: %hs, File %Ts, OS error information = %ld.\n"),
lpsz, (lpszFileName == NULL) ? _T("Unknown") : lpszFileName, lOsError);
#endif
THROW(new CFileException(cause, lOsError, lpszFileName));
}

Error -> Unhandled exception at 0x75D0FD62 in *.exe: Microsoft C++ exception: CFileException at memory location 0x0053F468.

Windows application - RDLC report - reportviewer 2015 - fonts showing blurry?

$
0
0
Hi,
Iam using VS2015. With my Windows Application, I have RDLC Report Viewed by ReportViewer 2015. Simply It's good in many system. But the fonts showing blurry with report Viewer only in one of my user system. So how to avoid this problem?

I try to setup Additional Manifest file for DPI_Aware, but no changes. I don't Know the mistakes...? Any guidances will be helpfuls
my Codes

<?xml version="1.0" encoding="utf-8"?><assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3"><asmv3:application  xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" ><asmv3:windowsSettings xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings"><dpiAware>true</dpiAware></asmv3:windowsSettings></asmv3:application></assembly>

Any helps & advices from superiors

Thanks Again



U.PARANTHAMAN


How can I paint an image in the caption bar?

$
0
0

Hi - I want to paint a small image in the caption bar of various windows, just to the left of the Close button on the right-hand side (these are all floating modeless dialogs in fact) in my (Visual C++ 2017, MFC) application.  I originally thought I'd just need to add a small paint in a handler for WM_NCPAINT.  That did not work - not on my PC, running Windows 10.   All paints have zero effect.  I then learned that since Vista and Aero, painting in the caption bar has got much more complicated.  It appears that I probably have to do something clever with the Desktop Window Manager (DWM) API.  I found this page: https://docs.microsoft.com/en-us/windows/win32/dwm/customframe (Custom Window Frame Using DWM), but was unable to follow the instructions (I couldn't work out what I was supposed to put in the handler for WM_NCCALCSIZE for example).  I also found an article called "Setting up a custom title bar on Vista/Windows 7" (https://delphihaven.wordpress.com/2010/04/19/setting-up-a-custom-titlebar/). The code in that case is Delphi.  I tried to work out how to do what they do in C++, but failed there too. 

Has anybody done this?  Added an image or an icon to the caption bar?  If so, could you give me some pointers?  Or best of all a working sample?

Many thanks

Simon



Simon



Easy way to find all string litterals in my C++ code?

$
0
0

I have a large C++ project (over 3k files weighing in at just under 40MB) and need to find all the strings in there that need localization (so I can take them out and put them in the strings database). Is there a way (using Visual C++ 2017 or some extension for it or something) to find all the string literals in my code so I can then scan the list to figure out the ones that need to be localized. Google shows up a few regexes but those pick up all the #include lines and comments and other things that have a " character in there which makes finding the actual literals too hard.

Is there a way to make VS (or some other tool) do what I want and show me just the string literals?

Manually sign PE file

$
0
0

I'm trying to manually sign the PE file. My problem is how to calculate the hash of the file.

I'm following This Document:

  1. Load the image header into memory.
  2. Initialize a hash algorithm context.
  3. Hash the image header from its base to immediately before the start of the checksum address, as specified in Optional Header Windows-Specific Fields.
  4. Skip over the checksum, which is a 4-byte field.
  5. Hash everything from the end of the checksum field to immediately before the start of the Certificate Table entry, as specified in Optional Header Data Directories.
  6. Get the Attribute Certificate Table address and size from the Certificate Table entry. For details, see section 5.7 of the PE/COFF specification.
  7. Exclude the Certificate Table entry from the calculation and hash everything from the end of the Certificate Table entry to the end of image header, including Section Table (headers).The Certificate Table entry is 8 bytes long, as specified iOptional Header Data Directories.
  8. Create a counter called SUM_OF_BYTES_HASHED, which is not part of the signature. Set this counter to the SizeOfHeaders field, as specified in Optional Header Windows-Specific Field.
  9. Build a temporary table of pointers to all of the section headers in the image. The NumberOfSections field of COFF File Header indicates how big the table should be. Do not include any section headers in the table whose SizeOfRawData field is zero.
  10. Using the PointerToRawData field (offset 20) in the referenced SectionHeader structure as a key, arrange the table's elements in ascending order. In other words, sort the section headers in ascending order according to the disk-file offset of the sections.
  11. Walk through the sorted table, load the corresponding section into memory, and hash the entire section. Use the SizeOfRawData field in the SectionHeader structure to determine the amount of data to hash.
  12. Add the section’s SizeOfRawData value to SUM_OF_BYTES_HASHED.
  13. Repeat steps 11 and 12 for all of the sections in the sorted table.
  14. Create a value called FILE_SIZE, which is not part of the signature. Set this value to the image’s file size, acquired from the underlying file system. If FILE_SIZE is greater than SUM_OF_BYTES_HASHED, the file contains extra data that must be added to the hash. This data begins at the SUM_OF_BYTES_HASHED file offset, and its length is: (File Size) – ((Size of AttributeCertificateTable) + SUM_OF_BYTES_HASHED) Note: The size of Attribute Certificate Table is specified in the second ULONG value in the Certificate Table entry (32 bit: offset 132, 64 bit: offset 148) in Optional Header Data Directories.
  15. Finalize the hash algorithm context. Note: This procedure uses offset values from the PE/COFF specification, version 8.1 . For authoritative offset values, refer to the most recent version of the PE/COFF specification.

The problem is that I don't seem to be able to calculate the hash correctly. Test executable: https://1drv.ms/u/s!Am577iDtOLPogs8zINbrCLWm7uTuBg?e=Y2VJPM , this is a plain message box produced with FASM so I have the minimum test executable.

According to the documentation file steps, I only have to exclude the 4 byte checksum (position 216 from the start), and the 8 byte certificate table entry (position 296, 8 bytes). However this doesn't seem to work. 

When I use signtool sign /f cert.p12 /p pwd /fd sha256 test1.exe, the hash of the file is calculated as such:

04 20 19 3d 7f a8 72 74   . .=.rt
15 ef 3f ff 84 81 7f e5   ..?....
02 64 fc 92 c5 a6 63 41   .d....cA
c6 ec 06 34 fb 29 42 37   ...4.)B7
cd e1   

with my tool, the hash is different.

04 20 c2 04 74 1d d0 d5   . ..t...
06 0e 92 46 9a ca 3b 9e   ...F..;.
db 37 2a 91 3c 4a bd 4c   .7*.<J.L
e9 6c d8 b5 2a 01 5e 50   .l..*.^P
70 ef  

So windows explorer tells me that my signature is invalid. 

What am I missing?


Michael


Script 'vsdevcmd\ext\Invalid'; could not be found while trying to compile Cython module

$
0
0

Hi,

I am having trouble compiling a simple hello world Cython module. Details:

OS - Windows 10

Visual Studio Version - 2017 (15.9.14)

Python details - Virtual environment in Anaconda (Python 3.6.8 |Anaconda, Inc.| (default, Feb 21 2019, 18:30:04) [MSC v.1916 64 bit (AMD64)] on win32)

Specifically I get the following error: 

(ssapy) c:\Users\joebox\Documents\projects\temp>cythonize -a -i hello_world.pyx
running build_ext
building 'hello_world' extension
creating c:\Users\joebox\Documents\projects\temp\tmpbdqyslnx\Release
creating c:\Users\joebox\Documents\projects\temp\tmpbdqyslnx\Release\Users
creating c:\Users\joebox\Documents\projects\temp\tmpbdqyslnx\Release\Users\joebox
creating c:\Users\joebox\Documents\projects\temp\tmpbdqyslnx\Release\Users\joebox\Documents
creating c:\Users\joebox\Documents\projects\temp\tmpbdqyslnx\Release\Users\joebox\Documents\projects
creating c:\Users\joebox\Documents\projects\temp\tmpbdqyslnx\Release\Users\joebox\Documents\projects\temp
cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Ic:\users\joebox\miniconda3\envs\ssapy\include -Ic:\users\joebox\miniconda3\envs\ssapy\include /Tcc:\Users\joebox\Documents\projects\temp\hello_world.c /Foc:\Users\joebox\Documents\projects\temp\tmpbdqyslnx\Release\Users\joebox\Documents\projects\temp\hello_world.obj
error: command 'cl.exe' failed: No such file or directory 

I tried adding `cl.exe` to path by adding the following directory to Path "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64". I also tried opening up Developer Command Prompt for VS 2017, but it opens with the following error:

[ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\Invalid" could not be found.
[ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. ***
[ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run
[ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details.
[ERROR:VsDevCmd.bat] Where [value] is:
[ERROR:VsDevCmd.bat]    1 : basic debug logging
[ERROR:VsDevCmd.bat]    2 : detailed debug logging
[ERROR:VsDevCmd.bat]    3 : trace level logging. Redirection of output to a file when using this level is recommended.
[ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3
[ERROR:VsDevCmd.bat]          vsdevcmd.bat > vsdevcmd.trace.txt 2>&1

When I open Developer Command Prompt for VS 2017 in Administrator mode and run using VSCMD_DEBUG=2, I get:

[DEBUG:VsDevCmd] Writing pre-initialization environment to C:\Users\joebox\AppData\Local\Temp\dd_vsdevcmd15_preinit_env.log
[DEBUG:VsDevCmd.bat] --------------------- VS Developer Command Prompt Environment [pre-init] ---------------------
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\joebox\AppData\Roaming
CommandPromptType=Native
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=DESKTOP-MN90951
ComSpec=C:\Windows\system32\cmd.exe
DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\
DriverData=C:\Windows\System32\Drivers\DriverData
ExtensionSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs
Framework40Version=v4.0
FrameworkDir=C:\Windows\Microsoft.NET\Framework\
FrameworkDIR32=C:\Windows\Microsoft.NET\Framework\
FrameworkVersion=v4.0.30319
FrameworkVersion32=v4.0.30319
HOMEDRIVE=C:
HOMEPATH=\Users\joebox
INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt
LIB=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\um\x86;
LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.16299.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.16299.0;C:\Windows\Microsoft.NET\Framework\v4.0.30319;
LOCALAPPDATA=C:\Users\joebox\AppData\Local
LOGONSERVER=\\DESKTOP-MN90951
MOZ_PLUGIN_PATH=C:\PROGRAM FILES (X86)\FOXIT SOFTWARE\FOXIT READER\plugins\
NUMBER_OF_PROCESSORS=4
OneDrive=C:\Users\joebox\OneDrive
OneDriveConsumer=C:\Users\joebox\OneDrive
OS=Windows_NT
Path=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Roslyn;C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\\MSBuild\15.0\bin;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\Git\cmd;C:\Users\joebox\Miniconda3\condabin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64;C:\Users\joebox\AppData\Local\Microsoft\WindowsApps;C:\Users\joebox\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\joebox\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 69 Stepping 1, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=4501
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC=C:\Users\Public
SynaProgDir=Synaptics\SynTP
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\joebox\AppData\Local\Temp
TMP=C:\Users\joebox\AppData\Local\Temp
UCRTVersion=10.0.16299.0
UniversalCRTSdkDir=C:\Program Files (x86)\Windows Kits\10\
USERDOMAIN=DESKTOP-MN90951
USERDOMAIN_ROAMINGPROFILE=DESKTOP-MN90951
USERNAME=joebox
USERPROFILE=C:\Users\joebox
VCIDEInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\
VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\
VCToolsInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\
VCToolsRedistDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.16.27012\
VCToolsVersion=14.16.27023
VisualStudioVersion=15.0
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\
VSCMD_ARG_app_plat=Desktop
VSCMD_ARG_HOST_ARCH=x86
VSCMD_ARG_TGT_ARCH=x86
VSCMD_DEBUG=2
VSCMD_VER=15.9.14
VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
windir=C:\Windows
WindowsLibPath=C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.16299.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.16299.0
WindowsSdkBinPath=C:\Program Files (x86)\Windows Kits\10\bin\
WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10\
WindowsSDKLibVersion=10.0.16299.0\
WindowsSdkVerBinPath=C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\
WindowsSDKVersion=10.0.16299.0\
__DOTNET_ADD_32BIT=1
__DOTNET_PREFERRED_BITNESS=32
__VSCMD_PREINIT_PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\Git\cmd;C:\Users\joebox\Miniconda3\condabin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64;C:\Users\joebox\AppData\Local\Microsoft\WindowsApps;C:\Users\joebox\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\joebox\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\
[DEBUG:VsDevCmd.bat] --------------------- VS Developer Command Prompt Environment [pre-init] ---------------------
[DEBUG:core\vsdevcmd_start] initializing with arguments ''
[DEBUG:core\parse_cmd.bat] initializaing with arguments ''
[DEBUG:parse_cmd] -no_ext :
[DEBUG:parse_cmd] -winsdk :
[DEBUG:parse_cmd] -app_platform :
[DEBUG:parse_cmd] -test   :
[DEBUG:parse_cmd] -help   :
[DEBUG:parse_cmd] -arch   :
[DEBUG:parse_cmd] -host_arch :
[DEBUG:parse_cmd] -vcvars_ver :
[DEBUG:parse_cmd] -startdir :
[DEBUG:vsdevcmd_start] Parsing results...
[DEBUG:vsdevcmd_start] -clean_env :
[DEBUG:vsdevcmd_start] -test      :
[DEBUG:vsdevcmd_start] -help      :
[DEBUG:vsdevcmd_start] end of script: VS150COMNTOOLS="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\"
[DEBUG:vsdevcmd_start] end of script: VSINSTALLDIR="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\"
[DEBUG:vsdevcmd_start] end of script: DevEnvDir="C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\"
[DEBUG:VsDevCmd.bat] Found version "15.9.14"
[DEBUG:VsDevCmd.bat] "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.isolation.ini" found. Setting VSCMD_VER="15.0".
**********************************************************************
** Visual Studio 2017 Developer Command Prompt v15.9.14
** Copyright (c) 2017 Microsoft Corporation
**********************************************************************
[DEBUG:VsDevCmd.bat] -clean_env :
[DEBUG:VsDevCmd.bat] -test :
[DEBUG:VsDevCmd.bat] VS150COMNTOOLS : "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\"
[DEBUG:VsDevCmd.bat] calling "core\dotnet.bat"
[vsdevcmd\core\dotnet.bat] initializing...
[DEBUG:core\dotnet.bat] Adding 32-bit .NET Framework Path
[DEBUG:core\dotnet.bat] Framework Preference: 32bit
[DEBUG:core\dotnet.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "core\msbuild.bat"
[DEBUG:core\msbuild.bat] initializing...
[DEBUG:core\msbuild.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "core\winsdk.bat"
[DEBUG:winsdk.bat] initializing...
[DEBUG:core\winsdk.bat] init:COMPLETE
[ERROR:VsDevCmd.bat] Script "vsdevcmd\ext\Invalid" could not be found.
[DEBUG:VsDevCmd.bat] calling "ext\netfxsdk.bat"
[DEBUG:ext\netfxsdk.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\roslyn.bat"
[DEBUG:ext\roslyn.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\team_explorer.bat"
[DEBUG:ext\team_explorer.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\testwindow.bat"
[DEBUG:ext\testwindow.bat] init:COMPLETE
[DEBUG:VsDevCmd.bat] calling "ext\vcvars.bat"
[DEBUG:vcvars.bat] VCToolsVersion = "14.16.27023"
[DEBUG:vcvars.bat] Checking architecture { host , tgt } : { x86 , x86 }
[DEBUG:vcvars.bat] Adding "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCPackages"
__VCVARS_REDIST_VERSION=14.16.27012
[DEBUG:vcvars.bat] Could not add directory to IFCPATH: "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ifc\x86"
[DEBUG:vcvars.bat] Adding "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86"
[DEBUG:ext\vcvars.bat] init:COMPLETE
[DEBUG:core\vsdevcmd_end] initializing with arguments ''
[ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. ***
[ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run
[ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details.
[ERROR:VsDevCmd.bat] Where [value] is:
[ERROR:VsDevCmd.bat]    1 : basic debug logging
[ERROR:VsDevCmd.bat]    2 : detailed debug logging
[ERROR:VsDevCmd.bat]    3 : trace level logging. Redirection of output to a file when using this level is recommended.
[ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3
[ERROR:VsDevCmd.bat]          vsdevcmd.bat > vsdevcmd.trace.txt 2>&1
[DEBUG:VsDevCmd] Writing post-execution environment to C:\Users\joebox\AppData\Local\Temp\dd_vsdevcmd15_env.log
[DEBUG:VsDevCmd.bat] --------------------- VS Developer Command Prompt Environment [post-init] ---------------------
ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\joebox\AppData\Roaming
CommandPromptType=Native
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=DESKTOP-MN90951
ComSpec=C:\Windows\system32\cmd.exe
DevEnvDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\
DriverData=C:\Windows\System32\Drivers\DriverData
ExtensionSdkDir=C:\Program Files (x86)\Microsoft SDKs\Windows Kits\10\ExtensionSDKs
Framework40Version=v4.0
FrameworkDir=C:\Windows\Microsoft.NET\Framework\
FrameworkDIR32=C:\Windows\Microsoft.NET\Framework\
FrameworkVersion=v4.0.30319
FrameworkVersion32=v4.0.30319
HOMEDRIVE=C:
HOMEPATH=\Users\joebox
INCLUDE=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\include;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\include;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\ucrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\shared;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\um;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\winrt;C:\Program Files (x86)\Windows Kits\10\include\10.0.16299.0\cppwinrt
LIB=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\um\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\ucrt\x86;C:\Program Files (x86)\Windows Kits\10\lib\10.0.16299.0\um\x86;
LIBPATH=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.16299.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.16299.0;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\ATLMFC\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\lib\x86\store\references;C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.16299.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.16299.0;C:\Windows\Microsoft.NET\Framework\v4.0.30319;
LOCALAPPDATA=C:\Users\joebox\AppData\Local
LOGONSERVER=\\DESKTOP-MN90951
MOZ_PLUGIN_PATH=C:\PROGRAM FILES (X86)\FOXIT SOFTWARE\FOXIT READER\plugins\
NUMBER_OF_PROCESSORS=4
OneDrive=C:\Users\joebox\OneDrive
OneDriveConsumer=C:\Users\joebox\OneDrive
OS=Windows_NT
Path=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Roslyn;C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\\MSBuild\15.0\bin;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\HostX86\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\VCPackages;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TestWindow;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\CommonExtensions\Microsoft\TeamFoundation\Team Explorer;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\15.0\bin\Roslyn;C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\x86;C:\Program Files (x86)\Windows Kits\10\bin\x86;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\\MSBuild\15.0\bin;C:\Windows\Microsoft.NET\Framework\v4.0.30319;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\Git\cmd;C:\Users\joebox\Miniconda3\condabin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64;C:\Users\joebox\AppData\Local\Microsoft\WindowsApps;C:\Users\joebox\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\joebox\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 69 Stepping 1, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=4501
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Program Files\WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules
PUBLIC=C:\Users\Public
SynaProgDir=Synaptics\SynTP
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Users\joebox\AppData\Local\Temp
TMP=C:\Users\joebox\AppData\Local\Temp
UCRTVersion=10.0.16299.0
UniversalCRTSdkDir=C:\Program Files (x86)\Windows Kits\10\
USERDOMAIN=DESKTOP-MN90951
USERDOMAIN_ROAMINGPROFILE=DESKTOP-MN90951
USERNAME=joebox
USERPROFILE=C:\Users\joebox
VCIDEInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\VC\
VCINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\
VCToolsInstallDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\
VCToolsRedistDir=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Redist\MSVC\14.16.27012\
VCToolsVersion=14.16.27023
VisualStudioVersion=15.0
VS140COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\Tools\
VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\
VSCMD_ARG_app_plat=Desktop
VSCMD_ARG_HOST_ARCH=x86
VSCMD_ARG_TGT_ARCH=x86
VSCMD_DEBUG=2
VSCMD_VER=15.9.14
VSINSTALLDIR=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\
windir=C:\Windows
WindowsLibPath=C:\Program Files (x86)\Windows Kits\10\UnionMetadata\10.0.16299.0;C:\Program Files (x86)\Windows Kits\10\References\10.0.16299.0
WindowsSdkBinPath=C:\Program Files (x86)\Windows Kits\10\bin\
WindowsSdkDir=C:\Program Files (x86)\Windows Kits\10\
WindowsSDKLibVersion=10.0.16299.0\
WindowsSdkVerBinPath=C:\Program Files (x86)\Windows Kits\10\bin\10.0.16299.0\
WindowsSDKVersion=10.0.16299.0\
__DOTNET_ADD_32BIT=1
__DOTNET_PREFERRED_BITNESS=32
__VSCMD_PREINIT_PATH=C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Strawberry\c\bin;C:\Strawberry\perl\site\bin;C:\Strawberry\perl\bin;C:\Program Files\Git\cmd;C:\Users\joebox\Miniconda3\condabin;C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.16.27023\bin\Hostx64\x64;C:\Users\joebox\AppData\Local\Microsoft\WindowsApps;C:\Users\joebox\AppData\Local\Programs\Microsoft VS Code\bin;C:\Users\joebox\AppData\Local\Programs\MiKTeX 2.9\miktex\bin\x64\
__VSCMD_PREINIT_VCToolsVersion=14.16.27023
__VSCMD_PREINIT_VS150COMNTOOLS=C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\
[DEBUG:VsDevCmd.bat] --------------------- VS Developer Command Prompt Environment [post-init] ---------------------

My questions are:

1) What is the foolproof way to develop Cython packages in Windows 10, using Python 3.6? What are the visual studio versions/packages I should install?

2) Does the Developer Command Prompt for VS 2017 error affecting Cython compilation?

Thank you for your time!!

Check the CheckBox through the code

$
0
0

Hi Team,

I have the CheckBox in my MFC Application and want to check it through the code by getting the input from field bool IsManual.

if(IsManual)

    Check the CheckBox

else

UnCheck the Checkbox

Please help me and if possible please given me an example.Thank you

Regards,

SenthilAndavan

Output file is missing

$
0
0

The following code, extracted from a larger program, seems to work correctly. But there is no sign of the output file anywhere.

Can anyone see what needs to be changed to cure this problem?

C++ PROGRAM:

char *in_filename ;
char *out_filename ;

// The in_filename and the out_filename have the command arguments as their values:
// "C:\Storage\JGW\Research\Dev\2018plus\LANGS\LANG1\LANG1\Debug\in\gr1.txt"
// "C:\Storage\JGW\Research\Dev\2018plus\LANGS\LANG1\LANG1\Debug\out\o_gr1.txt"

ifstream ifile("in_filename",ios::ate); // Leaving off the quote marks leads to an assertion failure.

// The input part of the larger program seems to work correctly.
// But there is no sign of the output file anywhere when the program exits.

ofstream ofile("out_filename",ios::ate); // Leaving off the quote marks leads to an assertion failure.

ofile.open(out_filename) ;
if(ofile.is_open() == false)
    abort_run("Unable to open output file.\n") ;

// Test message

ofile << "Test message." ;
ofile.close();
exit(0) ;


GerryWolff

The same program doesn't compile on Windows when using algorithm header

$
0
0
 

I'm learning C++.

I have written a program that compiles find on Ubuntu 18.04.2, but it doesn't on Windows 7 64 bits.

To compile on Windows I'm using Visual Studio:

Microsoft Visual Studio Enterprise 2017  Version 15.9.12
VisualStudio.15.Release/15.9.12+28307.665
 
Visual C++ 2017   00369-90013-89248-AA631 <br/>
Microsoft Visual C++ 2017

The errors I get are the following (when I add the `algorithm` header):

    c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\algorithm(5367): error C2988: unrecognizable template declaration/definition
    c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\algorithm(5367): error C2059: syntax error: '<parameter-list>'
    c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\algorithm(5369): error C2143: syntax error: missing ';' before '{'
    c:\program files (x86)\microsoft visual studio\2017\enterprise\vc\tools\msvc\14.16.27023\include\algorithm(5369): error C2447: '{': missing function header (old-style formal list?)

When I double click on the first error, it goes to the third line of this piece of code:

           // FUNCTION TEMPLATE max
    template<class _Ty,
        class _Pr>
        _NODISCARD constexpr const _Ty& (max)(const _Ty& _Left, const _Ty& _Right, _Pr _Pred)
            _NOEXCEPT_COND(_NOEXCEPT_OPER(_DEBUG_LT_PRED(_Pred, _Left, _Right)))
        {    // return larger of _Left and _Right using _Pred
        return (_DEBUG_LT_PRED(_Pred, _Left, _Right) ? _Right : _Left);
        }



And my code, that needs `algorithm` header (because I'm using std::find) is in the following method:

#include <algorithm>
#include <utility>
#include <cmath>
#include <cstdlib>
#include <fstream>
#include <iostream>
#include <limits>
#include <sstream>
#include <string>
#include <utility>
#include <vector>

std::string ConvertToAStarMap::TruncateMap(const std::string& robot_map)
{
    std::string truncatedMap;

    std::vector<std::pair<int, int>> list;

    int current_x = 0;
    int current_y = 0;

    std::vector<std::string> map_cells = ConvertToAStarMap::split(robot_map, ';');

    for (std::vector<std::string>::iterator it = map_cells.begin(); it != map_cells.end(); ++it)
    {
        std::vector<std::string> locations = ConvertToAStarMap::split(*it, ',');

        double x = std::stod(locations[0]);
        double y = std::stod(locations[1]);

        if (x < 0)
            current_x = static_cast<int>(std::trunc(x));
        else
            current_x = static_cast<int>(std::trunc(x + 1));

        if (y < 0)
            current_y = static_cast<int>(std::trunc(y));
        else
            current_y = static_cast<int>(std::trunc(y + 1));

        std::pair<int, int> current = std::make_pair(current_x, current_y);

        if (std::find(list.begin(), list.end(), current) != list.end())
        {
            list.push_back(current);

            truncatedMap += std::to_string(current_x) + ",";
            truncatedMap += std::to_string(current_y) + ";";
        }
    }

    return truncatedMap;
}



How can fix this error?


IDispEventSimpleImpl class gives only a few messages on the OnNewEvent function instead of a stream of messages

$
0
0

I am trying to develop a C++ application in VS2019 that needs to load an external COM object. I create a class CReport as follows:

class CReport : public IDispEventSimpleImpl<0, CReport, & DIID__IBrokerEvents>

I define two _ATL_FUNC_INFO, define the SINK_MAP inside the class and link with the __stdcall functions. Now, I apply DispEventAdvise and I get only a few messages and then my program terminates... If however I send the DispEventAdvise message twice, I get the stream of messages that I want but with a Debug Assertion Failure, with the message being __atl_condVal. The terminal shows however the full stream of data. If I hit ignore once or twice, then the program crashes...

Change Integrity level in current process (UIAccess)

$
0
0

I have an app that for some of the time needs to run with high integrity (UIAccess = true)

For the rest of the time I'd like to lower the integrity level to the default (medium)

I have tried the following but it does not work.

    hProcess = GetCurrentProcess();
    if (OpenProcessToken(hProcess, TOKEN_ADJUST_PRIVILEGES | TOKEN_ADJUST_GROUPS | TOKEN_QUERY, &hToken))
    {
        PSID pSidIL = NULL;
        //INFO on SID: https://support.microsoft.com/en-us/kb/243330?wa=wsignin1.0
        ConvertStringSidToSid(L"S-1-16-12288", &pSidIL);

        TOKEN_GROUPS tg = { 0 };

        tg.GroupCount = 1;
        tg.Groups[0].Attributes = SE_GROUP_INTEGRITY;
        tg.Groups[0].Sid = pSidIL;

        AdjustTokenGroups(hToken, FALSE, &tg, sizeof(TOKEN_GROUPS) + GetSidLengthRequired(1), NULL, NULL);
        DWORD error = GetLastError();
    }

Any ideas please?


Michael Tissington

SVML support for Clang-cl

$
0
0

How to enable SVML support for the program compiled using clang-cl?

I am using clang-cl to compile the source code which involves "sinf" and "cosf" operation. I need to use SVML for this operation.
I have added the flags as mentioned below for compilation but it doesn't use SVML functions. I have also linked svml_dsip.lib during compilation.

'clang-cl /clang:-fveclib=SVML /clang:-fvectorize /clang:-mfpmath=sse /clang:-msse2 /clang:-fno-math-errno'
I am using VS2017 for this.

Can anyone tell me how to use SVML in clang-cl?

Note the same code when I compiled using MSVC (vs2019) the sinf and cosf function linked to svml_sse4_ssinf4.asm file? Is there any way to do this w.r.t clang-cl

How to set the Runtime Library to /MT on Command line with msbuild

$
0
0

Hi,

I met a problem, could you help me?

I want to change the /MDd to /MT on command line with msbuild, what I did was this:

msbuild MyProj.vcxproj /property:RuntimeLibrary=MT

But it didn't work, what I saw it still showed /MDd under the CLCompile

ClCompile:
  C:\Program Files\Microsoft Visual Studio 11.0\VC\bin\CL.exe /c /ZI /nologo /W
  3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _UNICODE /D UNICODE /Gm /EH
  sc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Yc"stdafx.h"

Is there other way to change the Runtime Library value on command line with msbuild?

error c0000417 when loading msvcr90.dll for an exe loaded via a network path but works from local PC.

$
0
0

hi,

i've got a client that has an issue that i can't reproduce on my inhouse setup.

when they install our application on a server disc and try to run it from a client PC, the application doesn't start. the event viewer report image to follow when my account gets verified!

but when they install and run on the client PC, it works OK.

what  tools are available to aid diagnosing and fixing this issue?

TIA

K



Viewing all 15302 articles
Browse latest View live


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