Posts

Showing posts with the label Visual Studio

C++ Array Declaration Stack Overflow Exception

Image
Error: Stack overflow when declaring a huge array in C++. Unhandled exception at 0x00007FF60B7040C8 in Tutorial.exe: 0xC00000FD: Stack overflow (parameters: 0x0000000000000001, 0x00000081A80D3000). occurred Problem code: #include <iostream> #include <fstream> int main() {     //do something..     int nar[10000000];     //do something more..     return 0; }

Fix _CRT_SECURE_NO_WARNINGS in VC++

Image
Error: To disable deprecation, use _CRT_SECURE_NO_WARNINGS. Error    1    error C4996: 'sscanf': This function or variable may be unsafe. Consider using sscanf_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. Error    1    error C4996: 'fopen': This function or variable may be unsafe. Consider using fopen_s instead. To disable deprecation, use _CRT_SECURE_NO_WARNINGS. See online help for details. Solution: Go to Project -> Properties -> C/C++ -> Preprocessor -> Preprocessor Definitions and add _CRT_SECURE_NO_WARNINGS in the list. This Visual C++ warning, C4996, flags standard C functions such as sscanf and fopen as unsafe because they do not bound their buffers, and MSVC suggests the _s secure variants instead. You can switch to the suggested secure functions, or define _CRT_SECURE_NO_WARNINGS to silence the warning once you have rev...

Input string was not in a correct format in ASP.NET/C#

Image
ERROR:   Server Error in '/' Application. Input string was not in a correct format. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. Exception Details: System.FormatException: Input string was not in a correct format. Source Error: Line 31:         int ppi = Convert.ToInt32(Text1.Text); SOLUTION: I tried to change int ppi = Convert.ToInt32(Text1.Text); statement to int ppi = int.Parse(Text1.Text); and int ppi = Int32.Parse(Text1.Text); and int ppi = Int16.Parse(Text1.Text); but it didn't work. The reason was I was using a float value and parsing into an integer one, so I change the erroneous statement to the following, and it worked: float ppi =  float.Parse(Text1.Text);

'atlbase.h': No such file or directory

Image
Error code: #include <atlbase.h> Error: 1    error C1083: Cannot open include file: 'atlbase.h': No such file or directory 2    IntelliSense: cannot open source file "atlbase.h" This error occurs if you are using atlbase.h file in your program in Visual C++ Express Edition instead of Visual Studio. The reason is express edition does not come with Microsoft Platform SDK as studio does so we need to install it separately and need to modify a couple of lines. Solution: 1. Download and install Windows Server 2003 SP1 Platform SDK from http://www.microsoft.com/en-us/download/details.aspx?id=6510 2. If you have a 64-bit OS/Processor (Intel i5, Windows 7 64-bit) then install PSDK-amd64.exe as other two won't work. 3. Go to your installation directory to edit atlbase.h file, default would be C:\Program Files\Microsoft Platform SDK\Include\atl 4. Make following changes

Database login error in Visual Studio

Image
Error: Cannot open user default database. Login failed. Login failed for user 'abcxyz'. I got this error in my Visual Web Developer 2010 Express. My database named Database1.mdf was not opening and throwing this error.

'Office' does not exist in the namespace 'Microsoft'

Image
Error: The type or namespace name 'Office' does not exist in the namespace 'Microsoft' (are you missing an assembly reference?) Version: Microsoft Visual Studio 2013 Problem code: using Excel = Microsoft.Office.Interop.Excel; Solution: 1. Go to http://www.dllme.com/dll/files/microsoft_office_interop_excel_dll.html and download Microsoft.Office.Interop.Excel.dll (Size: 1.04 MB)

Install Visual Web Developer 2010 Express

Image
Hello there, in this tutorial I am going to show you how to install and register Microsoft Visual Web Developer 2010 Express. Step 1: Go to http://www.microsoft.com/web/gallery/install.aspx?appid=VWD2010SP1AzurePack and click on Install Now button. It will download Microsoft Web Platform Installer. Step 2: Run the downloaded .exe file and install the setup. Open the installed software. Step 3: Type "express 2010" in the search box and press enter. Step 4: Click on Add and install the software. This is an online (web) installer so now it will download and install the required files simultaneously. Step 5: Open Microsoft Visual Web Developer 2010 Express and go to Help > Register Product. Enter this registration key: CY8XP-83P66-WCF9D-G3P42-K2VG3. Done! You are successfully registered! Congrats, installation completes here! [Key reference: http://helal7star.blogspot.sg/2014/04/microsoft-visual-studio-2010-express_12.html ]

Fix Visual Studio Update Error in Windows 8

Image
I am using Windows 8.1 build 1 (or 8.1.1) and I was having issues while installing updates for windows. It was because of Visual Studio 2010 Service Pack 1 (sp1) which was of size 195 MB and it was failing every time I tried to installed it. It was categorized as an important update so I tried following Microsoft's support blogs for the errors but had no success. So today after a little googling I found a solution to this bug.