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

VC++ 2005 and 2008 are installed with windows 2012 and SQL instance 2012.

$
0
0

Hi,

We have tested a Scenario where we just installed a new windows server 2012 and there was VC++ 2005 and 2008 installed.

I removed both components and installed SQL 2012 and found the VC++ 2005 and 2008 installed again.

Then removed both components and the next day I found the components re-installed automatically after removal.

Is there a recovery point for those components or does SQL 2012 require VC++ 2005 or 2008 ? 

The reason for removal is that MS does not support the VC++ 2005 and 2008 anymore as they are out of support components and doesn't send any new security fixes for them.


windows 8.1 pro System error

$
0
0

{api-ms-win-crt-runtime-I1-1-0.dll}

is missing from my computer.
How can i solve this problem 
help me out of this 

upgrading app in Visual C++ 6.0 to Visual Studio 2013

$
0
0
we have a very complex C++ app that is using MFC, OLE that we need to upgrade to be developed in Visual Studio 2013. When I try to compile it in 2013 I run into all kinds to compiler errors and would like to know which is the best and safest way to move it from Visual Studio 6.0 to 2013? Thanks

US

C++/Cli, String^and std::bind

$
0
0

Hello,

I try to compile following code

String^ MyFuncCore(String^ a1, unsigned int a2, String^ a3, String^ a4, String^ a5) {
...
}

String^ MyManagedClass::MyFuncC(String^ a1, unsigned int a2, String^ a3, String^ a4, String^ a5) {
	std::function<String^(void)> funchelper = std::bind(&MyFuncCore, a1, a2, a3, a4, a5);
...
}

But I get

Error C3265 cannot declare a managed '_Val' in an unmanaged 'std::_Tuple_val<_This>'

for the line with std::bind.

What can I do ?

tia

  Hendrik Schmieder

C++ redistributable 2017 installation removes silently C++ redistributable 2015 update 3

$
0
0

There is a similar thread

I've hit this problem when I updated my Visual Studio 2017 to 15.9.2. It apparently installed new version of C++ redistributable (14.16.27012) which removed the old one.

The reason for this behavior is explained there. But it causes problems with SQL Server Management Studio 17.9. Now SSMS throws the error in Microsoft.SqlServer.Management.SqlStudio.ConnectToOe() on launch:

Object reference not set to an instance of object

It is explained in this StackOverflow answer

But what are my options now? I would rather not remove this new version of C++ redistributable because I won't be able to build my C++ apps in Visual Studio. And I can't work in SSMS while this new version is installed.

Perhaps new SSMS version will be ready soon which addresses this issue?


cannot open source file "stdafx.h"

$
0
0

Hi,

I need help on how to compile https://www.exploit-db.com/exploits/45805/
What steps I miss
tq

SW INFO:
-Visual Studio Community 2017
-https://www.exploit-db.com/exploits/45805/

ERROR:
cannot open source file "stdafx.h"
cannot open source file "resource.h"
identifier "IDR_DATA1" is undefined


STEPS TAKEN
create a New Project
click Visual C++/Windows Desktop/Windows Desktop Wizard
tick
Precompiled Header
Security Dev...
click menu Project/Add existing items
add 45805.cpp
right click Project/Build
then got error above


Overwrite fails quietly when fopen with r+ in C

