http://www.jynote.net/551


NetCDF 예제와 관련해서 기록해두기


Posted by 모과이IT
,

https://www.codeproject.com/Articles/950/CDirectoryChangeWatcher-ReadDirectoryChangesW-all


ReadDirectoryChangesW(Win 32 API)기반의 폴더의 파일 이벤트 감지 샘플 소스



Posted by 모과이IT
,

Right-click on your project ->
Properties -> 
Configuration Properties ->
Linker ->
Advanced and changed "Image Has Safe Exception Handlers" to "No (/SAFESEH:NO)"




[참고사이트]

http://stackoverflow.com/questions/14710577/error-lnk2026-module-unsafe-for-safeseh-image

Posted by 모과이IT
,

VS2013에서 MBCS(Multi-Byte Character Set)로 설정된 MFC 프로젝트를 컴파일하면 다음과 같은 에러 발생한다.

 

error MSB8031: Building an MFC project for a non-Unicode character set is deprecated. You must change the project property to Unicode or download an additional library. See http://go.microsoft.com/fwlink/p/?LinkId=286820 for more information. C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V120\Microsoft.CppBuild.targets 369 5 IOKF_Client

 

 

2013 부터는 MBCS용 MFC 라이브러리(DLL)가 제공되지 않는다.

디볼트인 유니코드를 사용 권장하기 때문... --;

 

 

아래 사이트에서 다운받고 설치하면 된다.

http://www.microsoft.com/ko-kr/download/details.aspx?id=40770


출처 : http://intra97.tistory.com/240



Posted by 모과이IT
,

Problem: VS2010 crashes the instance you enter a character or paste text into a source file. The message displayed (sometimes - other times VS2010 simply dies and disappears without further notice) is:


Visual Studio has encountered an exception. This may be caused by an extension. You can get more information by running the application together with the /log parameter on the command line, and then examining the file 'C:\Users\USERNAME\AppData\Roaming\Microsoft\VisualStudio\10.0\ActivityLog.xml'


Solution: The solution was found in this forum, which states:

It appears to be due to missing registry information. Adding the default value to the below registry key solved the problem.


