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

how to get the Handle to the dialog box that contains the control. ?

$
0
0
this is my question , 

I use MFC dialog in MS VC++6.0




GetModuleFileNameExW return incorrect path for 32-bit processes

$
0
0

I am using the following code to locate kernel32.dll in a 32-bit process.

The following code is compiled as x64.

	auto process = OpenProcess(PROCESS_VM_READ | PROCESS_QUERY_INFORMATION, FALSE, 24108);
	DWORD neededBytes;
	auto res = EnumProcessModulesEx(process, nullptr, 0, &neededBytes, LIST_MODULES_32BIT);
	auto modules = new HMODULE[neededBytes / sizeof HMODULE];
	res = EnumProcessModulesEx(process, modules, neededBytes, &neededBytes, LIST_MODULES_32BIT);
	WCHAR name[256]{0};
	DWORD i;
	for (i=0; i < neededBytes / sizeof HMODULE; ++i)
	{
		GetModuleBaseNameW(process, modules[i], name, sizeof name / sizeof WCHAR);
		if (_wcsicmp(L"kernel32.dll", name) == 0)
		{
			GetModuleFileNameExW(process, modules[i], name, sizeof name / sizeof WCHAR);
			wprintf(L"%s\n\n", name);
			break;
		}
	}
        CloseHandle(process);

The output is

C:\Windows\System32\kernel32.dll

But it is supposed to be

C:\Windows\SysWOW64\kernel32.dll
This code used to work on Windows 7 but is now broken when it is run on Windows 10. How do I get a fix?

No message in IDE Output window

$
0
0
I'm not sure when this started happening, but recently I've noticed that I get none of the usual messages in the VS2005 (SP1 ) Output window when debugging an application.  Normally I expect to see messages about dlls being loaded, first-chance exceptions, trace statements from OutputDebugString.  Now: absolutely nothing.

Just tried a sanity check with a VM and all the messages are there, so presumably it's a configuration option that I've inadvertantly changed on the problem system.  Trouble is, having searched through all pages of the Tools->Options dialogue, I can't see anything sounds like it will fix the problem.

Please can someone give me a clue!

Thanks,
Ian

lvalue vs rvalue

$
0
0
I was going through the terms lvalue and rvalue. I read some articles but still fail to grasp the concepts. Could someone please explain in simple terms(if possible) what rvalue and lvalue mean?

Boot Trigger Task not creating with users or local service account

$
0
0

i downloaded example from microsoft below i have attached its taken from microsoft as exact copy

/********************************************************************
 This sample schedules a task to start Notepad.exe 30 seconds after
 the system is started. 
********************************************************************/

#define _WIN32_DCOM

#include <windows.h>
#include <iostream>
#include <stdio.h>
#include <comdef.h>
//  Include the task header file.
#include <taskschd.h>
#pragma comment(lib, "taskschd.lib")
#pragma comment(lib, "comsupp.lib")


using namespace std;

