ActiveX
-
컬렉션ActiveX/Automation 2009. 8. 7. 16:18
STDMETHODIMP CallMethod(LPDISPATCH pDisp, LPOLESTR pszName, VARIANT* pvResult, UINT cArgs, VARIANTARG* rgVarParams) { if (NULL == pDisp) return E_POINTER; DISPID dwDispID; DISPPARAMS dispparams = {NULL, NULL, 0, 0}; dispparams.rgvarg = rgVarParams; dispparams.cArgs = cArgs; HRESULT hr = pDisp->GetIDsOfNames(IID_NULL, &pszName, 1, LOCALE_USER_DEFAULT, &dwDispID); if(SUCCEEDED(hr)) { hr = pDisp->I..
-
데이터 타입 - 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..
-
MFCActiveX/Drag & Drop 2009. 2. 11. 19:55
COleDataSource DoDragDrop() COleDropSource COleDropTarget OnDragEnter OnDragOver OnDragLeave OnDrop 참조 사이트: http://www.codeguru.com/cpp/controls/listbox/dragdrop/print.php/c11069 http://www.codeproject.com/KB/shell/explorerdragdrop.aspx?display=PrintAll&fid=1699&df=90&mpp=25&noise=3&sort=Position&view=Quick&fr=101 http://jjjryu.tistory.com/entry/%ED%81%B4%EB%A6%BD%EB%B3%B4%EB%93%9C http://jjjryu..
-
In Process, MFCActiveX/Automation 2008. 12. 20. 00:33
1. [MFC AppWizard (dll)]로 프로젝트 생성한다. 이때 [Automation]을 체크 2. IDispatch 인터페이스를 구현할 클래스 생성 [Insert | New Class] 메뉴를 선택해서 [Class Type]은 'MFC Class', [Base class]는 CCmdTarget 그리고 [Automation] 항목에서 [Creatable by type ID]를 선택해서 생성 3. 생성된 인터페이스의 컨텍스트 메뉴에서 [Add Method]를 선택해서 메소드 추가 BOOL CCalcServerApp::InitInstance() { // Register all OLE server (factories) as running. This enables the // OLE libraries t..
-
ATLActiveX/컨트롤 2008. 12. 18. 19:05
ActiveX 컨트롤 // OLE 컨트롤 커스텀 컨트롤 COM 클래스 a COM object that implements a certain set of interfaces that enable it to look and act like a control IDispatch expose methods and properties IConnectionPointContainer to fire events To find out what kinds of events the control is capable of firing (and by extension, what methods the container must implement in order to respond to control events), most con..
-
자동화 컨트롤러(클라이언트)ActiveX/Automation 2008. 12. 17. 00:25
* VBScript(CalcClient.vbs) Set Calc = CreateObject("CalcServer.Calculator") Sum = Calc.Add(5, 3) MsgBox("5+3 = " + CStr(Sum)) Set Calc = Nothing * VBScript(CalcClient.vbs) - 다중개체 Set Clock = CreateObject("ClockServer.Application") ' 시침 속성 설정 Clock.Appearance.Tickness(0) = 5 Clock.Appearance.Length(0) = 35 Clock.Appearance.Color(0) = RGB(0, 0, 255) ... Clock.ShowWindow() Clock.UpdateWindow() * VB..