$
0
0
/*I have written this code (prg.c) to test the problem I am having with   following Visual C compiler:    Microsoft Visual Studio Community 2017    Version 15.8.9    VisualStudio.15.Release/15.8.9+28010.2050    Installed Version: Community    Visual C++ 2017   00369-60000-00001-AA642    Microsoft Visual C++ 2017    Microsoft Visual C++ Wizards   1.0    Microsoft Visual C++ Wizards    Microsoft Visual Studio VC Package   1.0    Microsoft Visual Studio VC PackageThe output of the follwing code is supposed to be: (and it is with gcc on linux)num:10 ret:1num:30 ret:1==========++10##3040But instead it completely ignores the overwrite and only moves the file  pointer and the output comes out as:num:10 ret:1num:30 ret:1============10203040however if the two lines for the first fscanf and printf   are commented, the output becomes:num:20 ret:1============##203040Can anyone explain why? (many thanks in advance)*/#define _CRT_SECURE_NO_WARNINGS#include <stdio.h>int main(void) {FILE* fptr;int num,ret, ch;
  fptr = fopen("data.txt", "w"); // creating data.txt file: 10\n20\n30\n40\nfor (num = 1; num <= 4; fprintf(fptr, "%d\n", num++ * 10));
  fclose(fptr);
  fptr = fopen("data.txt", "r+"); // reopening with r+ (I also tried rt+)// comment the following two lines and overwrite will work!
  ret = fscanf(fptr, "%d\n", &num);         
  printf("num:%d ret:%d\n", num, ret);  -  // overwriting 20  (Fails!, file pointer moves with no error and no output)
  fprintf(fptr, "##"); 
  fflush(fptr);

  ret = fscanf(fptr, "%d\n", &num);                
  printf("num:%d ret:%d\n", num, ret);    

  fclose(fptr);
  fptr = fopen("data.txt", "r"); // reopening with r
  printf("============\n");while ((ch = fgetc(fptr)) != EOF) putchar(ch);  // printing the content of data.txt
  fclose(fptr);return 0;
}

C++ application using automation via #import directive no longer compiles with newer Outlook version

$
0
0

Hello All,

I have a compilation issue that just recently arose on one of my colleagues machines. The difference between our machines is his Outlook version is 1808 (build 10730.20102), and mine is version 1803 (build 9126.2295). I have no issues building with outlook 1803, these are the compile errors on the outlook 1808 machine:

1>d:\win32contacts\debug\msoutl.tlh(6759) : error C2146: syntax error : missing ';' before identifier 'PickerDialog'

1>d:\win32contacts\debug\msoutl.tlh(6759) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>d:\win32contacts\debug\msoutl.tlh(6759) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>d:\win32contacts\debug\msoutl.tlh(6844) : error C2146: syntax error : missing ';' before identifier 'GetPickerDialog'

1>d:\win32contacts\debug\msoutl.tlh(6844) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>d:\win32contacts\debug\msoutl.tlh(6844) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>d:\win32contacts\debug\msoutl.tlh(6844) : warning C4183: 'GetPickerDialog': missing return type; assumed to be a member function returning 'int'

1>d:\win32contacts\debug\msoutl.tlh(7068) : error C2146: syntax error : missing ';' before identifier 'CreateContactCard'

1>d:\win32contacts\debug\msoutl.tlh(7068) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>d:\win32contacts\debug\msoutl.tlh(7069) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>d:\win32contacts\debug\msoutl.tlh(7069) : warning C4183: 'CreateContactCard': missing return type; assumed to be a member function returning 'int'

1>d:\win32contacts\debug\msoutl.tlh(28085) : error C2143: syntax error : missing ';' before 'Outlook::_Application::GetPickerDialog'

1>d:\win32contacts\debug\msoutl.tlh(28085) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>d:\win32contacts\debug\msoutl.tlh(28085) : error C2497: 'PickerDialogPtr' : 'implementation_key' can only be applied to function declarations

1>d:\win32contacts\debug\msoutl.tlh(28085) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>d:\win32contacts\debug\msoutl.tlh(28132) : error C2143: syntax error : missing ';' before 'Outlook::_NameSpace::CreateContactCard'

1>d:\win32contacts\debug\msoutl.tlh(28132) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

1>d:\win32contacts\debug\msoutl.tlh(28132) : error C2497: 'ContactCardPtr' : 'implementation_key' can only be applied to function declarations

1>d:\win32contacts\debug\msoutl.tlh(28132) : error C4430: missing type specifier - int assumed. Note: C++ does not support default-int