int __cdecl wmain()
{
    //  ------------------------------------------------------
    //  Initialize COM.
    HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
    if( FAILED(hr) )
    {
        printf("\nCoInitializeEx failed: %x", hr );
        return 1;
    }

    //  Set general COM security levels.
    hr = CoInitializeSecurity(
        NULL,
        -1,
        NULL,
        NULL,
        RPC_C_AUTHN_LEVEL_PKT_PRIVACY,
        RPC_C_IMP_LEVEL_IMPERSONATE,
        NULL,
        0,
        NULL);

    if( FAILED(hr) )
    {
        printf("\nCoInitializeSecurity failed: %x", hr );
        CoUninitialize();
        return 1;
    }

    //  ------------------------------------------------------
    //  Create a name for the task.
    LPCWSTR wszTaskName = L"Boot Trigger Test Task";

    //  Get the Windows directory and set the path to Notepad.exe.
    wstring wstrExecutablePath = _wgetenv( L"WINDIR");
    wstrExecutablePath += L"\\SYSTEM32\\NOTEPAD.EXE";


    //  ------------------------------------------------------
    //  Create an instance of the Task Service. 
    ITaskService *pService = NULL;
    hr = CoCreateInstance( CLSID_TaskScheduler,
                           NULL,
                           CLSCTX_INPROC_SERVER,
                           IID_ITaskService,
                           (void**)&pService );  
    if (FAILED(hr))
    {
          printf("Failed to create an instance of ITaskService: %x", hr);
          CoUninitialize();
          return 1;
    }
        
    //  Connect to the task service.
    hr = pService->Connect(_variant_t(), _variant_t(),
        _variant_t(), _variant_t());
    if( FAILED(hr) )
    {
        printf("ITaskService::Connect failed: %x", hr );
        pService->Release();
        CoUninitialize();
        return 1;
    }

    //  ------------------------------------------------------
    //  Get the pointer to the root task folder.  
    //  This folder will hold the new task that is registered.
    ITaskFolder *pRootFolder = NULL;
    hr = pService->GetFolder( _bstr_t( L"\\") , &pRootFolder );
    if( FAILED(hr) )
    {
        printf("Cannot get Root Folder pointer: %x", hr );
        pService->Release();
        CoUninitialize();
        return 1;
    }
    
    //  If the same task exists, remove it.
    pRootFolder->DeleteTask( _bstr_t( wszTaskName), 0  );
    
    //  Create the task builder object to create the task.
    ITaskDefinition *pTask = NULL;
    hr = pService->NewTask( 0, &pTask );

    pService->Release();  // COM clean up.  Pointer is no longer used.
    if (FAILED(hr))
    {
          printf("Failed to create a task definition: %x", hr);
          pRootFolder->Release();
          CoUninitialize();
          return 1;
    }
    
        
    //  ------------------------------------------------------
    //  Get the registration info for setting the identification.
    IRegistrationInfo *pRegInfo= NULL;
    hr = pTask->get_RegistrationInfo( &pRegInfo );
    if( FAILED(hr) )
    {
        printf("\nCannot get identification pointer: %x", hr );
        pRootFolder->Release();
        pTask->Release();
        CoUninitialize();
        return 1;
    }
    
    hr = pRegInfo->put_Author(L"Author Name");
    pRegInfo->Release();
    if( FAILED(hr) )
    {
        printf("\nCannot put identification info: %x", hr );
        pRootFolder->Release();
        pTask->Release();
        CoUninitialize();
        return 1;
    }

    //  ------------------------------------------------------
    //  Create the settings for the task
    ITaskSettings *pSettings = NULL;
    hr = pTask->get_Settings( &pSettings );
    if( FAILED(hr) )
    {
        printf("\nCannot get settings pointer: %x", hr );
        pRootFolder->Release();
        pTask->Release();
        CoUninitialize();
        return 1;
    }
    
    //  Set setting values for the task. 
    hr = pSettings->put_StartWhenAvailable(VARIANT_TRUE);
    pSettings->Release();
    if( FAILED(hr) )
    {
        printf("\nCannot put setting info: %x", hr );
        pRootFolder->Release();
        pTask->Release();
        CoUninitialize();
        return 1;
    }
       

    //  ------------------------------------------------------
    //  Get the trigger collection to insert the boot trigger.
    ITriggerCollection *pTriggerCollection = NULL;
    hr = pTask->get_Triggers( &pTriggerCollection );
    if( FAILED(hr) )
    {
        printf("\nCannot get trigger collection: %x", hr );
        pRootFolder->Release();
        pTask->Release();
        CoUninitialize();
        return 1;
    }

    //  Add the boot trigger to the task.
    ITrigger *pTrigger = NULL;
    hr = pTriggerCollection->Create( TASK_TRIGGER_BOOT, &pTrigger ); 
    pTriggerCollection->Release();
    if( FAILED(hr) )
    {
        printf("\nCannot create the trigger: %x", hr );
        pRootFolder->Release();
        pTask->Release();
        CoUninitialize();
        return 1;
    }
    
    IBootTrigger *pBootTrigger = NULL;
    hr = pTrigger->QueryInterface( 
        IID_IBootTrigger, (void**) &pBootTrigger );
    pTrigger->Release();
    if( FAILED(hr) )
    {
        printf("\nQueryInterface call failed for IBootTrigger: %x", hr );
        pRootFolder->Release();
        pTask->Release();
        CoUninitialize();
        return 1;
    }

    hr = pBootTrigger->put_Id( _bstr_t( L"Trigger1" ) );
    if( FAILED(hr) )
       printf("\nCannot put the trigger ID: %x", hr);
    
    //  Set the task to start at a certain time. The time 
    //  format should be YYYY-MM-DDTHH:MM:SS(+-)(timezone).
    //  For example, the start boundary below
    //  is January 1st 2005 at 12:05
    hr = pBootTrigger->put_StartBoundary( _bstr_t(L"2005-01-01T12:05:00") );
    if( FAILED(hr) )
       printf("\nCannot put the start boundary: %x", hr);
  
    hr = pBootTrigger->put_EndBoundary( _bstr_t(L"2015-05-02T08:00:00") );
    if( FAILED(hr) )
       printf("\nCannot put the end boundary: %x", hr);

    // Delay the task to start 30 seconds after system start. 
    hr = pBootTrigger->put_Delay( L"PT30S" );
    pBootTrigger->Release();
    if( FAILED(hr) )
    {
        printf("\nCannot put delay for boot trigger: %x", hr );
        pRootFolder->Release();
        pTask->Release();
        CoUninitialize();
        return 1;
    } 
       

    //  ------------------------------------------------------
    //  Add an Action to the task. This task will execute Notepad.exe.     
    IActionCollection *pActionCollection = NULL;

    //  Get the task action collection pointer.
    hr = pTask->get_Actions( &pActionCollection );
    if( FAILED(hr) )
    {
        printf("\nCannot get Task collection pointer: %x", hr );
        pRootFolder->Release();
        pTask->Release();
        CoUninitialize();
        return 1;
    }
        
    //  Create the action, specifying it as an executable action.
    IAction *pAction = NULL;
    hr = pActionCollection->Create( TASK_ACTION_EXEC, &pAction );
    pActionCollection->Release();
    if( FAILED(hr) )
    {
        printf("\nCannot create the action: %x", hr );
        pRootFolder->Release();
        pTask->Release();
        CoUninitialize();
        return 1;
    }

    IExecAction *pExecAction = NULL;
    //  QI for the executable task pointer.
    hr = pAction->QueryInterface( 
        IID_IExecAction, (void**) &pExecAction );
    pAction->Release();
    if( FAILED(hr) )
    {
        printf("\nQueryInterface call failed for IExecAction: %x", hr );
        pRootFolder->Release();
        pTask->Release();
        CoUninitialize();
        return 1;
    }

    //  Set the path of the executable to Notepad.exe.
    hr = pExecAction->put_Path( _bstr_t( wstrExecutablePath.c_str() ) ); 
    pExecAction->Release(); 
    if( FAILED(hr) )
    {
        printf("\nCannot set path of executable: %x", hr );
        pRootFolder->Release();
        pTask->Release();
        CoUninitialize();
        return 1;
    }
      
    
    //  ------------------------------------------------------
    //  Save the task in the root folder.
    IRegisteredTask *pRegisteredTask = NULL;
    VARIANT varPassword;
    varPassword.vt = VT_EMPTY;
    hr = pRootFolder->RegisterTaskDefinition(
            _bstr_t( wszTaskName ),
            pTask,
            TASK_CREATE_OR_UPDATE, 
            _variant_t(L"Local Service"), 
            varPassword, 
            TASK_LOGON_SERVICE_ACCOUNT,
            _variant_t(L""),
            &pRegisteredTask);
    if( FAILED(hr) )
    {
        printf("\nError saving the Task : %x", hr );
        pRootFolder->Release();
        pTask->Release();
        CoUninitialize();
        return 1;
    }
    
    printf("\n Success! Task successfully registered. " );

    //  Clean up.
    pRootFolder->Release();
    pTask->Release();
    pRegisteredTask->Release();
    CoUninitialize();
    return 0;
}

Now the issue i am facing is that i can't create this task or when a users Login (At Log on of any user)its clearly mentioned for LogOn i need to be an admin to create the task.

But there is nothing mentioned like that for boot trigger.

can someone plese guide why only time trigger works fine but for boot trigger or login trigger i need to be an admin as i gt error General access denied

Though i can esily create a task both for login and boot from task scheduler without running it as an administrator

but for it to create it in visual studio i need to run it as an admin otherwise it gives general access denied error

Task not running if not in Idle state

$
0
0

i have created a ask with taskchd lib and unchecked stop if computer ceases to be idle setting but still the task that ws missed to run at the specific time is not running

in settings i have checked run task as soon as possible if task is missed.

all of this is done with c++ code and then checked in settings of taskscheduler below is the code

#pragma warning( disable : 4996)
#pragma comment(linker, "/SUBSYSTEM:windows /ENTRY:mainCRTStartup")

#define _WIN32_DCOM

