jon 80
Posts
-
opengl (openTK) -
Value of label is not changing upon loading or changing the value of the comboboxWhy isn't the following changing the value of the label LanguageSpoken?
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
LanguageSpoken.Text = cboUserLanguage.SelectedText;
}private void Form1\_Load(object sender, EventArgs e) { cboUserLanguage.SelectedIndex = 0; LanguageSpoken.Text = cboUserLanguage.SelectedText; }
Jon
-
Access is deniedI'm getting the following error with VS2010 (still training), and, I can create a text file within this directory and as a matter of fact the executable is being created, so why is this error being displayed? :confused:
Warning GettingStarted Could not create output directory 'C:\Documents and Settings\Jon\My Documents\Visual Studio 2010\Projects\Training\CreateEventLog\GettingStarted\GettingStarted\bin\Debug\'. Access is denied.
1Jon
-
[error] controlRenderingCompatibilityVersion' attribute is not declared [modified]I'm using Visual Studio 2010 (.NET 3.5), which still has .NET 4.0 installed because I had to uninstall Visual Studio 2010. When I'm loading this code within Visual Studio 2008, an error is being displayed that seems to be triggered by: web.config ... <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"> <controls> <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls></pages> <httpHandlers> ... Errors: 1. Warning 1 C:\Documents and Settings\Jon\My Documents\Downloads\Beginning_ASP_NET_3_5_in_C_2008_From_Novice_to_Professional_Second_Edition-3790\Beginning ASP.NET 3.5\Chapter11\RichControls\CalendarTest.aspx: ASP.NET runtime error: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive. (C:\Documents and Settings\Jon\My Documents\Downloads\Beginning_ASP_NET_3_5_in_C_2008_From_Novice_to_Professional_Second_Edition-3790\Beginning ASP.NET 3.5\Chapter11\RichControls\web.config line 28) C:\Documents and Settings\Jon\My Documents\Downloads\Beginning_ASP_NET_3_5_in_C_2008_From_Novice_to_Professional_Second_Edition-3790\Beginning ASP.NET 3.5\Chapter11\RichControls\CalendarTest.aspx 1 1 C:\...\RichControls\ 2. Warning 2 The 'targetFramework' attribute is not declared. C:\Documents and Settings\Jon\My Documents\Downloads\Beginning_ASP_NET_3_5_in_C_2008_From_Novice_to_Professional_Second_Edition-3790\Beginning ASP.NET 3.5\Chapter11\RichControls\Web.config 28 29 C:\...\RichControls\ 3. Warning 3 The 'controlRenderingCompatibilityVersion' attribute is not declared. C:\Documents and Settings\Jon\My Documents\Downloads\Beginning_ASP_NET_3_5_in_C_2008_From_Novice_to_Professional_Second_Edition-3790\Beginning ASP.NET 3.5\Chapter11\RichControls\Web.config 52 10 C:\...\RichControls\ 4. Warning 4 The 'clientIDMode' attribute is not declared. C:\Documents and Settings\Jon\My Documents\Downloads\Beginning_ASP_NET_3_5_in_C_2008_From_Novice_to_Professional_Second_Edition-3790\Beginning ASP.NET 3.5\Chapter11\RichControls\Web.config 52 53 C:\...\RichControls\ 5. Error 5 Unrecognized attribute 'targetFramewo
-
[newbie] EventLog log = new EventLog() does not work within catch {} block -
[newbie] EventLog log = new EventLog() does not work within catch {} blockDoes your exception block throw an exception? No, but throwing the exception prior to calling the event log makes the logging code unreachable, and, this works fine within Visual Studio 2010. Do you have a generic exception handler? No, because it is not required for now. Does your IIS user have access to write to the event log? I am using Administrator on a local PC, what user does VS 2010 use (to confirm)? Did you use System.Diagnostics.EventLog.CreateEventSource and System.Diagnostics.EventLog.WriteEntry? (Probably not, since you new'd EventLog) System.Diagnostics.CreateEventSource is not even shown up within Visual Studio 2010, even though it's a static method. Problem with Intellisense maybe.
Jon
-
[newbie] EventLog log = new EventLog() does not work within catch {} blockI'm trying to run this code within Visual Studio 2010, however, having set a breakpoint at line 39, the execution does not seem to get to line 39 where I have set a break point. As a matter of fact, when checking under Visual Studio 2010 Server Explorer > Servers > {puter name} > Application > ASP.NET 4.0.30319.0, there are no relevant events written. I also tried checking within the Windows Event Viewer. For Win XP (Control Panel > Administrative Tools > Event Viewer > Application sub node). Is this a bug with .NET 4 or Visual Studio 2010? Does this issue happen to anyone else? :confused:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;
using System.Diagnostics;public partial class ErrorTestLog : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{} protected void cmdCompute\_Click(object sender, EventArgs e) { try { decimal a, b, result; a = Decimal.Parse(txtA.Text); b = Decimal.Parse(txtB.Text); result = a / b; lblResult.Text = result.ToString(); lblResult.ForeColor = Color.Black; } catch (Exception err) { lblResult.Text = "<b>Message:</b> " + err.Message + "<br /><br />"; lblResult.Text += "<b>Source:</b> " + err.Source + "<br /><br />"; lblResult.Text += "<b>Stack Trace:</b> " + err.StackTrace; lblResult.ForeColor = Color.Red; // Write the information to the event log. EventLog log = new EventLog(); log.Source = "DivisionPage"; log.WriteEntry(err.Message, EventLogEntryType.Error); } }
}
NOTE: 1. Beginning ASP.NET 3.5 in C# in 2008 - From Novice to Professional (ISBN: 978-1-59059-891-7) P.268 (306)
Jon
-
Cannot call public method [newbie]Thanks
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using CustomException;namespace CustomException
{
class Program
{
static void Main(string[] args)
{
ArithmethicUtility utility = new ArithmethicUtility();
Decimal myNumber = utility.Divide(5, 0);
}
}public class ArithmeticUtilityException : ApplicationException { public ArithmeticUtilityException() : base() {} public ArithmeticUtilityException(string message) : base(message) {} public ArithmeticUtilityException(string message, Exception inner) : base(message, inner) {} } public class ArithmethicUtility { public decimal Divide(decimal number, decimal divisor) { try { return number / divisor; } catch (Exception err) { /\* \* Create an instance of the specialized exception class, and, \* place the original error in the InnerException property. \*/ ArithmeticUtilityException errNew = new ArithmeticUtilityException("Divide by zero", err); throw errNew; } } }
}
Jon
-
Cannot call public method [newbie]I am coding this utility to test raising of an exception, however, I have noted that Visual Studio 2010 IDE does not allow me to call the ArithmeticUtilityException.Divide() method. Why? I have also (desperately) tried to declare the class as static and the Divide() method as static, however, no joy either.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;namespace CustomException
{
class Program
{
static void Main(string[] args)
{
ArithmeticUtilityException utility = new ArithmeticUtilityException();
///Decimal myNumber = ArithmeticUtilityException.???
}
}public class ArithmeticUtilityException : ApplicationException { public ArithmeticUtilityException() : base() {} public ArithmeticUtilityException(string message) : base(message) {} public ArithmeticUtilityException(string message, Exception inner) : base(message, inner) {} } public static class ArithmethicUtility { public decimal Divide(decimal number, decimal divisor) { try { return number / divisor; } catch (Exception err) { /\* \* Create an instance of the specialized exception class, and, \* place the original error in the InnerException property. \*/ ArithmeticUtilityException errNew = new ArithmeticUtilityException("Divide by zero", err); throw errNew; } } }
}
:confused: NOTES 1. Related link Static Classes and Static Class Members (C# Programming Guide)
2. Personal note. ..\Training\CustomException.Jon
-
Pass by valueI haven't tried it as yet, that's why I asked for a code sample, because I want to understand.
Jon
-
Pass by value"One notable quirk occurs when you use the standard pass-by-value mechanism. In this e, pass-by-value doesn’t create a copy of the object, but a copy of the reference. This refer- e still points to the same in-memory object. This means that if you pass a Product object t ethod, for example, the method will be able to alter your Product object, regardless of ther you use pass-by-value or pass-by-reference." Beginning ASP.NET 3.5 in C# 2008 (ISBN-13 (pbk): 978-1-59059-891-7) P.69 Can anyone provide a code snippet to demonstrate the above? If the above were a valid statement, wouldn't this be a bug in the .NET 3.5 framework?
Jon
-
[newbie] error C2065: 'b' : undeclared identifierResolved that by including 'using namespace std;'. Now it reads: C1010 - unexpected eof. Says it needs a header file, but I "forgot" what to include. Afiak the header file includes: #pragma once ... ...and the headers of the methods used in my case... int main... However, it's strange that the default template created by visual studio with a main method did not require a .header file.
// SieveOfErathostenes.cpp : main project file.
#include <bitset>
#include <iostream>
#include <ctime>using namespace System;
using namespace std;int main(array<System::String ^> ^args)
{
const int N = 2000000;
clock_t cstart = clock();std::bitset<N + 1> b; int count = 0; int i; for (i = 2; i <= N; i++) b.set(i); i = 2; while (i \* i <= N) { if (b.test(i)) { count++; int k = 2 \* i; while (k <= N) { b.reset(k); k += i; } } i++; } while (i <= N) { if (b.test(i)) count++; i++; } clock\_t cend = clock(); double millis = 1000.0 \* (cend - cstart) / CLOCKS\_PER\_SEC; cout << count << " primes \\n" << millis << " milliseconds\\n"; return 0;
}
Sieve.h
#pragma once
#include <iostream>int main(array<System::String ^> ^args);
Related links: C++ Header files[^]
Jon
-
[newbie] error C2065: 'b' : undeclared identifierHis post did not help much anyway :)
Jon
-
[newbie] error C2065: 'b' : undeclared identifierThat's what I've been told ma'am :) Btw, that's a note for me...I tend to note sources of references like I used to when I woz at school. http://www.codeproject.com/Forums/1647/C-Cplusplus-MFC.aspx[^]
Jon
-
[newbie] error C2065: 'b' : undeclared identifierAny idea why doesn't this compile?
// SieveOfErathostenes.cpp : main project file.
#include "stdafx.h"
#include <bitset>
#include <iostream>
#include <ctime>using namespace System;
int main(array<System::String ^> ^args)
{
const int N = 2000000;
clock_t cstart = clock();**bitset<N + 1> b;** int count = 0; int i; for (i = 2; i <= N; i++) b.set(i); i = 2; while (i \* i <= N) { if (b.test(i)) { count++; int k = 2 \* i; while (k <= N) { b.reset(k); k += i; } } i++; } while (i <= N) { if (b.test(i)) count++; i++; } clock\_t cend = clock(); double millis = 1000.0 \* (cend - cstart) / CLOCKS\_PER\_SEC; cout << count << " primes \\n" << millis << " milliseconds\\n"; return 0;
}
Errors: Error 4 error C2065: 'b' : undeclared identifier c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 19 SieveOfErathostenes Error 5 error C2228: left of '.set' must have class/struct/union c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 19 SieveOfErathostenes Error 6 error C2065: 'b' : undeclared identifier c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 24 SieveOfErathostenes Error 7 error C2228: left of '.test' must have class/struct/union c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 24 SieveOfErathostenes Error 8 error C2065: 'b' : undeclared identifier c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 30 SieveOfErathostenes Error 9 error C2228: left of '.reset' must have class/struct/union c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 30 SieveOfErathostenes Error 10 error C2065: 'b' : undeclared identifier c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 39 SieveOfErathostenes Error 11 error C2228: left of '.test' must have
-
[newbie] error C2065: 'b' : undeclared identifierAny idea why this code doesn't compile? <pre> // SieveOfErathostenes.cpp : main project file. #include "stdafx.h" #include <bitset> #include <iostream> #include <ctime> using namespace System; int main(array<System::String ^> ^args) { const int N = 2000000; clock_t cstart = clock(); bitset<N + 1> b; int count = 0; int i; for (i = 2; i <= N; i++) b.set(i); i = 2; while (i * i <= N) { if (b.test(i)) { count++; int k = 2 * i; while (k <= N) { b.reset(k); k += i; } } i++; } while (i <= N) { if (b.test(i)) count++; i++; } clock_t cend = clock(); double millis = 1000.0 * (cend - cstart) / CLOCKS_PER_SEC; cout << count << " primes \n" << millis << " milliseconds\n"; return 0; } </pre> Errors: Error 4 error C2065: 'b' : undeclared identifier c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 19 SieveOfErathostenes Error 5 error C2228: left of '.set' must have class/struct/union c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 19 SieveOfErathostenes Error 6 error C2065: 'b' : undeclared identifier c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 24 SieveOfErathostenes Error 7 error C2228: left of '.test' must have class/struct/union c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 24 SieveOfErathostenes Error 8 error C2065: 'b' : undeclared identifier c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 30 SieveOfErathostenes Error 9 error C2228: left of '.reset' must have class/struct/union c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 30 SieveOfErathostenes Error 10 error C2065: 'b' : undeclared identifier c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfEratho
-
[newbie] error C2065: 'b' : undeclared identifierAny idea why this code doesn't compile?
// SieveOfErathostenes.cpp : main project file.
#include "stdafx.h"
#include <bitset>
#include <iostream>
#include <ctime>using namespace System;
int main(array<System::String ^> ^args)
{
const int N = 2000000;
clock_t cstart = clock();bitset<N + 1> b; int count = 0; int i; for (i = 2; i <= N; i++) b.set(i); i = 2; while (i \* i <= N) { if (b.test(i)) { count++; int k = 2 \* i; while (k <= N) { b.reset(k); k += i; } } i++; } while (i <= N) { if (b.test(i)) count++; i++; } clock\_t cend = clock(); double millis = 1000.0 \* (cend - cstart) / CLOCKS\_PER\_SEC; cout << count << " primes \\n" << millis << " milliseconds\\n"; return 0;
}
Errors: Error 4 error C2065: 'b' : undeclared identifier c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 19 SieveOfErathostenes Error 5 error C2228: left of '.set' must have class/struct/union c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 19 SieveOfErathostenes Error 6 error C2065: 'b' : undeclared identifier c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 24 SieveOfErathostenes Error 7 error C2228: left of '.test' must have class/struct/union c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 24 SieveOfErathostenes Error 8 error C2065: 'b' : undeclared identifier c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 30 SieveOfErathostenes Error 9 error C2228: left of '.reset' must have class/struct/union c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 30 SieveOfErathostenes Error 10 error C2065: 'b' : undeclared identifier c:\Users\Administrator\Documents\Visual Studio 2008\Projects\SieveOfErathostenes\SieveOfErathostenes\SieveOfErathostenes.cpp 39 SieveOfErathostenes Error 11 error C2228: left of '.test' must have
-
Visual Studio installation issues on Windows Server 2008 (64 bit)Due to a problem with one of my ASP.NET applications I set out to install: 1. Visual Studio 2005 - known compatibility issues with OS as prompted AFTER the installation process; no relevant SP found that is compatible with the OS. The closest I got was to try and install the version available for Vista, however, this is an x86 version and does not install anyway. 2. Visual Studio 2008 + SP1 - Installation due to corrupt file dexplore.exe. Any idea where to get this file? OS: Win Server 2008 64bit Installation log file for VS 2008 --------------------------------- [05/10/09,08:17:59] Microsoft Document Explorer 2008: [2] Error unpackaging j:\setup\..\wcu\dexplore\dexplore.exe: Corrupt cabinet [05/10/09,08:17:59] setup.exe: [2] ISetupComponent::Pre/Post/Install() failed in ISetupManager::InternalInstallManager() with HRESULT -2147467259. [05/10/09,08:17:59] VS70pgui: [2] DepCheck indicates Microsoft Document Explorer 2008 is not installed. [05/10/09,08:17:59] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio Web Authoring Component was not attempted to be installed. [05/10/09,08:17:59] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio 2008 Professional Edition - ENU was not attempted to be installed. [05/10/09,08:17:59] VS70pgui: [2] DepCheck indicates Microsoft .NET Compact Framework 2.0 SP2 was not attempted to be installed. [05/10/09,08:17:59] VS70pgui: [2] DepCheck indicates Microsoft .NET Compact Framework 3.5 was not attempted to be installed. [05/10/09,08:17:59] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0 Runtime) was not attempted to be installed. [05/10/09,08:17:59] VS70pgui: [2] DepCheck indicates Microsoft Visual Studio 2005 Tools for the 2007 Microsoft Office System Runtime was not attempted to be installed. [05/10/09,08:17:59] VS70pgui: [2] DepCheck indicates Microsoft SQL Server Compact 3.5 Design Tools was not attempted to be installed. [05/10/09,08:17:59] VS70pgui: [2] DepCheck indicates Microsoft SQL Server Compact 3.5 For Devices was not attempted to be installed. [05/10/09,08:18:00] VS70pgui: [2] DepCheck indicates Windows Mobile 5.0 SDK R2 for Pocket PC was not attempted to be installed. [05/10/09,08:18:00] VS70pgui: [2] DepCheck indicates Windows Mobile 5.0 SDK R2 for Smartphone was not attempted to be installed. [05/10/09,08:18:00] VS70pgui: [2] DepCheck indicates Microsoft Device Emulator version 3.0 (x64) was not attempted to be installed. [05/10/09,08:18:00] VS70pgui: [2] DepCheck in
-
degree of multithreading [modified]lol
Jon
-
[newbie] 'aspnet_compiler' is not recognized as an internal or external command [modified]I was following a step by step in order to pre-compile an application. However I noted that the aspnet_compiler is within the v2.50727 folder not the v3.5 folder, as I would have expected.
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>aspnet_compiler -p C:\Inetpub\wwwr
oot\Blog -v / c:\Deploy -u
Utility to precompile an ASP.NET application
Copyright (C) Microsoft Corporation. All rights reserved.C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727>
As a matter of fact it is noted that 1. Banner in the master page is not being rendered with this pre-compilated page2 See http://cid-b712073b3513eb8e.skydrive.live.com/self.aspx/.Public/Blog-anomaly.docx[^] The uploaded and compiled website looks like this: http://aspspider.info/jon80/Default.aspx[^] NOTE: Every now and then loading the website gives an error: Service not available. Anyone encountered similar issues? Ideas?? :confused: Related links http://msdn.microsoft.com/en-us/library/ms227976.aspx[^]
Jon
modified on Saturday, May 9, 2009 9:23 AM