This is some of the source code (it's from code project: https://www.codeproject.com/Articles/3695/Importing-contacts-from-Outlook)

// OutlookContactsDlg.cpp : implementation file
//

#include "stdafx.h"
#include "OutlookContacts.h"
#include "OutlookContactsDlg.h"

#ifdef _DEBUG
	#define new DEBUG_NEW
#undef THIS_FILE
	static char THIS_FILE[] = __FILE__;
#endif

#import <mso.dll> no_namespace rename("DocumentProperties", "DocumentPropertiesOUTL") rename("RGB", "RBGOUTL")
#import <msoutl.olb> rename_namespace("Outlook") rename("CopyFile", "CopyFileOTL") rename("PlaySound", "PlaySoundOTL") rename("GetOrganizer", "GetOrganizerAE")
using namespace Outlook;	
	/////////////////////////////////////////////////////////////////////////////
// COutlookContactsDlg dialog

COutlookContactsDlg::COutlookContactsDlg(CWnd* pParent /*=NULL*/)
	: CDialog(COutlookContactsDlg::IDD, pParent)
{
	//{{AFX_DATA_INIT(COutlookContactsDlg)
	//}}AFX_DATA_INIT
	// Note that LoadIcon does not require a subsequent DestroyIcon in Win32
	m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void COutlookContactsDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(COutlookContactsDlg)
	DDX_Control(pDX,IDC_CONTACTLIST,m_ContactList);
	DDX_Control(pDX,IDC_OPTION,m_Option);
	//}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(COutlookContactsDlg, CDialog)
	//{{AFX_MSG_MAP(COutlookContactsDlg)
	ON_WM_PAINT()
	ON_WM_QUERYDRAGICON()
	ON_BN_CLICKED(IDC_IMPORT, OnImport)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// COutlookContactsDlg message handlers

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

	// Set the icon for this dialog.  The framework does this automatically
	//  when the application's main window is not a dialog
	SetIcon(m_hIcon, TRUE);			// Set big icon
	SetIcon(m_hIcon, FALSE);		// Set small icon
	
	return TRUE;  // return TRUE  unless you set the focus to a control
}

// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,
//  this is automatically done for you by the framework.

void COutlookContactsDlg::OnPaint() 
{
	if (IsIconic())
	{
		CPaintDC dc(this); // device context for painting

		SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

		// Center icon in client rectangle
		int cxIcon = GetSystemMetrics(SM_CXICON);
		int cyIcon = GetSystemMetrics(SM_CYICON);
		CRect rect;
		GetClientRect(&rect);
		int x = (rect.Width() - cxIcon + 1) / 2;
		int y = (rect.Height() - cyIcon + 1) / 2;

		dc.DrawIcon(x, y, m_hIcon);
	}
	else
	{
		CDialog::OnPaint();
	}
}

HCURSOR COutlookContactsDlg::OnQueryDragIcon()
{
	return (HCURSOR) m_hIcon;
}

void COutlookContactsDlg::OnImport() 
{

	_ApplicationPtr pApp;
	_ItemsPtr pItems;
	MAPIFolderPtr pFolder;
	_ContactItemPtr pContact;
		
	HRESULT hr;

	try
	{
		hr=pApp.CreateInstance(__uuidof(Application));
		if (FAILED(hr))
		{
			MessageBox(_T("Unable to instantiate Outlook."),_T("Outlook Error"),MB_OK);
			return;
      }

		if (m_Option.GetCheck()) //default outlook contacts folder
		{
			pFolder=pApp->GetNamespace(_bstr_t("MAPI"))->GetDefaultFolder(olFolderContacts);
			if (pFolder==NULL)
			{
				MessageBox(_T("Could not find default contacts folder."),_T("Outlook Error"));
				return;
			}			
		}
		else //display folder selection window
		{
			pFolder=pApp->GetNamespace(_bstr_t("MAPI"))->PickFolder();
			if (pFolder==NULL)
				return;

			if (pFolder->GetDefaultItemType()!=olContactItem)
			{
				MessageBox(_T("Select folder is not a Contact folder."),_T("Outlook Contacts"));
				return;
			}
		}

		pItems=pFolder->GetItems();
		if (pItems==NULL)
		{
			MessageBox(_T("Unabel to get Contact Items."),_T("Outlook Error"));
			return;
		}
		pContact=pItems->GetFirst();

		m_ContactList.ResetContent();

		while(1)
		{
			if (pContact==NULL)
				break;
			CString strTemp;
			strTemp=(char *)pContact->GetFullName();
			strTemp=strTemp + "<";
			strTemp=strTemp + (char *)pContact->GetEmail1Address();
			strTemp=strTemp + ">";
			m_ContactList.AddString(strTemp);

			pContact=pItems->GetNext();
		}

	}
	catch(_com_error &e)
	{
		MessageBox(e.Description());
	}
}

I've tried excluding the offending items to no avail. So far there's only one machine that has this updated version of Outlook, but our IT department could update everyone's machine in time, which will be a problem. Does anyone know how I can fix this?

Thanks.



[visual studio 2017] typing Chinese shows syntax errors

$
0
0

```

void ofApp::setup(){ofTrueTypeFontSettings settings("Microsoft YaHei UI", 24); settings.antialiased = true; settings.contours = true; settings.dpi = 72;//settings.direction = OF_TTF_LEFT_TO_RIGHT; settings.addRanges(ofAlphabet::Chinese); settings.addRanges(ofAlphabet::Latin); ttf.load(settings); }void ofApp::draw(){ ofPushStyle(); ofSetColor(255,0,0); ttf.drawString("你好啊怎aaa啊啊怎",100,100); ofPopStyle(); }

```

It didn't show any syntax errors before I compiled.  After I compiled it, it shows the syntax errors as below:

```

C2001 newline in constant

C2146 syntax error: missing ')' before identifier 'ofPopStyle'

C2660 'ofTrueTypeFont::drawString': function does not take 1 arguments

C2146 syntax error: missing ';' before identifier 'ofPopStyle'

```

Might it be the problem with visual studio 2017? Or visual studio cannot perfectly recognize Chinese, so it shows the error?

If I read these Chinese word from a text file in my program, then it is fine.

Does anyone know the reason?

How use "strtok" in Visual Studio 2017

$
0
0

I get an error message when trying to use "strtok".  The message says "This function or variable may be unsafe" and it recommends to use "strtok_s" instead.  Do I really need to use "strtok_s"?  Or might I be including the wrong .h header library?  I'm including "string.h" and "stdio.h".

Use of strings in functions

$
0
0

I have the following function call:

foo("Hello");

Visual Studio 2017 gives a compile error that says "error C2664" and "cannot convert to char[]".

The code only works as follows:

char sString[] = "Hello";
foo(sString);

Is there any way to get the compiler to accept the former code up above, where I just use foo("Hello")??

Thanks!    - Robert

C++ Block .dll from showing up in a Module list using PEB ? And blocking the PE Header

$
0
0

I am wanting to know how i can block my .dll from being shown on a module list. In Skylla a dumping tool. I have amazing reverse engineering. But i can't let my .dll show up in a module list.

Is their away to block it so it does not show up in the module name !

And also wanting to block the PE Header. So it can't be dumped By this skylla. (Advanced Crackers can find a way past it please don't bother me with that)