#include <windows.h>
#include <iostream>
#include <stdio.h>
#include <comdef.h>
#include <wincred.h>
//  Include the task header file.
#include <taskschd.h>
#pragma comment(lib, "taskschd.lib")
#pragma comment(lib, "comsupp.lib")
#pragma comment(lib, "credui.lib")

using namespace std;


int main()
{
	//  ------------------------------------------------------
	//  Initialize COM.
	HRESULT hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
	if (FAILED(hr))
	{
		printf("\nCoInitializeEx failed: %x", hr);
		return 1;
	}

	//  Set general COM security levels.
	hr = CoInitializeSecurity(
		NULL,
		-1,
		NULL,
		NULL,
		RPC_C_AUTHN_LEVEL_PKT_PRIVACY,
		RPC_C_IMP_LEVEL_IMPERSONATE,
		NULL,
		0,
		NULL);

	if (FAILED(hr))
	{
		printf("\nCoInitializeSecurity failed: %x", hr);
		CoUninitialize();
		return 1;
	}

	//  ------------------------------------------------------
	//  Create a name for the task.
	LPCWSTR wszTaskName = L"Testing123Task";

	//  Get the windows directory and set the path to notepad.exe.
	wstring wstrExecutablePath = _wgetenv(L"WINDIR");
	wstrExecutablePath += L"\\SYSTEM32\\NOTEPAD.EXE";


	//  ------------------------------------------------------
	//  Create an instance of the Task Service. 
	ITaskService *pService = NULL;
	hr = CoCreateInstance(CLSID_TaskScheduler,
		NULL,
		CLSCTX_INPROC_SERVER,
		IID_ITaskService,
		(void**)&pService);
	if (FAILED(hr))
	{
		printf("Failed to create an instance of ITaskService: %x", hr);
		CoUninitialize();
		return 1;
	}

	//  Connect to the task service.
	hr = pService->Connect(_variant_t(), _variant_t(),
		_variant_t(), _variant_t());
	if (FAILED(hr))
	{
		printf("ITaskService::Connect failed: %x", hr);
		pService->Release();
		CoUninitialize();
		return 1;
	}

	//  ------------------------------------------------------
	//  Get the pointer to the root task folder.  This folder will hold the
	//  new task that is registered.
	ITaskFolder *pRootFolder = NULL;
	hr = pService->GetFolder(_bstr_t(L"\\"), &pRootFolder);
	if (FAILED(hr))
	{
		printf("Cannot get Root folder pointer: %x", hr);
		pService->Release();
		CoUninitialize();
		return 1;
	}

	//  If the same task exists, remove it.
	pRootFolder->DeleteTask(_bstr_t(wszTaskName), 0);

	//  Create the task definition object to create the task.
	ITaskDefinition *pTask = NULL;
	hr = pService->NewTask(0, &pTask);

	pService->Release();  // COM clean up.  Pointer is no longer used.
	if (FAILED(hr))
	{
		printf("Failed to CoCreate an instance of the TaskService class: %x", hr);
		pRootFolder->Release();
		CoUninitialize();
		return 1;
	}

	//  ------------------------------------------------------
	//  Get the registration info for setting the identification.
	IRegistrationInfo *pRegInfo = NULL;
	hr = pTask->get_RegistrationInfo(&pRegInfo);
	if (FAILED(hr))
	{
		printf("\nCannot get identification pointer: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}

	hr = pRegInfo->put_Author(L"Author Name");
	pRegInfo->Release();
	if (FAILED(hr))
	{
		printf("\nCannot put identification info: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}

	//  ------------------------------------------------------
	//  Create the principal for the task - these credentials
	//  are overwritten with the credentials passed to RegisterTaskDefinition
	IPrincipal *pPrincipal = NULL;
	hr = pTask->get_Principal(&pPrincipal);
	if (FAILED(hr))
	{
		printf("\nCannot get principal pointer: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}
	//hr = pPrincipal->put_RunLevel(TASK_RUNLEVEL_HIGHEST);

	//  Set up principal logon type to interactive logon
	hr = pPrincipal->put_LogonType(TASK_LOGON_INTERACTIVE_TOKEN);
	pPrincipal->Release();
	if (FAILED(hr))
	{
		printf("\nCannot put principal info: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}

	//  ------------------------------------------------------
	//  Create the settings for the task
	ITaskSettings *pSettings = NULL;
	hr = pTask->get_Settings(&pSettings);
	if (FAILED(hr))
	{
		printf("\nCannot get settings pointer: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}

	//  Set setting values for the task.  
	hr = pSettings->put_StartWhenAvailable(VARIANT_TRUE);
	pSettings->Release();
	if (FAILED(hr))
	{
		printf("\nCannot put setting information: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}
	// Set the idle settings for the task.
	IIdleSettings *pIdleSettings = NULL;
	hr = pSettings->get_IdleSettings(&pIdleSettings);
	if (FAILED(hr))
	{
		printf("\nCannot get idle setting information: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}
	pSettings->put_RunOnlyIfIdle(VARIANT_FALSE);
	pSettings->put_StartWhenAvailable(VARIANT_TRUE);
	pSettings->put_Enabled(VARIANT_TRUE);
//	pSettings->put_IdleSettings(VARIANT_TRUE);
	pSettings->put_DisallowStartIfOnBatteries(VARIANT_FALSE);
	pSettings->put_StopIfGoingOnBatteries(VARIANT_FALSE);
	//pSettings->put_ExecutionTimeLimit(_bstr_t(L"PT0S"));
	hr = pIdleSettings->put_WaitTimeout(L"PT0S");
	hr = pIdleSettings->put_StopOnIdleEnd(VARIANT_FALSE);

	pIdleSettings->Release();
	if (FAILED(hr))
	{
		printf("\nCannot put idle setting information: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}


	//  ------------------------------------------------------
	//  Get the trigger collection to insert the time trigger.
	ITriggerCollection *pTriggerCollection = NULL;
	hr = pTask->get_Triggers(&pTriggerCollection);
	if (FAILED(hr))
	{
		printf("\nCannot get trigger collection: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}

	//  Add the time trigger to the task.
	ITrigger *pTrigger = NULL;
	hr = pTriggerCollection->Create(TASK_TRIGGER_WEEKLY, &pTrigger);
	pTriggerCollection->Release();
	if (FAILED(hr))
	{
		printf("\nCannot create the trigger: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}

	IWeeklyTrigger *pWeeklyTrigger = NULL;
	hr = pTrigger->QueryInterface(
		IID_IWeeklyTrigger, (void**)&pWeeklyTrigger);
	pTrigger->Release();
	if (FAILED(hr))
	{
		printf("\nQueryInterface call for IWeeklyTrigger failed: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 0;
	}

	hr = pWeeklyTrigger->put_Id(_bstr_t(L"Trigger1"));
	if (FAILED(hr))
		printf("\nCannot put trigger ID: %x", hr);

	//  Set the task to start weekly at a certain time. The time 
	//  format should be YYYY-MM-DDTHH:MM:SS(+-)(timezone).
	//  For example, the start boundary below is January 1st 2005 at
	//  12:05
	hr = pWeeklyTrigger->put_StartBoundary(_bstr_t(L"2020-03-09T10:10:00"));
	if (FAILED(hr))
		printf("\nCannot put the start boundary: %x", hr);

	//  Set the time when the trigger is deactivated.
	hr = pWeeklyTrigger->put_EndBoundary(_bstr_t(L"2050-01-01T12:05:00"));
	if (FAILED(hr))
		printf("\nCannot put the end boundary: %x", hr);


	//  Define the interval for the weekly trigger. 
	//  An interval of 2 produces an
	//  every other week schedule
	hr = pWeeklyTrigger->put_WeeksInterval((short)2);
	if (FAILED(hr))
	{
		printf("\nCannot put weeks interval: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}

	hr = pWeeklyTrigger->put_DaysOfWeek((short)2);    // Runs on Monday
	pWeeklyTrigger->Release();
	if (FAILED(hr))
	{
		printf("\nCannot put days of week interval: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}


	//  ------------------------------------------------------
	//  Add an action to the task. This task will execute notepad.exe.     
	IActionCollection *pActionCollection = NULL;

	//  Get the task action collection pointer.
	hr = pTask->get_Actions(&pActionCollection);
	if (FAILED(hr))
	{
		printf("\nCannot get Task collection pointer: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}

	//  Create the action, specifying that it is an executable action.
	IAction *pAction = NULL;
	hr = pActionCollection->Create(TASK_ACTION_EXEC, &pAction);
	pActionCollection->Release();
	if (FAILED(hr))
	{
		printf("\nCannot create the action: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}

	IExecAction *pExecAction = NULL;
	//  QI for the executable task pointer.
	hr = pAction->QueryInterface(
		IID_IExecAction, (void**)&pExecAction);
	pAction->Release();
	if (FAILED(hr))
	{
		printf("\nQueryInterface call failed for IExecAction: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}

	//  Set the path of the executable to notepad.exe.
	hr = pExecAction->put_Path(_bstr_t(wstrExecutablePath.c_str()));
	pExecAction->Release();
	if (FAILED(hr))
	{
		printf("\nCannot put action path: %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}

	//  ------------------------------------------------------
	//  Save the task in the root folder.
	IRegisteredTask *pRegisteredTask = NULL;
	hr = pRootFolder->RegisterTaskDefinition(
		_bstr_t(wszTaskName),
		pTask,
		TASK_CREATE_OR_UPDATE,
		_variant_t(),
		_variant_t(),
		TASK_LOGON_INTERACTIVE_TOKEN,
		_variant_t(L""),&pRegisteredTask);
	if (FAILED(hr))
	{
		printf("\nError saving the Task : %x", hr);
		pRootFolder->Release();
		pTask->Release();
		CoUninitialize();
		return 1;
	}

	printf("\n Success! Task successfully registered. ");

	//  Clean up.
	pRootFolder->Release();
	pTask->Release();
	pRegisteredTask->Release();
	CoUninitialize();
	return 0;
}

How to create a Task with Mutiple triggers in c++

$
0
0

i am using Taskchd lib and i am unable to declare two triggers for one task.is there any specific way of doing that?i didn't get any example on microsoft site for creating a task with multiple trigger though they mentioned its possible to create a task with mutiple triggers.

if any one knows or has any example please share or guide

How to set an image to a button in a ribbon using MFC VC++ ?

$
0
0
 I am changing the look of my CMFCRibbonBar. I want to add icon to its button, so i added my png images as resources and gave them IDs, but i can't seem to connect them to buttons.

I added this code to my CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) function:

CButton *pButton = (CButton *)GetDlgItem(m_Print);
if (pButton && pButton->GetSafeHwnd())
{
    pButton->SetIcon((HICON)LoadImage(AfxGetApp()->m_hInstance,
        MAKEINTRESOURCE(IDB_Print),
        IMAGE_ICON, 32, 32, LR_DEFAULTCOLOR));
}
pButton = (CButton *)GetDlgItem(m_SaveSett);
if (pButton && pButton->GetSafeHwnd())
{
    pButton->SetIcon((HICON)LoadImage(AfxGetApp()->m_hInstance,
        MAKEINTRESOURCE(IDB_SaveSettings),
        IMAGE_BITMAP, 32, 32, LR_COLOR));
}

Getting error with multibyte character code C++

$
0
0
cannot get it to work with multi byte character set
its working fine with unicode
i tried but wasn't able to convert it to multibye
This is the error i am getting
Hide   Copy Code

DWORD dwResult = GetLogicalDriveStrings(MAX_PATH, text); // text = szLogicalDrives on this line i am getting cannot convert from wchar_t* to LPSTR UINT nDriveType = GetDriveType(szSingleDrive); on this line i am getting cannot convert WCHAR to LPCSTR

this is the code below


Hide   Copy Code
DWORD dwResult = GetLogicalDriveStrings(MAX_PATH, text); // text = szLogicalDrives
on this line i am getting cannot convert from wchar_t* to LPSTR

UINT nDriveType = GetDriveType(szSingleDrive);
on this line i am getting cannot convert WCHAR to LPCSTR

Could not compile Wrapper C++/CLI project

$
0
0

Hi,

I am working on a C++/CLI project which generates dll to be used in .net project. The CLI project also uses dll from unmanaged C++. I added import library (.lib) from unmanaged C++, but it fails with following log. I am out of ideas what is going wrong.

1>------ Build started: Project: Wrapper, Configuration: Debug x64 ------
1>Comp.cpp
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\minwinbase.h(104,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\minwinbase.h(104,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\minwinbase.h(105,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\minwinbase.h(105,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\minwinbase.h(106,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\minwinbase.h(106,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\minwinbase.h(121,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\minwinbase.h(121,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\minwinbase.h(122,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\minwinbase.h(122,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\minwinbase.h(123,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\minwinbase.h(123,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(51,24): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(51,24): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(52,24): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(52,24): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(172,24): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(172,24): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(584,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(584,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(585,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(585,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(586,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(586,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(637,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(637,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(638,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(638,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(639,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(639,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(964,24): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(964,24): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(1163,28): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(1163,28): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(1164,28): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(1164,28): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(1165,28): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\fileapi.h(1165,28): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winbase.h(2377,26): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winbase.h(2377,26): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\timezoneapi.h(84,24): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\timezoneapi.h(84,24): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\timezoneapi.h(224,24): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\timezoneapi.h(224,24): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\timezoneapi.h(236,19): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\timezoneapi.h(236,19): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\rpcasync.h(291,18): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\rpcasync.h(291,18): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\shellapi.h(1611,132): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\shellapi.h(1611,132): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\shellapi.h(1612,133): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\shellapi.h(1612,133): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(2328,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(2328,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(2329,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(2329,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(2368,25): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(2368,25): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(2383,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(2383,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(2384,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(2384,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(2494,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(2494,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(2495,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(2495,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(3895,25): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(3895,25): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(3896,25): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(3896,25): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(5284,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(5284,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(5673,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(5673,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(5691,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(5691,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(5692,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(5692,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(5712,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(5712,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(6924,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(6924,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(7000,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(7000,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(7792,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(7792,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(7823,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(7823,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(17364,21): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(17364,21): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(17365,21): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(17365,21): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(17366,21): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(17366,21): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(17392,21): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(17392,21): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(17408,21): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(17408,21): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(17431,41): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(17431,41): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(21358,33): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\wincrypt.h(21358,33): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(712,15): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(712,15): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(731,15): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(731,15): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(775,16): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(775,16): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(787,16): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(787,16): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(802,16): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(802,16): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(814,16): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(814,16): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(3558,22): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(3558,22): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(3565,22): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(3565,22): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(3607,38): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(3607,38): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(3617,38): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\winspool.h(3617,38): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2218,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2218,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2219,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2219,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2220,14): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2220,14): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2296,44): error C2872: 'STATSTG': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2226,8): message : could be 'tagSTATSTG STATSTG'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2296,44): message : or       'System::Runtime::InteropServices::STATSTG'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\combaseapi.h(1465,25): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\combaseapi.h(1465,25): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(8520,29): error C2872: 'BIND_OPTS': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(8436,7): message : could be 'tagBIND_OPTS BIND_OPTS'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(8520,29): message : or       'System::Runtime::InteropServices::BIND_OPTS'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(8524,32): error C2872: 'BIND_OPTS': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(8436,7): message : could be 'tagBIND_OPTS BIND_OPTS'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(8524,32): message : or       'System::Runtime::InteropServices::BIND_OPTS'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(9007,43): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(9007,43): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(9011,45): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(9011,45): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(9430,45): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(9430,45): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(9845,58): error C2872: 'STATSTG': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2226,8): message : could be 'tagSTATSTG STATSTG'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(9845,58): message : or       'System::Runtime::InteropServices::STATSTG'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(9942,89): error C2872: 'STATSTG': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2226,8): message : could be 'tagSTATSTG STATSTG'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(9942,89): message : or       'System::Runtime::InteropServices::STATSTG'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(10058,61): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(10058,61): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(10059,61): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(10059,61): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(10060,61): error C2872: 'FILETIME': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\shared\minwindef.h(274,3): message : could be '_FILETIME FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(10060,61): message : or       'System::Runtime::InteropServices::FILETIME'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(10070,44): error C2872: 'STATSTG': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2226,8): message : could be 'tagSTATSTG STATSTG'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(10070,44): message : or       'System::Runtime::InteropServices::STATSTG'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(10665,44): error C2872: 'STATSTG': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2226,8): message : could be 'tagSTATSTG STATSTG'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(10665,44): message : or       'System::Runtime::InteropServices::STATSTG'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(14712,21): error C2872: 'BIND_OPTS': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(8436,7): message : could be 'tagBIND_OPTS BIND_OPTS'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(14712,21): message : or       'System::Runtime::InteropServices::BIND_OPTS'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(14722,24): error C2872: 'BIND_OPTS': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(8436,7): message : could be 'tagBIND_OPTS BIND_OPTS'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(14722,24): message : or       'System::Runtime::InteropServices::BIND_OPTS'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(14793,50): error C2872: 'STATSTG': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2226,8): message : could be 'tagSTATSTG STATSTG'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(14793,50): message : or       'System::Runtime::InteropServices::STATSTG'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(14801,89): error C2872: 'STATSTG': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidlbase.h(2226,8): message : could be 'tagSTATSTG STATSTG'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\objidl.h(14801,89): message : or       'System::Runtime::InteropServices::STATSTG'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(657,14): error C2872: 'TYPEDESC': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(653,8): message : could be 'tagTYPEDESC TYPEDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(657,14): message : or       'System::Runtime::InteropServices::TYPEDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(724,14): error C2872: 'TYPEDESC': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(653,8): message : could be 'tagTYPEDESC TYPEDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(724,14): message : or       'System::Runtime::InteropServices::TYPEDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(726,17): error C2872: 'IDLDESC': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(698,8): message : could be 'tagIDLDESC IDLDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(726,17): message : or       'System::Runtime::InteropServices::IDLDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(727,19): error C2872: 'PARAMDESC': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(674,8): message : could be 'tagPARAMDESC PARAMDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(727,19): message : or       'System::Runtime::InteropServices::PARAMDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(742,14): error C2872: 'TYPEKIND': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(641,8): message : could be 'tagTYPEKIND TYPEKIND'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(742,14): message : or       'System::Runtime::InteropServices::TYPEKIND'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(751,14): error C2872: 'TYPEDESC': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(653,8): message : could be 'tagTYPEDESC TYPEDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(751,14): message : or       'System::Runtime::InteropServices::TYPEDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(752,13): error C2872: 'IDLDESC': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(698,8): message : could be 'tagIDLDESC IDLDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(752,13): message : or       'System::Runtime::InteropServices::IDLDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(837,30): error C2872: 'ELEMDESC': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(729,3): message : could be 'tagELEMDESC ELEMDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(837,30): message : or       'System::Runtime::InteropServices::ELEMDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(838,14): error C2872: 'FUNCKIND': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(822,8): message : could be 'tagFUNCKIND FUNCKIND'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(838,14): message : or       'System::Runtime::InteropServices::FUNCKIND'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(839,16): error C2872: 'INVOKEKIND': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(831,8): message : could be 'tagINVOKEKIND INVOKEKIND'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(839,16): message : or       'System::Runtime::InteropServices::INVOKEKIND'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(840,14): error C2872: 'CALLCONV': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(812,8): message : could be 'tagCALLCONV CALLCONV'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(840,14): message : or       'System::Runtime::InteropServices::CALLCONV'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(845,14): error C2872: 'ELEMDESC': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(729,3): message : could be 'tagELEMDESC ELEMDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(845,14): message : or       'System::Runtime::InteropServices::ELEMDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(877,14): error C2872: 'ELEMDESC': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(729,3): message : could be 'tagELEMDESC ELEMDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(877,14): message : or       'System::Runtime::InteropServices::ELEMDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(1021,33): error C2872: 'FUNCDESC': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(847,8): message : could be 'tagFUNCDESC FUNCDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(1021,33): message : or       'System::Runtime::InteropServices::FUNCDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(1040,32): error C2872: 'VARDESC': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(880,8): message : could be 'tagVARDESC VARDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(1040,32): message : or       'System::Runtime::InteropServices::VARDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(1054,33): error C2872: 'TYPEDESC': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(653,8): message : could be 'tagTYPEDESC TYPEDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(1054,33): message : or       'System::Runtime::InteropServices::TYPEDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(1087,32): error C2872: 'IDLDESC': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(698,8): message : could be 'tagIDLDESC IDLDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(1087,32): message : or       'System::Runtime::InteropServices::IDLDESC'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(1353,35): error C2872: 'INVOKEKIND': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(831,8): message : could be 'tagINVOKEKIND INVOKEKIND'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(1353,35): message : or       'System::Runtime::InteropServices::INVOKEKIND'
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(1785,33): error C2872: 'TYPEKIND': ambiguous symbol
1>C:\Program Files (x86)\Windows Kits\10\Include\10.0.18362.0\um\oaidl.h(1785,33): fatal error C1003: error count exceeds 100; stopping compilation
1>Generating Code...
1>Done building project "Wrapper.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========


C1189 error :( Please help me

$
0
0

BłądC1189 #error:  The <experimental/filesystem> header providing std::experimental::filesystem is deprecated by Microsoft and will be REMOVED. It is superseded by the C++17 <filesystem> header providing std::filesystem. You can define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING to acknowledge that you have received this warning.stickrpg_pD:\visual studio\VC\Tools\MSVC\14.24.28314\include\experimental\filesystem30

That is the error code Im getting, can someone help me? I would appreciate that thx! <3

How can I link a LIB against DLL, see error LNK2038 RuntimeLibrary symbol

$
0
0
Hi everyone, I am facing a probem, I need generate a dll project, and also I need to import an static library. but doing so I'm getting LNK2038 linker error. 

After a research I find it's due to some symbols MSVC defines in order to take care about prevent the linking of incompatible code, which can cause run-time errors or other unexpected behavior.

I would like to know if it possible to include a LIB into DLL file, or I need the DLL version of the LIB.


How to get WM_PAINT to fire at the time I need?

$
0
0
Hello. I develop Win32 C++ application using Visual Studio 2017 Community. The main task of the application is to triangulate a set of points and draw a triangulation mesh. I need to draw a triangulation mesh already after the application window is displayed and the user clicks on "Triangulation Start" button located on the toolbar. In a specially defined thread, the coordinates of the edges of the triangles that make up the triangulation mesh are formed. A special GetEdgeCoords() function collects the values ​​of these coordinates (for each edge, the coordinates of its starting and ending points are taken). Then, the coordinates of each edge are placed in concurrent_queu. I planned to poll this concurrent_queu in WM_PAINT and get the coordinates from concurrent_queu and draw edges on them using Graphics.DrawLine from GDI+. But I did not succeed because WM_PAINT is launched only once - when the application loads. Therefore, I simply cannot canonically use the WM_PAINT message to draw a triangulation grid. Therefore, I have a question. How to get WM_PAINT to start at the right time? Namely, when the GetEdgeCoords() function finds the coordinates of the next edge that needs to be drawn. Edges in triangulation can be a very large number. Say, for example, 10,000. Functions GetEdgeCoords() and WndProc() are in different threads. Can this be done? Thanks in advance.

Building Empty UTF-8 Multi Byte Static Library?

$
0
0

Hi Folks:

   Developing on Win 10 Pro, Visual Studio 2019 Community, upgraded today. 

   It's been a few months since I last built a new static library.  When I created one last night the option to make an empty library, where I could just build, or copy, all of the code by hand, was missing.  The option to build pre-compiled headers was also missing, but I use pre-compiled headers, which seem to be the default. 

   Once the project was created I couldn't find the line to select the character set, which I believe was in the in the project property's General or C/C++ page.   

   How do I create an empty static library, and how do I create a project that uses the multi-byte UTF-8 character set?

      Thanks
      Larry


Extend or Create Pagefile.sys in C++ WITHOUT reboot

$
0
0

Hello,

I am working about change pagefile.sys size in c++ and without reboot.

I did this with SendingMessages to buttons (c:\windows\syswow64\SystemPropertiesPerformance.exe) but this is not very cool way. (This method or manuelly open SystemPropertiesPerformance.exe and change size doesn't require to reboot. Because pagefile size extending not creating. I want this in c++)

I am searching i found some function i think i need to use them but i couldn't. These functions i found;

NtExtendSection

NtCreateSection

bHere is my code, extendSection func returns -1073741788

#include <iostream>
#include <Windows.h>
#include <Psapi.h>

#pragma comment(lib, "ntdll")
#pragma comment (lib, "wintrust")
#pragma comment (lib, "Psapi")
typedef struct _UNICODE_STRING {
    USHORT Length;
    USHORT MaximumLength;
    PWSTR  Buffer;
} UNICODE_STRING, * PUNICODE_STRING;
typedef struct _OBJECT_ATTRIBUTES
{
    ULONG Length;
    PVOID RootDirectory;
    PUNICODE_STRING ObjectName;
    ULONG Attributes;
    PVOID SecurityDescriptor;
    PVOID SecurityQualityOfService;
} OBJECT_ATTRIBUTES, * POBJECT_ATTRIBUTES;

/*NTSTATUS
ZwQuerySystemInformation(
    SYSTEM_INFORMATION_CLASS SystemInformationClass,
    PVOID SystemInformation,
    ULONG SystemInformationLength,
    ULONG* ReturnLength);*/
NTSYSAPI
NTSTATUS
NTAPI
NtCreateSection(
    OUT PHANDLE             SectionHandle,
    IN ULONG                DesiredAccess,
    IN POBJECT_ATTRIBUTES   ObjectAttributes OPTIONAL,
    IN PLARGE_INTEGER       MaximumSize OPTIONAL,
    IN ULONG                PageAttributess,
    IN ULONG                SectionAttributes,
    IN HANDLE               FileHandle OPTIONAL);
/*NTSTATUS
NtCreatePagingFile(
    PUNICODE_STRING PageFileName,
    PLARGE_INTEGER MinimumSize,
    PLARGE_INTEGER MaximumSize,
    ULONG Flags);*/
NTSYSAPI NTSTATUS ZwCreateSection(
    PHANDLE            SectionHandle,
    ACCESS_MASK        DesiredAccess,
    POBJECT_ATTRIBUTES ObjectAttributes,
    PLARGE_INTEGER     MaximumSize,
    ULONG              SectionPageProtection,
    ULONG              AllocationAttributes,
    HANDLE             FileHandle
);
typedef NTSTATUS(NTAPI* _NtCreatePagingFile)(
    UNICODE_STRING PageFileName,
    
    PLARGE_INTEGER MinimumSize,
    PLARGE_INTEGER MaximumSize,
    ULONG Flags
);
typedef NTSTATUS(NTAPI* _NtExtendSection)(
        IN HANDLE               SectionHandle,
        IN PLARGE_INTEGER       NewSectionSize
);

#define NT_SUCCESS(x) ((signed int)(x) >= 0)
#define STATUS_INFO_LENGTH_MISMATCH 0xc0000004
static BOOL EnablePrivilege();

int main()
{
    
    EnablePrivilege();
    //NtCreateSection createSec= (NtCreateSection)GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtCreateSection");
    _NtCreatePagingFile pagingFile = (_NtCreatePagingFile)(GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtCreatePagingFile"));
    _NtExtendSection extendSection = (_NtExtendSection)(GetProcAddress(GetModuleHandleA("ntdll.dll"), "NtExtendSection"));

    HANDLE file = CreateFileA("F:\\pagefile.sys", GENERIC_READ, 0, NULL, OPEN_EXISTING, 0, NULL);
    int hata = GetLastError();
    printf("last er: %d", hata);
    auto ZwCreateSection = (NTSTATUS(NTAPI*)(
        PHANDLE, ACCESS_MASK, POBJECT_ATTRIBUTES, PLARGE_INTEGER, ULONG, ULONG,
        HANDLE))GetProcAddress(GetModuleHandleA("ntdll.dll"), "ZwCreateSection");

    HANDLE hSection;
    int status;
    PLARGE_INTEGER maxSize = (PLARGE_INTEGER)malloc(sizeof(PLARGE_INTEGER));
    maxSize->QuadPart = 9594128896;
    maxSize->HighPart = 9594128896;
    maxSize->LowPart= 9594128896;

    LARGE_INTEGER maxSizeCreate;
    maxSizeCreate.HighPart = 0;
    maxSizeCreate.LowPart = 0x1000;

    /*if ((status = ZwCreateSection(&hSection, SECTION_ALL_ACCESS, NULL, &maxSizeCreate,
        PAGE_EXECUTE_READWRITE, SEC_COMMIT, NULL)) !=
        0) {

        return -1;
    }*/
    int sonucextend = extendSection(file, maxSize);
    printf("sonucextend: %d", sonucextend);
    //printf("createsection returned: %d", status);
    /*auto map = CreateFileMappingA(file, NULL, PAGE_READONLY, 0, 0, NULL);

    CloseHandle(file);
    auto ret = MapViewOfFile(map, FILE_MAP_READ, 0, 0, 0);
    CloseHandle(map);
    printf("\nlasterr: %d\n", GetLastError());*/
    CloseHandle(file);
    system("pause");
    //ZwCreateSection(INVALID_HANDLE_VALUE, SECTION_EXTEND_SIZE, )
    PLARGE_INTEGER min= (PLARGE_INTEGER)malloc(sizeof(PLARGE_INTEGER));
    min->QuadPart = 0x1200000;
    min->LowPart = 0x1200000;
    min->HighPart = 0x1200000;
    //min->u = 0x1200000;
    PLARGE_INTEGER max=(PLARGE_INTEGER)malloc(sizeof(PLARGE_INTEGER));
    max->QuadPart = 0x1500000;
    max->LowPart = 0x1500000;
    max->HighPart = 0x1500000;

    /*std::string str = "C:\\pagefile2.sys";
    std::wstring wstr(str.length(), 0);
    char text[] = "C:\\pagefile2.sys";
    wchar_t wtext[16];
    mbstowcs(wtext, text, strlen(text) + 1);//Plus null
    LPWSTR ptr = wtext;
    //MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), &wstr[0], str.length());
    //PUNICODE_STRING yol = (PUNICODE_STRING)"C:\\pagefile2.sys";
    */
    UNICODE_STRING yol;
    TCHAR Disk[25];
    //TCHAR Dir = "C:\\";

    //QueryDosDevice("C:\\pagefile2.sys", Disk, 25);

    //StringCbPrintf(pagefile, MAX_PATH, L"%S\\%S", Disk, &FileName[3]);
    //int len = lstrlenW(pagefile);
    //const wchar_t *pagefilestr = GetWC("C:\\pagefile2.sys");
    //PUNICODE_STRING yol = (PUNICODE_STRING)malloc(sizeof(PUNICODE_STRING));
    yol.Buffer = PWSTR("c:\\pagefile2.sys");
    yol.Length = 16;
    yol.MaximumLength = 16;
    long cikti = pagingFile(yol, min, max, 0);
    printf("LAST ERR: %d --- >> Cikti: %ld\n", GetLastError(), cikti);
	system("pause");
}
static BOOL EnablePrivilege()
{
    HANDLE hToken;
    TOKEN_PRIVILEGES tp;

    // Get a token for this process.
    OpenProcessToken(GetCurrentProcess(), TOKEN_ADJUST_PRIVILEGES | TOKEN_QUERY, &hToken);
    // Get the LUID for the shutdown privilege.
    LookupPrivilegeValue(NULL, SE_CREATE_PAGEFILE_NAME, &tp.Privileges[0].Luid);

    tp.PrivilegeCount = 1;
    tp.Privileges[0].Attributes = SE_PRIVILEGE_ENABLED;

    AdjustTokenPrivileges(hToken, FALSE, &tp, 0, NULL, 0);
    DWORD ret = GetLastError();
    return ret == ERROR_SUCCESS;
}

Thanks everyone :)


struct bilgiler { string ad =&amp;quot;Emre Demircan&amp;quot;; int yıl = 2000; string fb = &amp;quot;fb.com/DeatSlayer&amp;quot;; }bilgi;


CDateTimeCtrl: open date selection popup

$
0
0

Hello,

I have a CDateTimeCtrl. When I click on the right "calender dropdown button", a popup opens to select the date.

I want to open this popup select-date-window, so that the user does not have to click on it. Is there a Windows message for example? (In a CCombobox I can call ShowDropDown to open the selection window)

I'm using Visual C++ 2015.

Thanks for help,
Guido

The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing from your computer

$
0
0

We are in the process of transferring our solution to Visual Studio 2015 and are experiencing some problems with our C++ assemblies.

In the projects we have changed the PlatformTarget from v120_xp to v140_xp and replaced the Merge Modules included in our MSI:
    MM_Microsoft_VC120_MFC_x86.msm
    MM_Microsoft_VC120_CRT_x86.msm
with
    MM_Microsoft_VC140_MFC_x86.msm
    MM_Microsoft_VC140_CRT_x86.msm

After installation on Windows 7 which runs smooth, we get an error dialog when launching our application (the exe is one of the C++ Projects). Title is "StandAloneShell.exe - System Error" and the message is "The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is missing from your computer. Try reinstalling the program to fix this problem."

I can see that others have fixed this issue by applying all updates from Microsoft Update and then installing the Visual C++ Redistributable for Visual Studio 2015 (https://www.smartftp.com/support/kb/the-program-cant-start-because-api-ms-win-crt-runtime-l1-1-0dll-is-missing-f2702.html), but this is not really an option for me to do on our customer computers around the world.

Similar problem: https://social.msdn.microsoft.com/Forums/en-US/90a4f857-6008-44c9-bbb2-8c968569b8b2/program-cant-start-because-apimswincrtruntimel110dll-is-missing-from-computer?forum=vssetup

By looking inside the Merge Module using Orca we can see that the file in question has a condition so that it is only installed on Window XP (501) and Windows Server 2003 (502) but it seems to also be required on other versions of Windows.

Have anyone found a real solution for this problem?


Tore Østergaard
Oticon A/S, Denmark

COM exception

$
0
0
In my C++ code, I am calling a method of a COM component. This causes an exception. The error message(_com_error::ErrorMessage() )says "one or more arguments are invalid. " The HRESULT code is 0x80004005. I did some investigation based on this but could not find any specific answers for this. What could be wrong here?

CCheckListBox not showing the full list at startup

$
0
0

Greetings Everyone.

I'm using VS2017 and I have a problem with a CCheckListBox. I fill it with strings in the OnInitDialog function, but when the dialog appears, only the first few strings are shown. If I move the vertical scrollbar a small amount, the remaining strings suddenly appear.

Does anybody have any ideas what might be going on, or how to deal with it?

Here's the code from the OnInitDialog, in case that helps.

BOOL CCombiningEntityTypesDlg::OnInitDialog()
{
   CDialog::OnInitDialog();

   // Set the text to display the type of set that we are editing.
   CString csText = "Select the Entity Types to include when combining ";
   csText += m_csSetTypeToDisplay;
   m_staticDisplayText.SetWindowText(csText);


   System::Collections::Generic::List<System::String^> ^trussTypes = MiTek::EntityTypes::EntityTypeManager::GetInstance(MiTek::Infrastructure::Entity::DataContextBuilder::DefaultContext)->GetDefinedEntityTypeNames();

   
   // Put the truss types into the list.
   for each(System::String^ typeName in trussTypes)
   {      
      CString csLongName = typeName;
      m_clbEntityTypes.AddString(csLongName);
   }

   // The list is sorted, so we can't set the check marks as we insert them.
   CString csType;
   for(int i = 0; i < m_clbEntityTypes.GetCount(); i++)
   {
      m_clbEntityTypes.GetText(i, csType);
      m_clbEntityTypes.SetCheck(i, IsIncluded(csType));
   }



   return TRUE;  // return TRUE unless you set the focus to a control
   // EXCEPTION: OCX Property Pages should return FALSE
}

error C2761: '{ctor}': redeclaration of member is not allowed

$
0
0

While migrating from Visual studio 2013 to Visual studio 2019 compiler I have got below error. Please help me in fixing the same.

I have declared the function in the header file (.h) below:

#ifndef CSAHCCOMPOSEDITEM_H
#define CSAHCCOMPOSEDITEM_H

#ifdef _UTEST
class CsaHcDICOMComposerTester;
#endif

class EXP_IMP_HcDicComp CsaHcComposedItem 
{
#ifdef _UTEST
friend class CsaHcDICOMComposerTester;
#endif

public :

enum CsaHcComposedItemType
{
CISegment,
CIPage,
CILayout,
CIPageBracket,
CIPrintJobBracket,
CIDummy             
};

CsaHcComposedItem
(bool &status, CsaHcComposedItemType type_in);

CsaHcComposedItem
();

CsaHcComposedItem a
(const CsaHcComposedItem& compObj_in);

CsaHcComposedItem& operator= 
(const CsaHcComposedItem& compObj_in);

~CsaHcComposedItem();

    bool operator== 
(const CsaHcComposedItem& ci_in); 

private : // attributes

CsaHcComposedItemTypemyType; 
CsaHcBasicFilmSession*myBFS; 
CsaHcBasicFilmBox *myBFB;
CsaHcBasicImageBox *myBIB;
CsaDib *myDib;
BYTE*myPixelArray;
};

#endif // CSAHCCOMPOSEDITEM_H

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

And cpp file contains the definition for the constructor.

//pusedo code

CsaHcComposedItem::CsaHcComposedItem (bool &status_out,     
                                                // Return status of the construcor
                                      CsaHcComposedItemType type_in)  
                                                // Composed item type
                                      : myType(type_in), // error shown for this line (70)
                                        myBFS(NULL), //line71
                                        myBFB(NULL), 
                                        myBIB(NULL), 
                                        myDib(NULL), 
                                        myPixelArray(NULL)
{
.....
}

Error:

\src/CsaHcComposedItem.cpp(70): error C2761: '{ctor}': redeclaration of member is not allowed
\src/CsaHcComposedItem.cpp(70): error C2059: syntax error: ':'
\src/CsaHcComposedItem.cpp(70): error C2065: 'type_in': undeclared identifier
\src/CsaHcComposedItem.cpp(70): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\src/CsaHcComposedItem.cpp(71): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\src/CsaHcComposedItem.cpp(72): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\src/CsaHcComposedItem.cpp(73): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\src/CsaHcComposedItem.cpp(74): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\src/CsaHcComposedItem.cpp(75): error C4430: missing type specifier - int assumed. Note: C++ does not support default-int
\src/CsaHcComposedItem.cpp(78): error C2448: 'myPixelArray': function-style initializer appears to be a function definition

Viewing all 15302 articles
Browse latest View live


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