전체 글
-
error C2259: CException cannot instantiate abstract classIT/Visual Studio 2011. 6. 14. 00:52
Visual Studio 6.0 에서 문제 없던 아래 코드가 VisualStudio 2005 이상 버전으로 컨버팅 시에 제목과 같은 에러가 나는 경우에 대한 해결책이다. error C2259 : CException cannot instantiate abstract class ( Visual Studio 한글판에서의 에러 표시문구) CException : 추상 클래스를 인스턴스화 할수 없습니다 해결방안 catch( CException ex ){ .... } 위와 같은 코드에서 에러가 날 것이다 .상기 코드를 catch( CException& ex){ ... } 이렇게 고쳐주면 된다.
-
error c2039: 'ReadHuge' is not a member of 'CFile'IT/Visual Studio 2011. 6. 14. 00:52
Visual Studio 6.0 에서 문제 없던 아래 코드가 VisualStudio 2005 이상 버전으로 컨버팅 시에 에러가 나는 경우에 대한 해결책이다. JobFile.ReadHuge(pData,dwFileLength); error c2039: 'ReadHuge' is not a member of 'CFile' 해결 방법 ReadHuge 대신에 Read 를 쓴다 예 ) JobFile.Read(pData,dwFileLength);
-
error C2663: 'ATL::CSimpleStringT<BaseType,t_bMFCDLL>::GetBuffer' : 2 overloads have no legal conversion for 'this' pointerIT/Visual Studio 2011. 6. 14. 00:51
Visual Studio 6.0 에서는 아무 문제없던 코드가 Visual Studio 2005 이상 에서 컨버팅 했을 경우 제목과 같은 에러가 뜨는 경우가 있다. strcpy(ptr->ncp_acct, pSplitAcctArr->GetAt(i).GetBuffer(0)); 위와 같은 코드는 strcpy(ptr->ncp_acct, ((CString)pSplitAcctArr->GetAt(i)).GetBuffer(0)); 이렇게 고쳐야 한다. 즉, CString 으로 캐스팅 해 주는 것이다.
-
C# 에서 줄 단위로 입력 받기IT/C# 2011. 6. 8. 03:17
using System; using System.IO; namespace test { class Program { static void Main(string[] args) { string text = "Hello\nWorld\n\nHello World"; using (StringReader reader = new StringReader(text)) { string line; while ((line = reader.ReadLine()) != null) { Console.WriteLine(line); } } Console.ReadLine(); } } }
-
STL 에서 map 의 데이터로 struct 형을 사용하기IT/STL 2011. 5. 11. 05:41
STL 의 템플릿은 매우 강력하지만, struct 의 경우 map 의 멤버 타입으로 사용할 때 주의를 요한다. 일반적으로 그냥 struct 만 선언해서는 map 에 넣을 수 없다. struct Node { int a; int b; }; Node node; node.a = 2; node.b = 3; map aa; aa[1]=1; //O.K. map bb; bb[node]=1; //Compile Error 정상적으로 사용하기 위해서는 아래와 같이 < 연산자에 대해 오버라이딩 해 주어야 한다. 주의할 것은 아래는 < 연산자 오버라이딩의 한 예일 뿐이며, 본인의 코드 로직에 맞는 오버라이딩을 해 주어야 한다. bool operator
-
Visual Studio 2008 실행시 / 재설치시에 오류 해결방법IT/Visual Studio 2011. 4. 28. 04:09
Visual Studio 2008 을 사용 중에 플러그인이나 핫픽스를 설치하던 도중 Visual Studio 가 꼬인 경우, 잘 쓰다가 어느날 갑자기 알수 없는 이유로 Visual Studio 2008 가 정상적으로 실행되지 않는 경우에 대한 해결방법이다. (보통 이런 경우는 재설치 / 삭제도 제대로 안되는 난간함 경우이다. ) - 아래의 레지스트리 키를 삭제해 주면 된다. 한글판 HKEY_LOCAL_MACHINE 밑의 SOFTWARE\Classes\Installer\products\2F5B0C81B134C6130A6B87589A22B84A\Patches\Patches 삭제 영문판 HKEY_LOCAL_MACHINE 밑의 SOFTWARE\Classes\Installer\products\DCC60C0870D..
-
C#, ASP.NET 에서 MS SQL 에 Windows Authentication (윈도우즈 인증) 으로 접속하기.IT/DB 2011. 4. 28. 03:44
MS SQL 에 접속하기 위해서는 MS SQL Server 인증, 그리고 Windows Authentication 인증의 두가지 방법이 있다. 우선, Windows Authentication 은 MS SQL Server 인증과 달리 id, password 를 사용하지 않고, integrated security 라는 항목이 추가된다는 점이 가장 큰 차이점이다. DataSource 문장은 아래와 같다. "data source=Sql01;initial catalog=Northwind; integrated security=SSPI;persist security info=False; Trusted_Connection=Yes." 예제 private void DataBind() { sqlConnection = Sql..