Just bothered about what is stated above

(Blocking it from processes keeping it hidden from windows with normal dumping tools. Not Advanced one that advanced crackers can use !)

I saw this on one file when injected into a process. It won't show up on a module list its hidden 

Is there any method can merge two subset font?

$
0
0

the function MergeFontPackage can merge two font packages, one is subset1, the other is delta font type.

I wonder is there any API or method can merge two subset1 font data into one?

or any API or method about converting one subset1 font data into delta font data?

thanks

In MFC how to draw transparent jpeg?

$
0
0

Hi,

I want to draw transparent jpeg. 

I want to make certain area of the image which is currently white transparent.

Thanks

Problems with property sheets/property pages

$
0
0

I have some code that creates a property sheet and some property pages:

class DialogBase
{
public:
	HWND parent;
	HWND dlg;
	int dialogid;
	static std::unordered_map<HWND, DialogBase *> map;
	DialogBase(HWND Parent, int Id) : parent(Parent), dlg(nullptr), dialogid(Id)
	{
	}
	virtual ~DialogBase()
	{
		map[dlg] = nullptr;
	}
	int ShowDialog();
	virtual void OnInitDialog() = 0;
	virtual void OnOk();
	virtual void OnCancel();
	virtual INT_PTR CALLBACK DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
	static INT_PTR CALLBACK StaticDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
};

