|
Does anyone know if you can do this without having to resort to remoting via sockets?
What I want to do is host a .NET assembly from inside a mixed-mode EXE file so that I can run the CLR profiler API from within the EXE host and modify the IL of the hosted assembly as the application is running. Now I know that .NET remoting lets you do this via sockets, but is there a faster way to doing this...perhaps through named pipes, or through some other means of interprocess communication?
|
|
|
|
|
|
what is aggregation in COM and how it is different from containment ?
|
|
|
|
|
If object X with interface I1 is aggregated with object Y with interface I2, both interfaces are reachable through IUnknown::QueryInterface(). Eventhough they're two separate objects, they behave as if they were one and the same.
Containment is when object X holds a reference to object Y, but X's QueryInterface() won't give you any of Y's interfaces (and vice versa). They behave as two separate objects.
--
Kein Mitleid Für Die Mehrheit
|
|
|
|
|
I am using an application in which ,Com server is exporting some functionality to client..
i know that ,com server are of two types in-proc and out-of proc....
i also know that.. in-proc server loads inside client memory space , where as out-of-proc loads in its own memory space,
so my question is that, how we decide that , we want to load server in client memory space(in-proc) or let it loads in its own memory space(out-proc)
In other words, what are the design requirements by which we decide on the type of Com server ?
|
|
|
|
|
Two relevant points:
(1) When client and server are on the local machine then in-process servers have better performance.
(2) Out-of-process servers crashes (usually) don't cause client application crash and vice-versa.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thannks a lot
|
|
|
|
|
I'm new in this area.
My question is that, can we use directshow to creaye encryption/decryption code for windows media player plugin to secure our video stream?
Is there any other possible method that can do this?
I wish that i can read a step by step tutorial on this. I tried using DSP Plugin wizard but still fail to decrypt the video stream as i couldn't decrypt it frame by frame.
Thank you in advanced.
|
|
|
|
|
Windows Media DRM will do this for you. The stream is encrypted between the server and the user's machine, then decrypted before being displayed.
|
|
|
|
|
Since COM dll cannot be used without registering, so i want to convert COM dll to Normal dll so that i can use dll without registering
|
|
|
|
|
Windows XP and later support a feature called Registration-Free COM. To use this, your COM DLLs must have an Assembly Manifest[^] and the application must have an Application Manifest[^] declaring the assemblies it uses. These can be provided as .manifest files copied alongside the DLL and EXE files.
DoEvents: Generating unexpected recursion since 1991
|
|
|
|
|
Hi,
I have code to find simulated a EHCI controller. But i alway get error 0x80070057 when want to get DSFDevice from DSFDevices collection. Please help me.
const IID_CLSID= "{E927C266-5364-449E-AE52-D6A782AFDA9C}"
......
STDMETHODIMP CLoopbackDevice::CheckSimulatedDev(BSTR CLSID, VARIANT_BOOL *pvBool)
{
HRESULT hr = S_OK;
CComPtr<IDSF> spDsf;
CComPtr<IDSFDevices> spDsfDevices;
CComPtr<IDSFDevice> spDsfDevice;
long mDeviceCount = 0;
short mValue = 0;
*pvBool = VARIANT_FALSE;
hr = spDsf.CoCreateInstance(__uuidof(DSF));
IfFailHrGo(hr); //Go to Exit
//Get Dsfdevices list from root
IfFailHrGo(spDsf->get_Devices(reinterpret_cast<DSFDevices **>(&spDsfDevices)));
//Get number of device in list
IfFailHrGo(spDsfDevices->get_Count(&mDeviceCount));
for(INT i =1; i<= mDeviceCount; i++)
{
VARIANT vt;
VariantInit(&vt);
vt.vt = VT_INT;
vt.intVal = i;
IfFailHrGo(spDsfDevices->get_Item(vt, (DSFDevice **)(&mDsfDevice))); //<-- Error from here
hr = spDsfDevice->HasObject(CLSID, &mValue);
if (mValue && SUCCEEDED (hr) )
{
*pvBool = VARIANT_TRUE;
break;
}
}
Exit:
printf("HR = 0x%X\n", hr); //--->0x80070057
// RELEASE(spDsf);
return hr;
}
xuanthinh
<div class="ForumMod">modified on Tuesday, April 22, 2008 12:09 AM</div>
|
|
|
|
|
By DSF, I believe you mean Microsoft Device Simulation Framework.
0x80070057 = E_INVALIDARG
I believe you may have index error. Check value of i in the loop against the count of devices in the collection.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
There are Zero-Based and One-Based Collections.
<quote>
A collection is either zero-based or one-based, depending on what its starting index is. As you might guess, the former means that the index of the first item in the collection is zero, and the latter means it's one. Examples of zero-based collections are the Forms and Controls collections. The Collection object is an example of a one-based collection.
Older collections in Visual Basic are more likely to be zero-based, while more recent additions are more likely to be one-based. One-based collections are somewhat more intuitive to use, because the index ranges from one to Count, where Count is the property that returns the number of items in a collection.
The index of a zero-based collection, by contrast, ranges from zero to one less than the Count property.
With best wishes,
Vita
|
|
|
|
|
Thanks for your consideration.
Yeah Microsoft Device Simulation Framework.
I have ever let try both Zero-Based and One-Based Collections. But i got the same Error.
Infact, there is only one Device (i mean simulated controller, mDeviceCount = 1).
What is wrong with the conversion of VARIANT i did:
/*
VARIANT vt;
VariantInit(&vt);
vt.vt = VT_INT;
vt.intVal = i;
IfFailHrGo(spDsfDevices->get_Item(vt, (DSFDevice **)(&mDsfDevice))); //<-- Error from here
hr = spDsfDevice->HasObject(CLSID, &mValue);
*/
I have no Visual studio, i just used Windows Driver Kits to compiler it.
xuanthinh
|
|
|
|
|
There is sucessful code in VB script but i cannt in C++
Dim DevSought : Set DevSought = Nothing
Dim Dev : Set Dev = Nothing
Dim DSF : Set DSF = CreateObject("DSF.DSF")
Dim ObjSought : Set ObjSought = Nothing
For Each Dev in DSF.Devices
If Dev.HasObject(CLSID) Then
Set ObjSought = Dev.Object(CLSID)
If Not ObjSought Is Nothing Then
Set DevSought = Dev
Exit For
End If
End If
Next
Set EnumSimulatedDevices = DevSought
xuanthinh
|
|
|
|
|
You can try
Set Dev = DSF.Devices(0)
or
Set Dev = DSF.Devices(1)
or test this variables in Debug and Watch window.
***Edit***
I think that Set Dev = DSF.Devices(CLSID) will be OK.
With best wishes,
Vita
|
|
|
|
|
Problem could be in the Variant type. The function might be validating against a different Variant Type.
Instead of VT_INT, try using VT_I4 and set corresponding lVal instead of intVal.
Sohail
modified on Friday, May 9, 2008 3:55 AM
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I was wondering whether the problem is resolved...
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Thanks for all,
Yeah
Instead of VT_INT, try using VT_I4 and set corresponding lVal instead of intVal.
This method is OK.
xuanthinh
|
|
|
|
|
Cool. I thought so, the problem could be there - basically the way the method is internally implemented.
Glad I could help.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
All,
I have an MFC application and I am using the MSXML parser 4.0. I have the document object declared as a member variable,
<br />
CComPtr< MSXML2::IXMLDOMDocument2 > m_spDoc;<br />
and use the rest as stack variables - like
<br />
MSXML2::IXMLDOMNodePtr pNewChild;<br />
MSXML2::IXMLDOMElementPtr pDomElement;<br />
CComPtr<msxml2::ixmldomelement> spDomElement;<br />
</msxml2::ixmldomelement>
in a function. When I invoke the function the second time, call to createProcessingInstruction of the IXMLDOMDocument2 fails.
So, I thought second time initialization is an issue and hence called it only the first time.
Now, all calls to appendChild or CreateElement fail.
Can anyone tell me how to use the DOMDocument object the second time? Is there any clean up I can do before I invoke the fn the second time?
Cheers
Raja
|
|
|
|
|
It is almost impossible for us to know without more information. We could guess, but there are so many possibilities.
Post your actual code.
|
|
|
|
|
I need to sink some form.onsubmit and input.onlick events in a C# BHO that I'm starting. I tried the method prescribed in MSDN but found that immediately after attaching the event handler the browser would no longer respond to mouse clicks in the tab containing the instrumented document.
After some searching I found this: http://www.dotnet247.com/247reference/msgs/48/241776.aspx[^]
I've tried this solution (see implementation below) and it works fine, and cleared the mouse lockup problem as described. But I am getting persistent DisconnectedContext MDA alerts that I suspect are related to this implementation. These appear at seemingly random times (my guess is when garbage collector runs), but only if I close a browser tab that contains HTML elements that I have attached these event handlers to.
Is it not necessary to remove these event handlers from the HTMLDocument instances that they are attached to, before the document is unloaded (navigate away, close tab), and to remove them on the same thread that instantiated them? If so, how can I do this?
Or am I approaching this in the wrong way? If there is a more robust way to sink mshtml document events in C# please let me know.
A related question: since document (element) references handler, which references document, is it possible that this solution may contribute to IE memory leakage if the event handler is not removed from the document element before the document is unloaded?
public delegate void HtmlEvent(mshtml.IHTMLEventObj e);
[ComVisible(true)]
public class HtmlDocumentEventHandler
{
private mshtml.HTMLDocument htmlDocument;
public HtmlEvent eventHandler;
public HtmlDocumentEventHandler(mshtml.HTMLDocument htmlDocument)
{
this.htmlDocument = htmlDocument;
}
[DispId(0)]
public void Call()
{
this.eventHandler(this.htmlDocument.parentWindow.@event);
}
}
[ComVisible(true)]
public class HtmlDocumentFormElement
{
private mshtml.IHTMLFormElement element;
private mshtml.HTMLDocument document;
public HtmlDocumentFormElement(mshtml.HTMLDocument document, mshtml.IHTMLFormElement element)
{
this.document = document;
this.element = element;
}
public event HtmlEvent onSubmit
{
add
{
object old = this.element.onsubmit;
HtmlDocumentEventHandler handler = old is HtmlDocumentEventHandler ? old as HtmlDocumentEventHandler : new HtmlDocumentEventHandler(this.document);
this.element.onsubmit = handler;
handler.eventHandler += value;
}
remove
{
object old = this.element.onsubmit;
HtmlDocumentEventHandler handler = old is HtmlDocumentEventHandler ? old as HtmlDocumentEventHandler : null;
if (handler != null)
handler.eventHandler -= value;
}
}
}
mshtml.IHTMLFormElement element = form as mshtml.IHTMLFormElement;
HtmlDocumentFormElement formElement = new HtmlDocumentFormElement(this.HTMLDocument, element);
formElement.onSubmit += new HtmlEvent(OnSubmitEventHandler);
Kim Briggs
Kinek Technologies
kim.briggs@kinek.com
|
|
|
|
|
I was curious if anyone currently had a C++ COM Library. I am wanting to use it to create various IE COM functions.
|
|
|
|