분류 전체보기
-
데이터 타입 - C++ActiveX/Automation 2009. 3. 4. 00:11
BSTR // OLECHAR *, Basic (language) string SysAllocString() SysFreeString() SysStringLen() void MyClass::Function(BSTR* bstrOut) { *bstrOut=::SysAllocStringLen(m_bstr, ::SysStringLen(m_bstr)); } BSTR bstrStatus = ::SysAllocString( L"Some text" ); if (bstrStatus == NULL) return E_OUTOFMEMORY; ... ::SysFreeString( bstrStatus ); SAFEARRAY OLE_COLOR OleTranslateColor() // COLORREF VARIANT VariantIni..
-
데이터 타입 - ATLActiveX/Automation 2009. 3. 4. 00:07
CComBSTR .=() .Copy() .CopyTo() CComBSTR m_bstrURL; // BSTR representing a URL // put_URL is the put method for the URL property. STDMETHOD(put_URL)(BSTR strURL) { ATLTRACE(_T("put_URL\n")); // free existing string in m_bstrURL & make a copy // of strURL pointed to by m_bstrURL m_bstrURL = strURL; return S_OK; } // get_URL is the get method for the URL property. STDMETHOD(get_URL)(BSTR* pstrURL)..
-
컬렉션 - ATLActiveX/Automation 2009. 3. 3. 23:05
클라이언트는 루트 개체가 제공하는 읽기 전용의 속성을 통하여 컬렉션 개체에 접근하게 된다. 루트 개체 읽기 전용 속성의 컬렉션 개체를 노출 interface ICompany : IDispatch { [propget, id(1), helpstring("property Employees")] HRESULT Employees([out, retval] VARIANT *pVal); }; 컬렉션 개체 클래스 팩토리 관련 내용은 제거한다. .Count .Item[] ._NewEnum [.Add()] [.Remove()] interface IEmployees : IDispatch { [propget, id(1), helpstring("property Count")] HRESULT Count([out, retval] l..
-
파서 필터 - DirectShow미디어/필터 2009. 3. 1. 20:19
CTransformFilter // 입력 핀의 미디어 협상 .CheckInputType() // virtural called by CTransformInputPin::CheckInputType() // ??? .{SetInternalBufferSize}() .{SetMediaType}() .GetMediaType() // virtual called by CTransformOutputPin::GetMediaType() // ??? 출력 핀의 미디어 타입 협상 .CheckTransform() // virtual 출력 핀의 미디어 타입 협상이 완료될 수 있는지 여부 .DecideBufferSize() // virtual 출력 핀의 버퍼 협상 .Transform() // virtual call .{CopySam..
-
디자인 패턴(클래스 설계 기법)디자인 패턴 2009. 2. 28. 18:10
* Design PrinciplesOpen Close Principle 의존성 뒤집기 원칙(Dependency Inversion Principle)어떤 변수에도 구상 클래스에 대한 레퍼런스를 저장하지 말고, 구상 클래스에 유도된 클래스를 만들지 말며, 베이스 클래스에 이미 구현되어 있던 메소드를 오버라이드하지 말아야 한다 Interface Segregation Principle Single Responsibility Principle Liskov's Substitution Principle 인터페이스 상속의 목적은 동적 다형성 템플릿은 정적 다형성 코드 재사용을 위해서는 구현 상속 보다는 합성(composition?)을 사용하자. // ??? 중복(?) 상속의 위험성이 없는 한 다중 상속은 전혀 거리낄 ..
-
WAVFile Format 2009. 2. 28. 16:24
The wave file format is broken up into RIFF chunks. RIFF WAVE RIFF RIFF IDENTIFIER (4 Bytes) RIFF SIZE (4 Bytes) (RIFF SIZE - 8) "fmt " DWORD dwRiffSize; WORD wFormatTag; // Format category WORD wChannels; // Number of channels DWORD dwSamplesPerSec; // Sampling rate DWORD dwAvgBytesPerSec; // For buffer estimation WORD wBlockAlign; // Data block size WORD wBitsPerSample; "data" 4 Bytes DATA SIZ..