class PropertyPageBase : public DialogBase
{
public:
	PropertyPageBase(int Id);
	void OnInitDialog();
	void GetPropSheetPage(PROPSHEETPAGE &page);
	void SetModified(bool modified);
	virtual bool OnApply();
	virtual void OnReset();
	void OnOk();
	void OnCancel();
	INT_PTR CALLBACK DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
	static INT_PTR CALLBACK StaticPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam);
};

class PropertySheetBase
{
public:
	static PropertySheetBase *_instance;
	StringClass title;
	HWND owner;
	HWND sheet;
	WNDPROC oldproc;
	SimpleDynVecClass<PropertyPageBase *> pages;
	PropertySheetBase(HWND Owner,const char *Title);
	static int CALLBACK PropSheetCallback(HWND hwndPropSheet, UINT uMsg, LPARAM lParam);
	static LRESULT CALLBACK StaticWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
	virtual LRESULT CALLBACK WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
	void ShowDialog();
	void Add_Page(PropertyPageBase *base);
};

std::unordered_map<HWND, DialogBase *> DialogBase::map;
int DialogBase::ShowDialog()
{
	return DialogBoxParam(instance, MAKEINTRESOURCE(dialogid), parent, StaticDlgProc, (LPARAM)this);
}

void DialogBase::OnOk()
{
	EndDialog(dlg, IDOK);
}

void DialogBase::OnCancel()
{
	EndDialog(dlg, IDCANCEL);
}

INT_PTR CALLBACK DialogBase::DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg)
	{
	case WM_INITDIALOG:
		dlg = hwndDlg;
		OnInitDialog();
		return TRUE;
	case WM_COMMAND:
		switch (LOWORD(wParam))
		{
		case IDOK:
			OnOk();
			return TRUE;
		case IDCANCEL:
			OnCancel();
			return TRUE;
		}
		break;
	}
	return FALSE;
}

INT_PTR CALLBACK DialogBase::StaticDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	if (uMsg == WM_INITDIALOG)
	{
		map[hwndDlg] = (DialogBase *)lParam;
	}
	DialogBase *p = map[hwndDlg];
	if (p)
	{
		return p->DlgProc(hwndDlg, uMsg, wParam, lParam);
	}
	return FALSE;
}

PropertyPageBase::PropertyPageBase(int Id) : DialogBase(nullptr, Id)
{
}

void PropertyPageBase::OnInitDialog()
{
	parent = GetParent(dlg);
}

void PropertyPageBase::GetPropSheetPage(PROPSHEETPAGE &page)
{
	memset(&page, 0, sizeof(page));
	page.dwSize = sizeof(PROPSHEETPAGE);
	page.dwFlags = PSP_PREMATURE;
	page.hInstance = instance;
	page.pszTemplate = MAKEINTRESOURCE(dialogid);
	page.pszIcon = nullptr;
	page.pfnDlgProc = StaticPageDlgProc;
	page.lParam = (LPARAM)this;
}

