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

MFC error MSB8011: Failed to register output. when trying to get current active document

$
0
0

Hello, i am currently developing a MDI MFC application and i am currently trying to get The properties window to update to the currently selected class object in the class view hierarchy tree.

What i currently have is a OnTvnSelchanged in CViewTree class so that when the user changes the selection in the class view window it runs the function. how within CMyDoc (called CCarbonToolsV20Doc in my application) i have an array of one of my custom classes (which is what the class view window organises into a hierarchy) so in order for me to get the object that i want to display its properties off i need its ID and a pointer to that array. I can get the ID very easily however i need to get a pointer to the currently active CMyDoc in order to get the array which contains that object with that ID. Once i have this information i can pass it on through a function so that the properties window can update and display the relevant information.

I have looked on MSDN and i found a page on where i could get a pointer to the active document anywhere in my application however it is bringing up the "error MSB8011".

The function is this:

CCarbonToolsV20Doc* CCarbonToolsV20Doc::GetDoc()
{
	CMDIChildWnd * pChild = ((CMDIFrameWnd*)(AfxGetApp()->m_pMainWnd))->MDIGetActive();

	if (!pChild)
		return NULL;

	CDocument * pDoc = pChild->GetActiveDocument();

	if (!pDoc)
		return NULL;

	// Fail if doc is of wrong kind
	if (!pDoc->IsKindOf(RUNTIME_CLASS(CCarbonToolsV20Doc)))
		return NULL;

	return (CCarbonToolsV20Doc*)pDoc;
}

And the function is declared as a static in the header file.

when i compile i get this error:

1>------ Build started: Project: Carbon Tools V2.0, Configuration: Debug Win32 ------
1>  ViewTree.cpp
1>  Carbon Tools V2.0.vcxproj -> C:\Users\Carbon\Documents\Visual Studio 2013\Projects\Carbon Tools V2.0\Debug\Carbon Tools V2.0.exe
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(1617,5): warning MSB3073: The command ""C:\Users\Carbon\Documents\Visual Studio 2013\Projects\Carbon Tools V2.0\Debug\Carbon Tools V2.0.exe" /RegServerPerUser" exited with code 255.
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppCommon.targets(1620,5): error MSB8011: Failed to register output. Please try enabling Per-user Redirection or register the component from a command prompt with elevated permissions.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

What is causing this and how can i fix it? I have tried enabling Pre-user redirection and that did nothing.


Viewing all articles
Browse latest Browse all 15302

Trending Articles



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