CDC *pDC = GetDC();
int nDevCaps = ::GetDeviceCaps(pDC->GetSafeHdc(), LOGPIXELSY);
m_nFontSize = -MulDiv(m_lf.lfHeight, 72, nDevCaps);
ReleaseDC(pDC);


위의 방법대로 적용하면 된다.
특히

m_nFontSize = -MulDiv(m_lf.lfHeight, 72, nDevCaps);


이 부분이 관건이다. 여기서 모든 계산식이 들어가게 된다.

int nDevCaps = ::GetDeviceCaps(pDC->GetSafeHdc(), LOGPIXELSY);


이 부분은 위의 계산식에서 필요한 값이다.



728x90

키보드 Windows 키의 설정을 해제하는 방법


본 문서의 정보는 다음의 제품에 적용됩니다.
  • Microsoft Windows NT Workstation 4.0, 4.0 SP1, 4.0 SP2, 4.0 SP3 및 4.0 SP4
  • Microsoft Windows NT Workstation 4.0, 4.0 SP1, 4.0 SP2, 4.0 SP3 및 4.0 SP4
  • Microsoft Windows NT Workstation 4.0, 4.0 SP1, 4.0 SP2, 4.0 SP3 및 4.0 SP4
  • Microsoft Windows NT Workstation 4.0, 4.0 SP1, 4.0 SP2, 4.0 SP3 및 4.0 SP4
  • Microsoft Windows NT Workstation 4.0, 4.0 SP1, 4.0 SP2, 4.0 SP3 및 4.0 SP4
  • Microsoft Windows NT Server 4.0, 4.0 SP1, 4.0 SP2, 4.0 SP3 및 4.0 SP4
  • Microsoft Windows NT Server 4.0, 4.0 SP1, 4.0 SP2, 4.0 SP3 및 4.0 SP4
  • Microsoft Windows NT Server 4.0, 4.0 SP1, 4.0 SP2, 4.0 SP3 및 4.0 SP4
  • Microsoft Windows NT Server 4.0, 4.0 SP1, 4.0 SP2, 4.0 SP3 및 4.0 SP4
  • Microsoft Windows NT Server 4.0, 4.0 SP1, 4.0 SP2, 4.0 SP3 및 4.0 SP4
  • Microsoft Windows NT Server, Enterprise Edition 4.0 및 4.0 SP4
  • Microsoft Windows NT Server, Enterprise Edition 4.0 및 4.0 SP4
  • Microsoft Windows 2000 Professional
  • Microsoft Windows 2000 Server
  • Microsoft Windows 2000 Advanced Server
이 문서는 이전에 다음 ID로 출판되었음: KR216893

요약



요즘의 새로운 많은 컴퓨터 키보드에서 사용할 수 있는 Windows 키의 설정을 해제할 수 있습니다. 이 키는 대개 시작 단추나 다른 Windows NT 기능으로의 바로 가기 액세스를 제공합니다.

추가 정보





Windows 키의 설정을 해제하려면 아래 단계를 수행합니다.

  1. 시작을 누르고 실행을 누른 다음
    regedt32를 입력하고 확인을 누릅니다.
  2. 메뉴에서 HKEY_LOCAL_ MACHINE(로컬 시스템)을 누릅니다.
  3. SystemCurrentControlSetControl 폴더를 누른 다음 Keyboard Layout 폴더를 두 번 누릅니다.
  4. 편집 메뉴에서 값 추가를 누르고
    Scancode Map을 입력하고 데이터 형식으로 REG_BINARY를 누른 다음 확인을 누릅니다.
  5. 데이터 필드에
    00000000000000000300000000005BE000005CE000000000을 입력한 다음 확인을 누릅니다.

  6. 레지스트리 편집기를 닫고 컴퓨터를 다시 시작합니다.

728x90
NT류 윈도우에서는 unicode로 하지 않으면 이상하게 edit control에 한글이