void PropertyPageBase::SetModified(bool modified)
{
	if (modified)
	{
		PropSheet_Changed(parent, dlg);
	}
	else
	{
		PropSheet_UnChanged(parent, dlg);
	}
}

bool PropertyPageBase::OnApply()
{
	OnOk();
	return true;
}

void PropertyPageBase::OnReset()
{
	OnCancel();
}

void PropertyPageBase::OnOk()
{
}

void PropertyPageBase::OnCancel()
{
}

INT_PTR CALLBACK PropertyPageBase::DlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	switch (uMsg)
	{
	case WM_NOTIFY:
		{
			LPNMHDR hdr = (LPNMHDR)lParam;
			switch (hdr->code)
			{
			case PSN_APPLY:   //sent when OK or Apply button pressed
				SetDlgMsgResult(dlg, PSN_APPLY, OnApply() ? PSNRET_NOERROR : PSNRET_INVALID_NOCHANGEPAGE);
				return TRUE;
			case PSN_RESET:   //sent when Cancel button pressed
				OnReset();
				return TRUE;
			};
		}
		break;
	}
	return DialogBase::DlgProc(hwndDlg, uMsg, wParam, lParam);
}

INT_PTR CALLBACK PropertyPageBase::StaticPageDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	if (uMsg == WM_INITDIALOG)
	{
		map[hwndDlg] = (DialogBase *)((PROPSHEETPAGE *)lParam)->lParam;
	}
	DialogBase *p = map[hwndDlg];
	if (p)
	{
		return p->DlgProc(hwndDlg, uMsg, wParam, lParam);
	}
	return FALSE;
}

PropertySheetBase *PropertySheetBase::_instance = nullptr;
PropertySheetBase::PropertySheetBase(HWND Owner, const char *Title) : title(Title), owner(Owner), sheet(nullptr), oldproc(nullptr)
{
}

void PropertySheetBase::ShowDialog()
{
	PropertySheetBase *oldinstance = _instance;
	_instance = this;
	PROPSHEETHEADER psh;
	memset(&psh, 0, sizeof(psh));
	PROPSHEETPAGE *psp = new PROPSHEETPAGE[pages.Count()];
	for (int i = 0; i < pages.Count(); i++)
	{
		pages[i]->GetPropSheetPage(psp[i]);
	}
	psh.dwSize = sizeof(PROPSHEETHEADER);
	psh.dwFlags = PSH_PROPSHEETPAGE | PSH_USECALLBACK;
	psh.hwndParent = owner;
	psh.hInstance = instance;
	psh.pszIcon = nullptr;
	WideStringClass str = title;
	psh.pszCaption = str;
	psh.nPages = pages.Count();
	psh.ppsp = psp;
	psh.pfnCallback = PropSheetCallback;
	PropertySheet(&psh);
	_instance = oldinstance;
}

int CALLBACK PropertySheetBase::PropSheetCallback(HWND hwndPropSheet, UINT uMsg, LPARAM lParam)
{
	switch (uMsg)
	{
	case PSCB_INITIALIZED:
		{
			_instance->sheet = hwndPropSheet;
			_instance->oldproc = SubclassWindow(hwndPropSheet, StaticWindowProc);
		}
		break;
	}
	return 0;
}

LRESULT CALLBACK PropertySheetBase::StaticWindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	if (_instance)
	{
		return _instance->WindowProc(hWnd, uMsg, wParam, lParam);
	}
	return DefWindowProc(hWnd, uMsg, wParam, lParam);
}

LRESULT CALLBACK PropertySheetBase::WindowProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
	return CallWindowProc(oldproc, hWnd, uMsg, wParam, lParam);
}

void PropertySheetBase::Add_Page(PropertyPageBase *base)
{
	pages.Add(base);
}

I also turn on comctlv6 via this line elsewhere

