Changeset 29874 in vbox for trunk/src/VBox
- Timestamp:
- May 28, 2010 6:14:44 PM (15 years ago)
- Location:
- trunk/src/VBox/Main
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/VirtualBoxImpl.cpp
r29864 r29874 4463 4463 } 4464 4464 4465 4465 4466 //////////////////////////////////////////////////////////////////////////////// 4466 4467 … … 4498 4499 #if 0 4499 4500 // WIP 4501 4502 LPTYPEINFO ptinfo; 4503 HRESULT hr; 4504 LPTYPELIB ptlib; 4505 DISPID dispid; 4506 4507 /* Real solution must cache all needed dispids once, ofc */ 4508 hr = ::LoadRegTypeLib(LIBID_VirtualBox, kTypeLibraryMajorVersion, kTypeLibraryMinorVersion, LOCALE_SYSTEM_DEFAULT, &ptlib); 4509 hr = ptlib->GetTypeInfoOfGuid(IID_IVirtualBoxCallback, &ptinfo); 4510 ptlib->Release(); 4511 4512 OLECHAR FAR* szMember = L"OnMachineStateChange"; 4513 4514 hr = ::DispGetIDsOfNames(ptinfo, &szMember, 1, &dispid); 4515 ptinfo->Release(); 4516 4500 4517 int nConnections = mVirtualBox->m_vec.GetSize(); 4501 4518 for (int i=0; i<nConnections; i++) 4502 4519 { 4503 CComPtr<IUnknown> sp = mVirtualBox->m_vec.GetAt(i); 4504 IVirtualBoxCallback* cb = reinterpret_cast<IVirtualBoxCallback*>(sp.p); 4505 if (cb != NULL) 4506 { 4507 HRESULT hrc = handleCallback(cb); 4520 ComPtr<IUnknown> sp = mVirtualBox->m_vec.GetAt(i); 4521 ComPtr<IVirtualBoxCallback> cbI; 4522 ComPtr<IDispatch> cbD; 4523 4524 cbI = sp; 4525 cbD = sp; 4526 4527 /** 4528 * Would be like this in ideal world, unfortunately our consumers want to be invoked via IDispatch, 4529 * thus going the hard way. 4530 */ 4531 #if 0 4532 if (cbI != NULL) 4533 { 4534 HRESULT hrc = handleCallback(cbI); 4508 4535 if (hrc == VBOX_E_DONT_CALL_AGAIN) 4509 4536 { 4510 4537 // need to handle that somehow, maybe just set element to 0 4511 4538 } 4539 } 4540 #endif 4541 if (cbI != NULL && cbD != NULL) 4542 { 4543 CComVariant varResult, arg1, arg2; 4544 4545 ::VariantClear(&varResult); 4546 ::VariantClear(&arg1); 4547 ::VariantClear(&arg2); 4548 4549 VARIANTARG args[] = {arg1, arg2}; 4550 DISPPARAMS disp = { args, NULL, sizeof(args)/sizeof(args[0]), 0}; 4551 4552 cbD->Invoke(dispid, IID_NULL, 4553 LOCALE_USER_DEFAULT, 4554 DISPATCH_METHOD, 4555 &disp, &varResult, 4556 NULL, NULL); 4512 4557 } 4513 4558 } -
trunk/src/VBox/Main/idl/VirtualBox.xidl
r29864 r29874 14529 14529 namespace="virtualbox.org"> 14530 14530 <interface name="IVirtualBox" default="yes"/> 14531 <eventsink name="IVirtualBoxCallback" default="yes"/> 14531 14532 </class> 14532 14533 </module> … … 14536 14537 namespace="virtualbox.org"> 14537 14538 <interface name="ISession" default="yes"/> 14539 <eventsink name="IConsoleCallback" default="yes"/> 14540 14538 14541 </class> 14539 14542 <class name="CallbackWrapper" uuid="49EE8561-5563-4715-B18C-A4B1A490DAFE" -
trunk/src/VBox/Main/idl/midl.xsl
r29200 r29874 630 630 </xsl:if> 631 631 <xsl:text>interface </xsl:text> 632 <xsl:value-of select="@name"/> 633 <xsl:text>;
</xsl:text> 634 </xsl:for-each> 635 <xsl:for-each select="eventsink"> 636 <xsl:text> </xsl:text> 637 <xsl:choose> 638 <xsl:when test="@default='yes'"><xsl:text>[default,source]</xsl:text></xsl:when> 639 <xsl:otherwise><xsl:text>[source]</xsl:text></xsl:otherwise> 640 </xsl:choose> 641 <xsl:text> interface </xsl:text> 632 642 <xsl:value-of select="@name"/> 633 643 <xsl:text>;
</xsl:text>
Note:
See TracChangeset
for help on using the changeset viewer.