입력시마다 깨져서 나오져.. 근데 우낀건 paste로 한글을 쓰면 써지더군요..

그걸 window98에 가서 해보면 잘되져.. 근데 모두 98만 쓰는것두 아니고

그렇다고 unicode로 하자니 98에서 안되고...

어디가도 해결법을 찾을수 없어서 고민고민하다가 이상한 방식으로 해결했습니다.

뭐 근본적인 문제는 뭔지 알수 없지만...

방법은 edit control을 서브클래싱해서 WM_IME_CHAR메세지를 처리해 줍니다.

LRESULT OnImeChar(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
  static char kk[3];
        
  kk[0] = (char) (wParam >> 8);
  if(kk[0]==0x00)
  {
     bHandled=FALSE;
     return 0;
  }
  kk[1] = (char) wParam & 0xff;
  SendDlgItemMessage(IDC_MYEDIT, EM_SETSEL, 0, -1);
  SendDlgItemMessage(IDC_MYEDIT, EM_SETSEL, -1, 0);
  SendDlgItemMessage(IDC_MYEDIT, EM_REPLACESEL, FALSE, (LPARAM) kk);

  return 0;
}

그럼 됩니다. ㅋㅋ

참고로 ATL에서 서브클래싱하는것도 히한하죠..

생성자에서..

CContainedWindow m_EditCtrl;

CMyClass() : m_EditCtrl(_T("EDIT"), this, 1)
{
  m_bWindowOnly = TRUE;
  m_Total=0;
  CalcExtent(m_sizeExtent);
  m_sClient=0;
}

메세지맵에서..

BEGIN_MSG_MAP(CMyClass)
  CHAIN_MSG_MAP(CComCompositeControl<CMyClass>)
  MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
  ...
ALT_MSG_MAP(1)
  MESSAGE_HANDLER(WM_IME_CHAR, OnImeChar)
BEGIN_MSG_MAP(CMyClass)

...

LRESULT OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
   m_EditCtrl.SubclassWindow(GetDlgItem(IDC_MYEDIT));
....


제가 별로 아는게 없어서 되는대로 했는데

더 괞찮게 하는 방법이 있으면 답변달아주세여........

tab    tab되나????
728x90
다중 상속을 받은 클래스를 생성하는 것 만큼
삭제하는것이 쉽지 않다.
이 문제의 발생 원인은 다중 상속에서 인해,
Construct 와 Destruct 의 역할 분배에서 생기는 문제 인듯 싶다.
하지만, 이는 정확한 정보는 아니고 오로지 개인적인 짐작에 불과하다.

하지만 현재 제작중에 발생한 문제이기 때문에, 이 문제를 언급한다.

class A : public CA, public CB {};

가 있다.
이를 생성하기 위해 new A 를 해서 CB *pB 에다 담는다.
CB *pB = new A();

그후에 이를 지우려 하는데, Assert 에러를 낸다.
그 이유가 CA로써 지우는 건지 CB로써 지우는건지 명확치 않아서 발생하는 것 같았다.
그래서 약간 변형을 가했다.

   delete (CA *)pB;

이렇게 지우자 문제가 사라졌다.
게다가, CB에서는 Construct와 Destruct가 없는 상황이기 때문에, 더욱 이렇게 할 수 밖에 없는듯 싶다.

이 관계를 잘 파악해야 하겠다.
728x90
보통 애니메이션 관련 동호회에 가면 수많은 애니메이션들이 있는데,
그 소스가 공중파로 돌아다니는 HD-TV 이거나 DVD 인경우가 많죠.
그 중 DVD에서 얻어진것은 역시 광고를 억지로 자르고 편집한 것이 아니라,
깔끔하고 정확한 시간에 종료되게 일괄적으로 만들 수 있죠..