#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' " "version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")

I am on Windows 7 and am using the latest version of Visual C++ 2017 (15.9.2).

I have a derivative of PropertySheetBase and 3 derivatives of PropertyPageBase. In the PropertySheetBase derivative constructor I call Add_Page to add the 3 property pages to my sheet then later I call ShowDialog to actually display the property sheet and its pages.

However, only the first page is showing up, the other 2 tabs dont appear. Can anyone see anything wrong with my code in terms of how I use property sheets and property pages and anything I should do differently to make the other tabs appear? (it doesn't help that the MSDN documentation for property sheets and pages isn't exactly the best quality and some things are either not documented or not easy to find)

If you need to see the code that's actually using these classes, I can share the relavent components.


Visual Studio 2017 cleaning too much

$
0
0

This problem may well not be restricted to VS2017 (15.5.2 / 4.7.02558)

We have a solution with many projects, both C++ and CLI. We have recently added an x64 Platform and all projects build to an OutputX64 folder. When building x86 Platform all output goes to an "Output" folder.

All good, all builds correctly in both modes, all OutDir's have been updated in all projects. However, what we have noticed is that if I do a full rebuild in x86, then switch Platform and do a full rebuild in x64, for some reason the Clean process is deleting files from both Output folders, not just the OutputX64 folder.

If I do another rebuild of x64, this does not occur - only the files from the OutputX64 folder are being deleted.

The same happens in reverse - if I build x64 and switch to building x86 and perform a Rebuild, it cleans files from the OutputX64 folder AS WELL as from the Output folder.

I've tried marking one of the files that isn't meant to be deleted as Read Only, and sure enough, in the build output, right after the project that generates it starts, I get an access denied error.

Is this in some way by design? It appears that the Clean does not clean the currently selected platform, it cleans files from all the Platforms. It's causing our CM team headaches as we want to make a dual-mode installer and need to build the project in both x86 and x64. They are getting around it by duplicating the x86 folder before kicking off the x64 build but that feels like a work-around. Is there a better way of doing this?

Edit and continue

$
0
0
unable to use edit and continue in vc++ 2008 ,any help will be thankfull 

C# x509 usb certificate token hangs application

$
0
0
I'm trying to find out why my application hangs on exit, after the use of a usb token certificate. Without any try/catch blocks or other logic, the code is:

X509Store s= new X509Store(StoreName.My, StoreLocation.CurrentUser);
s.Open(OpenFlags.OpenExistingOnly);
X509Certificate2 cert = s.Certificates[0];
s.Close();

RSACryptoServiceProvider rsa = cert.PublicKey.Key as RSACryptoServiceProvider;
byte[] cryptedData = rsa.Encrypt(Encoding.UTF8.GetBytes("test"), true);

rsa = cert.PrivateKey as RSACryptoServiceProvider;
string x = Encoding.UTF8.GetString(rsa.Decrypt(cryptedData, true));
When I run the code inside a button click event, I am prompted for the PIN of the USB token. After I type and confirm the PIN , the variable x == "test", which is to be expected. Therefore encryption and decryption with the token work.

When I close the form, the application just hangs, and, if I click "break all" in VS2017, even visual studio hangs. My guess is that something related to the usb-token cryptography functions is not released/closed.

I've tried, without any luck, with:

Environment.Exit(0);
cert.Reset();
rsa.Clear();
rsa.Dispose();
cert.Dispose();
Any ideas? Thank you.

I have a serious problem with my last project and I need your help more than ever!

$
0
0

Download my project from the link below and please tell me what was the big problem, I am stuck with errors and attempting to get rid of all of them for hours but no success and I have no idea what to do anymore!!!

https://onedrive.live.com/?id=root&cid=7BCC6927D94877AE


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

$
0
0

Windows 8.1 on an HP Envy m6-n010dx.

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

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

Viewing all 15302 articles
Browse latest View live


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