On 32-Bit Windows: [HKEY_CLASSES_ROOT\CLSID\{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32]


On 64-Bit Windows: [HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{73B7DC00-F498-4ABD-AB79-D07AFD52F395}\InProcServer32]


The "(Default)" value should be one of the following:On 32-Bit Windows: "C:\Program Files\Common Files\Microsoft Shared\MSEnv\TextMgrP.dll"


On 64-Bit Windows: "C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\TextMgrP.dll"

Posted by 모과이IT
,

Excel Automation ( 4. Save As )


 COleVariant VOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
 COleVariant VTrue((short)TRUE);
 COleVariant VFalse((short)FALSE);

 // TODO: Add your control notification handler code here
 book.SaveAs(COleVariant("C:Master_.xls"), VOptional, VOptional, VOptional, VOptional, VOptional,
      0, VOptional, VOptional, VOptional, VOptional, VOptional);

 

Posted by 모과이IT
,

Excel Automation ( 3. 데이타 쓰기 )


 Range range;
 CString sTemp = "124";
 range = sheet.GetRange(COleVariant("A1"), COleVariant("A1"));
 range.SetValue2(COleVariant(sTemp));

 

Posted by 모과이IT
,

Excel Automation ( 2. 소멸 )


 COleVariant VOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
 COleVariant VTrue((short)TRUE);
 COleVariant VFalse((short)FALSE);

 book.Close(VFalse, VOptional, VOptional); 
// 모든 Ole 객체 소멸
 sheet.ReleaseDispatch();
 sheets.ReleaseDispatch();
 book.ReleaseDispatch();
 books.ReleaseDispatch();
 app.Quit();
 app.ReleaseDispatch(); 

 

'개발지식창고 > MFC' 카테고리의 다른 글

Excel Automation ( 4. Save As )  (0) 2012.06.29
Excel Automation ( 3. 데이타 쓰기 )  (0) 2012.06.29
MFC와 Excel 연동 관련 자료  (0) 2012.06.29
Excel Automation ( 1. 생성 및 변수 초기화 )  (0) 2012.06.29
CArchive클래스  (0) 2012.04.14
Posted by 모과이IT
,

MFC와 Office(Excel)연동 관련


MFC를 사용하여 Excel 자동화 및 새 통합 문서 만들기/서식 지정하기

http://support.microsoft.com/kb/179706/ko


MFC와 Visual C++ 2005 또는 Visual C++ .NET을 사용하여 Excel 워크시트를 포함하고 자동화하는 방법

http://support.microsoft.com/kb/311546/ko


Excel에 관해 알려지지 않은 팁에 대한 설명

http://support.microsoft.com/kb/843504/ko


C++에서 MFC나 #import!를 사용하지 않고 Excel을 자동화하는 방법

http://support.microsoft.com/kb/216686/ko


VC++에서 복합 문서 속성을 직접 읽는 방법

http://support.microsoft.com/kb/186898/ko


MFC를 사용하여 Office 자동화 서버의 창 핸들을 가져오는 방법

http://support.microsoft.com/kb/261997/ko


MFC에서 Microsoft Excel 워크시트를 포함시키고 자동화하는 방법

http://support.microsoft.com/kb/184663/ko


Visual C# .NET에서 자동화를 사용하여 Office 문서 속성을 가져오고 설정하기

http://support.microsoft.com/kb/303296/ko


Visual C++ .NET과 MFC를 사용하여 Office 응용 프로그램이 표시하는 대화 상자를 해제하는 방법

http://support.microsoft.com/kb/310744/ko


'개발지식창고 > MFC' 카테고리의 다른 글

Excel Automation ( 3. 데이타 쓰기 )  (0) 2012.06.29
Excel Automation ( 2. 소멸 )  (0) 2012.06.29
Excel Automation ( 1. 생성 및 변수 초기화 )  (0) 2012.06.29
CArchive클래스  (0) 2012.04.14
MFC SDI 객체 간의 접근  (0) 2012.04.14
Posted by 모과이IT
,

Excel Automation ( 1. 생성 및 변수 초기화 )


 COleVariant VOptional((long)DISP_E_PARAMNOTFOUND, VT_ERROR);
 COleVariant VTrue((short)TRUE);
 COleVariant VFalse((short)FALSE);

 TRY
 {  
  //-----------------------------------------------------*
  // app 엑셀 오브젝트 생성
  //-----------------------------------------------------*
  if(!app.CreateDispatch("Excel.Application")) // 엑셀 실행.
  {
   AfxMessageBox("Could not start EXCEL!");
   return;
  }
  app.SetVisible(true); // 화면 디스플레이.

  //-----------------------------------------------------*
  // Get Workbooks
  //-----------------------------------------------------*
  LPDISPATCH lpdisp;
  lpdisp=app.GetWorkbooks();  // 파일 단위..
  ASSERT(lpdisp);
  books.AttachDispatch(lpdisp);
  //-----------------------------------------------------*
  // FileOpen
  //-----------------------------------------------------*
  /* // 파일을 오픈할 경우.
  books.Open( "c:\\Master.xls", VOptional, VFalse,
     VOptional, VOptional, VOptional,
     VOptional, VOptional, VOptional,
     VTrue, VOptional, VOptional,
     VFalse, VOptional, VOptional);
  */

  //-----------------------------------------------------*
  // Get WorkBook
  //-----------------------------------------------------*
  lpdisp=books.Add(VOptional);                                 //새로운 엑셀객체를 생성하였을 경우
  //lpdisp=books.Get_Default(COleVariant((short)(1))); //FileOpen()일 경우
  ASSERT(lpdisp);
  book.AttachDispatch(lpdisp);

  //-----------------------------------------------------*
  // Get WorkSheets
  //-----------------------------------------------------*
  lpdisp=book.GetSheets();                                           // 북에서 Sheets 를 얻어옴.
  ASSERT(lpdisp);
  sheets.AttachDispatch(lpdisp);
  //-----------------------------------------------------*
  // Get WorkSheet
  //-----------------------------------------------------*
  //lpdisp=sheets.GetItem(COleVariant((short)(1)));        // Sheets에서 해당 Sheet 순서로 얻어오기.
  //lpdisp=sheets.GetItem(COleVariant("Index"));            // Sheets에서 해당 Sheet 명으로 얻어오기
  //ASSERT(lpdisp);
  //sheet.AttachDispatch(lpdisp);

  lpdisp=sheets.Add(VOptional, VOptional, COleVariant((short)(3)), VOptional ); // Sheet 3개 추가
  ASSERT(lpdisp);

  lpdisp=sheets.GetItem(COleVariant((short)(1)));            // Sheet 명 부여하기
  ASSERT(lpdisp);
  sheet.AttachDispatch(lpdisp);
  sheet.SetName("UserIndex");

  lpdisp=sheets.GetItem(COleVariant((short)(2)));
  ASSERT(lpdisp);
  sheet.AttachDispatch(lpdisp);
  sheet.SetName("Peak");

  lpdisp=sheets.GetItem(COleVariant((short)(3)));
  ASSERT(lpdisp);
  sheet.AttachDispatch(lpdisp);
  sheet.SetName("Distance");

 }
 CATCH(CException, e)
 {
  book.Close(VFalse, VOptional, VOptional); 
  app.Quit();
  app.ReleaseDispatch();
 }
 END_CATCH 

 

출처 : http://justinoh.tistory.com/category/?page=12


'개발지식창고 > MFC' 카테고리의 다른 글

Excel Automation ( 2. 소멸 )  (0) 2012.06.29
MFC와 Excel 연동 관련 자료  (0) 2012.06.29
CArchive클래스  (0) 2012.04.14
MFC SDI 객체 간의 접근  (0) 2012.04.14
MDI 구조  (0) 2012.04.05
Posted by 모과이IT
,