이렇게 좋은 DVD-Rip 자료를 다시.. DVD로 변경하는 작업을 시작했습니다.
DVD-Rip의 최대 단점은 역시 PC에서 밖에 읽을 수 없다는 것입니다.
(물론 X-BOX에서는 칩달고 프로그램깔면.. 된다는 일설도 있지만.. 잘 모르겠습니다.)
PS2가 있는데.. 이 녀석은 절대 플레이가.. 안되는 문제가 발생했죠...

그래서 ... 그럼.. 영상 DVD로 만들어 버리자! 라는 황당한 결론을 냈습니다.
그래서 이런 저런 자료를 수집하고 실험을 한 결과를 적으려 합니다.


보통 Rip 형식으로 만들어진 동영상은 MPG4 형태를 근간으로 만들어져 있습니다.
그래서 영상의 변화값만을 담은 최적화 압축기법으로 만들어진 동영상이 담겨 있죠.

그에 반해 DVD 안에 담긴 영상은 MPG2 형식으로 이른바 여러장의 그림들을 연결해
만든 동영상이 담겨 있습니다.

그러므로 용량적 차이가 엄청나죠... 어느정도 이것을 감안 하시고 제작을 하셔야 합니다.

먼저 준비물은 다음과 같습니다.

DVD를 굽기 위한 DVD-RW Recorder  ( 저같은 경우에는 SONY DRU-500A )
동영상을 볼 수 있는 코덱들 (저 같은 경우에는 통합 코덱 )
Virtual Dub 1.52 ( 무료로 다운 받을 수 있습니다. ) [url]http://virtualdub.sourceforge.net/[/url]
Virtual Dub Plugin  SubTitle [url]http://www.virtualdub.org/virtualdub_filters[/url]
TMPGEnc-2.5XXX-Plus ( DVD 형태로 할려면, 과자 먹인 제품이 필요합니다....)
multicon.exe (자막 변환 프로그램 인데... 자막 입히기 제작하는 페이지 등에서 많이 언급된 프로그램인데... 제가 현재 링크를 찾지 못하겠네요.. 자막 입히기 하는 법을 위한 유틸 묶음등에서 많이 볼 수 있습니다.)
MyDVD 4.0 ( SONY 번들안에 있더군요... 네로도 DVD로 구울 수는 있지만 VOB 형태라.. 저는 잘 모르겠더군요..)


일단 위의 준비물을 준비하시는게 좋습니다. 맨 마지막의 MyDVD는 레코딩 프로그램인데, 제가 가지고 있는 DVD용 레코딩 프로그램이라고는 이게 전부라.... Instance CD/DVD 라는 프로그램도 되던거 같던데..
기타 네로로 만들수 있으시면 좋겠지만.... 잘 몰라서...

728x90

How to Change Terminal Server's Listening Port



The information in this article applies to:

  • Microsoft Windows NT Server 4.0 Terminal Server Edition

  • Microsoft Windows 2000 Server

  • Microsoft Windows 2000 Advanced Server

  • Microsoft Windows 2000 Professional




This article was previously published under Q187623


IMPORTANT: This article contains information about modifying
the registry. Before you modify the registry, make sure to back it up and make
sure that you understand how to restore the registry if a problem occurs. For
information about how to back up, restore, and edit the registry, click the
following article number to view the article in the Microsoft Knowledge Base:



256986
Description of the Microsoft Windows Registry



SUMMARY


By default Terminal Server and Windows 2000 Terminal Services uses TCP port
3389 for client connections. Microsoft does not recommend that this value be
changed. However, if it becomes necessary to change this port, follow these
instructions.



MORE INFORMATION


WARNING: If you use Registry Editor incorrectly, you may
cause serious problems that may require you to reinstall your operating
system. Microsoft cannot guarantee that you can solve problems that result
from using Registry Editor incorrectly. Use Registry Editor at your own risk.



