본문 바로가기

Borland47

Shift의 의미 x>>1 = x/2x>>2 = x/4x>>3 = x/8 . . .x>>n = x/(2^n) 2011. 1. 13.
특정 파일이 있는 폴더 이름을 검색하는 함수 bool __fastcall SearchSomeFile(String path, String FileName, String &tPath) { AnsiString dir, fn, subPath; HANDLE hSrch; WIN32_FIND_DATA wfd; bool bResult = true; int length = path.Length(); if (path[length-1] != '\\') path += "\\"; dir = path + "*.*"; hSrch = FindFirstFile(dir.c_str(), &wfd); while(bResult) { if ((wfd.cFileName[0]!=_T('.') || lstrlen(wfd.cFileName)>2) && wfd.dwFileAttributes & .. 2010. 12. 27.
WideString 결과값과 HTML에서 표기 되는 유니코드값의 차이 "박"을 WideString("박")으로 처리해서 나온 결과값은 \xBC15이다. 그러나 이 값을 html code에 적용하면 화면에 표시가 되지 않는다. 따라서 \xBC15 => 박 로 변경해서 처리해야 한다. (16진수)Hex인 BC15를 10진수로 변경하면 48149값이 나온다. void __fastcall TPrintBrowserWindow::AnsiToUnicode(AnsiString TextString, AnsiString &UnicodeString) { int length, wlength=0; WideString w_string = WideString(TextString); length = TextString.Length(); wlength = wcslen(w_string.c_bstr());.. 2010. 4. 22.
HexStr을 TColor로 변경 하는 함수 TColor __fastcall TLayerForm::HexStrToTColor(AnsiString Hex) { TColor color = 0; int length = StrLen(Hex.c_str()); int value = 0; char ch1, ch2; unsigned char array[3] = {0}; for (int i = 0, j = 0; i ='A' && ch1='a' && ch1='A' && ch2='a' && ch2 2010. 4. 22.
Excel ColumnWidth 변경 매크로 Sub Macro1()'' Macro1 Macro' 박상훈이(가) 2010-02-01에 기록한 매크로'' 바로 가기 키: Ctrl+k' Columns("A:X").Select Selection.ColumnWidth = 4End Sub 2010. 2. 1.
StringGrid 셀 병합 및 표시방법 세팅 1. StringGrid Component Setting - DefaultDrawing = false; - FixedCols = 0; - FixedRows = 0; - LineColor = clBtnShadow; Canvas; ACanvas->Brush->Color = clWhite; ACanvas->Pen->Color = clBtnShadow; if (ACol%2) { CellRect = StringGrid->CellRect(ACol-1,ARow); Rect.Left = CellRect.Left; CellRect = StringGrid->CellRect(ACol,ARow); Rect.Right = CellRect.Right; if (ACol%4 == 1) ACanvas->Brush->Color = cl.. 2010. 1. 22.
Excel 셀에 데이터 넣고 색을 바꾸는 방법 void __fastcall FillColorCell(int row, int col, int ColorIndex) { try { Variant cell, column, interior; cell = xlSheet.OlePropertyGet("Cells", row, col); column = cell.OlePropertyGet("Columns"); interior = column.OlePropertyGet("Interior"); interior.OlePropertySet("ColorIndex", ColorIndex); interior.OlePropertySet("Pattern", 1); //1 - xlSolid } catch(...) { } } 2010. 1. 19.
Excel 설치 여부 확인 #include //..... Variant xlApp; try { xlApp = GetActiveOleObject("Excel.Application"); } catch(...) { ShowMessage("엑셀 프로그램이 없습니다."); } //..... 2010. 1. 19.
Excel의 셀에 이미지 삽입 방법 아래 두 함수를 한번 살표 보세요 ExcelInsertImage SaveBitmapToExcel // Variant V; Variant excel_app; Variant excel_window; Variant excel_book; Variant my_worksheet; //---------------------------------------------------------------------------- void __fastcall TDLG_RPT_EXCEL::ExcelOpen() { excel_app=Variant::CreateObject("excel.application"); excel_app.OlePropertySet("Visible", (Variant)false); } //-----------.. 2010. 1. 19.
LIST