visual-studio-2012

C# Preview Print Dialog

此生再无相见时 提交于 2019-12-19 12:22:27
问题 I have a datagrid of information and when the print button is clicked I want to show a print preview screen of what it will look like and then let the user print the document. Heres what I got so far: PrintDocument myDocument = new PrintDocument(); PrintPreviewDialog PrintPreviewDialog1 = new PrintPreviewDialog(); PrintPreviewDialog1.Document = myDocument; PrintPreviewDialog1.ShowDialog(); My question is how to get the data onto the preview screen.. thanks! 回答1: You need to add the PrintPage

Using a C++ Library (built using Visual C++ 2010) in a Windows 8 Store app (built using Visual C++ 2012)

元气小坏坏 提交于 2019-12-19 11:52:06
问题 I have a C++ library built using VC++ 2010. I have the headers, import libs and DLLs for this library. I want to use this library in my Windows 8 Store app that I am trying to build using VC++ 2012. My app works fine on my local machine but when I try to run this app on a remote Windows 8 device, the app fails to load. What am I doing wrong? 回答1: You cannot use C++ binaries built using older version of Visual Studio (older than Visual Studio 2012) in your Windows 8 Store apps. The reason for

Microsoft.CppClean.targets deletes files I need

こ雲淡風輕ζ 提交于 2019-12-19 11:41:57
问题 I have a VS2012 solution. One of the Project A generates a .h file at runtime. This header file is used by another Project B. Project A and Project B are in the same directory. However when Project B starts rebuild, C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Microsoft.CppClean.targets deletes the files generated by Project A. Due to this Project B cannot find the file anymore and build fails. How can I avoid the files being deleted during a clean build? Should the two projects be

How can I set the name of my program in the Open With dialog?

爷,独闯天下 提交于 2019-12-19 11:05:39
问题 I want the program to read VLC (Move on end) : I've modified my Assembly Info to the following, to no avail: How can I alter the name displayed in the Open With dialog? 回答1: It is stored in the registry as the FriendlyAppName value under HKCR\Applications\YourExeName. Described in this MSDN page. 回答2: Per Hans' answer, this is what did it for me: export.reg Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\Applications\VLCMoveOnEnd.exe] "FriendlyAppName"="VLC (Move on end)" [HKEY

Cannot open include file: 'ntddk.h': No such file or directory

懵懂的女人 提交于 2019-12-19 10:16:15
问题 I am getting this error when I am trying to build my driver: Driver.cpp(7): fatal error C1083: Cannot open include file: 'ntddk.h': No such file or directory I am using Visual Studio 2012 with WDK 8.1 installed (I have not cinfigured anything in VS). Any help is appreciated. 回答1: Go to project properties -> C/C++ -> General, and add ddk headers path to Additional Include Directories tab. It should be sth like $(WDKPATH)\inc\ddk where $(WDKPATH) is ofc a directory where You have installed WDK.

Check-in code into TFS Server by using TFS API

不羁岁月 提交于 2019-12-19 09:43:31
问题 I'm writing c# code to check-in code to TFS server: Workspace WS = VersionControl.GetWorkspace(TeamProject); WS.Map(TFSMapServerPath,LocalWorkingPath); int NumberOfChange = WS.PendAdd(string.Format(@"{0}\Main\DotNet\",LocalWorkingPath),true); PendingChange[] pendingChanges = WS.GetPendingChanges(); WS.CheckIn(pendingChanges,"Auto Check-in"); But i got the error is "No files checked in", all files/folders under LocalWorkingPath are "Pending Change". Are the above codes correct? 回答1: I changed

WPF VS2013: An error occurred while finding the resource dictionary

℡╲_俬逩灬. 提交于 2019-12-19 09:05:32
问题 Team, I have a simple wpf project in Visual Studio 2013. The structure is shown below. All that the error says is as shown in the title "An error occurred while finding the resource dictionary". I have tried many suggestions from the net and running out of patience. Every thing seems to be alright. Any one experienced with this can kindly suggest some thing. Thanks in advance. 回答1: It should read: ...Source="/Skins/MainSkin.xaml" As the skin isn't in the Content directory. At the moment it's

How to convert char* to TCHAR[ ]? [duplicate]

穿精又带淫゛_ 提交于 2019-12-19 09:03:24
问题 This question already has answers here : Convert char to TCHAR* argv[] (2 answers) Closed 6 years ago . char* stheParameterFileName = argv[1]; //I'm passing the file name as a parameter. TCHAR szName [512]; How can I convert char* to TCHAR [] ? 回答1: If you include the header file: #include "atlstr.h" Then you can use the A2T macro as below: // You'd need this line if using earlier versions of ATL/Visual Studio // USES_CONVERSION; char* stheParameterFileName = argv[1]; TCHAR szName [512];

No metro project templates in Visual Studio Express 2012 for Desktop?

試著忘記壹切 提交于 2019-12-19 08:54:17
问题 Both of the download pages for for Desktop and for Windows 8 provide the same web installer called: "Visual Studio Express 2012 for Windows Desktop". I installed it and here is its "New Project" window: In this tutorial page, it says I should have templates like this: (source: microsoft.com) How can I get these templates? I'm using Windows 8 x64 RTM. 回答1: You have most likely downloaded wrong Visual Studio Express version, maybe there is broken link on that page. If you want to develop Metro

No metro project templates in Visual Studio Express 2012 for Desktop?

霸气de小男生 提交于 2019-12-19 08:53:16
问题 Both of the download pages for for Desktop and for Windows 8 provide the same web installer called: "Visual Studio Express 2012 for Windows Desktop". I installed it and here is its "New Project" window: In this tutorial page, it says I should have templates like this: (source: microsoft.com) How can I get these templates? I'm using Windows 8 x64 RTM. 回答1: You have most likely downloaded wrong Visual Studio Express version, maybe there is broken link on that page. If you want to develop Metro