To change the default port for all new connections created on the Terminal
Server:



  1. Run Regedt32 and go to this key:

    HKEY_LOCAL_MACHINESystemCurrentControlSetControlTerminal
    ServerWinStationsRDP-Tcp


    NOTE: The above registry key is one path; it has been
    wrapped for readability.




  2. Find the "PortNumber" subkey and notice the value of 00000D3D, hex for
    (3389). Modify the port number in Hex and save the new value.



    To change the port for a specific connection on the Terminal Server:

    • Run Regedt32 and go to this key:

      HKEY_LOCAL_MACHINESystemCurrentControlSetControlTerminal
      ServerWinStationsconnection


      NOTE: The above registry key is one path; it has been
      wrapped for readability.




  3. Find the "PortNumber" subkey and notice the value of 00000D3D, hex for
    (3389). Modify the port number in Hex and save the new value.



    NOTE: Because the use of alternate ports has not been fully
    implemented for Terminal Server 4.0, support will be provided as "reasonable
    effort" only, and Microsoft may require you to set the port back to 3389, if
    any problems occur.


To Alter the Port on the Client Side



  1. Open Client Connection Manager.

  2. On the File menu, click New Connection,
    and then create the new connection. After running the wizard, you should
    have a new connection listed there.

  3. Making sure that the new connection is highlighted, on the File
    menu, click Export. Save it as name.cns.

  4. Edit the .cns file using Notepad changing "Server Port=3389" to "Server
    Port=xxxx" where xxxx is the new port that you
    specified on Terminal Server.

  5. Now import the file back into Client Connection Manager. You may be
    prompted to overwrite the current one, if it has the same name. Go ahead and
    overwrite it. You now have a client that has the correct port settings to
    match your change Terminal Server settings.


NOTE: The Terminal Server ActiveX client listens on TCP
port 3389 and this cannot be changed. The Remote Desktop Protocol (RDP) client
that is available in Microsoft Windows XP and Windows .NET (version 5.1 and
later) has this ability.

NOTE: You must restart the Terminal Server before the new
listening port becomes active, or recreate the RDP listener via Terminal
Services configuration.

728x90

How to Change the Listening Port in the Windows Terminal
Server Web Client



The information in this article applies to:

  • Microsoft Windows Server 2003, Datacenter Edition

  • Microsoft Windows Server 2003, Enterprise Edition

  • Microsoft Windows Server 2003, Standard Edition

  • Microsoft Windows Server 2003, Web Edition

  • Microsoft Windows XP Professional SP1




This article was previously published under Q326945


SUMMARY


By default, Windows Terminal Server uses TCP port 3389 for client
connections. As a security option, you may want to change this port.



This article describes how to change the default listening port in the
Terminal Server Web Client.



MORE INFORMATION


To change the Terminal Server listening port in the Windows XP Service Pack
(SP) 1 (or later) and Windows Server 2003 clients, follow these steps:



  1. Locate the Default.htm file in the %system root%WebTsWeb folder.

  2. Open Default.htm in Notepad or in another text editor.

  3. Locate the entries that start with "MsRdpClient.AdvancedSettings2".

  4. Add the following line after these entries

    MsRdpClient.AdvancedSettings2.RDPPort = xxxx


    where xxxx is the new port.



To make sure that you can connect with the new setting, append the port
number to that of the published URL (that is, www.xxx.xxx.xxx:PortNumber).



NOTE: Before SP1 the Windows XP client used the Connect.asp
file, not Default.htm, for these settings. You can make the change described
in step 4 to Connect.asp, but Microsoft recommends that instead you upgrade
the Terminal Services Web client as described in the following Microsoft
Knowledge Base article:




327521
MS02-046: Buffer Overrun in TSAC ActiveX Control Might Allow Code
Execution


For additional information about how to change the default listening port
in Terminal Server, click the article number below to view the article in the
Microsoft Knowledge Base:




187623
How to Change Terminal Server's Listening Port


728x90
HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesMSFTPSVCParametersEnablePortAttack = 1


If its on your own machine, and u are in dos u can supposedly use 'rd \\.\D:
some\path\com1'
of course change the path to where u did it on your harddrive, but use all those
extra backlashes.
728x90

+ Recent posts

728x90