I have injected my DLL into Mozilla firefox browser. Using this DLL I want to get the IWebBrowserApp Interface , IHtmlDocument2 Interface for the current Active Instance of Mozilla Browser. How do I achieve this ? I do not want to use ATL or MFC .
I am using OPC client which connects to OPC driver but if the loading takes more than 2 mins it's automatically shutdown the driver please suggest me something.
Tested with other clients also but the same problem persist.
The problem is with CoCreateInstance if it takes more than 2 mins it abort the driver gracefully.
I am a COM novice so please bear with me if information is incomplete/incorrect. I have a C++ application interacting with a .NET application through a COM. The C++ application is launched by the .NET application, which received events from the C++ application through COM interface using COleDispatchDriver.InvokeHelper method (described here - http://msdn.microsoft.com/en-us/library/zwx803ex(v=vs.80).aspx[^].
My question is - say my .NET application dies and my C++ application remains alive and tries to send an event to the .NET application through this COM interface, is there any way I can know that .NET application's gone.
I'm trying to access an an XAudio2 interface (IXAudio2 for example) in C#.
Some background: I'm writing a tool that will allow a sound artist to play back some music (among other things). I require playback of streaming multichannel audio from any location in the file, the tool is written in C#. DirectSound is depricated, XACT can't do this as far as I know, other packages (NAudio and SlimDX) are options but I'd like to stick with what our artists already have installed if possible. That leaves me with xaudio2, but it's not managed.
I've scanned my registry and opened the XAudio2 dll in OLE-COM Object Viewer, as well as several dll inspectors, none list the interfaces in the coclass. I'm following the directions here to access the COM interfaces but I require the IID of interfaces like IXAudio2.
Is there any way of getting this information or am I going down the wrong path all together?
I found the answer. The GUID's are supplied in the xaudio2.h header files supplied in the xdk. I feel silly for not looking there earlier, but perhaps this will help someone else with a similar question.
I'm trying to do this error-free.
I'm writing context menu shell extension that will navigate current Explorer window through IShellBrowser acquired through IObjectWithSite and so far I have this (omitting unimportant code):
class ATL_NO_VTABLE CShellTarget :
and here I override SetSite method, but I'm not sure if this code is OK
I have a plugin that I'm developing that is used in a COM environment. The issue is, I seem to be able to readily obtain an pointer to a base class of my class, but I'm unable to figure out how to get a pointer to my main class.
Here is my class:
class ATL_NO_VTABLE Plugin :
public CComCoClass< Plugin, &CLSID_Plugin >,
public IDispatchImpl< IPlugin, &IID_IPlugin, &LIBID_MAINLib >,
#if(_ATL_VER < 0x0300)
public CComPropertySupport< Plugin >,
public IObjectSafetyImpl2< Plugin >,
public IPersistStorageImpl< Plugin >,
public ISpecifyPropertyPagesImpl< Plugin >,
public IPersistPropertyBagImpl< Plugin >,
public CSFVideoPlugin< PLUGINPROPS >
The CSFVideoPlugin is derived from the ISfExchangeProps< PLUGINPROPS > interface.
Then, in another are of the plugin environment, the Property Page to configure it, I can do the following:
This part all works fine, and calls into the pxPlugin work fine. When inside a method call there, the debugger shows [ATL::CComContainedObject<Plugin>] as the first "member" of this, so the relationship is known, or so it would seem. But calls like this return a completely bogus pointer:
The memory is in the same basic area, but the values are all messed up, and in fact setting them on occasion can/will crashes.
I can't figure out how to query for that CComContainedObject interface. Given that even the debugger has enough information to track it down though, clearly it must be.
Any help would be greatly appreciated. If I haven't provided a piece of information that would be useful, please let me know.
My product have a ATL/COM based C++ service (32 bit). It get registered and run fine on XP 32 bit and Vista 32 bit.
But now I want to run the same on Windows7 64 bit also. I tried to register the service the following way:
1 I did Copy MyService.exe at C:\Windows\SysWOW64.
2 Then executing "C:\Windows\SysWOW64\MyService.exe" -RegServer from Start->Run
3 Then executing "C:\Windows\SysWOW64\MyService.exe" -Service from Start->Run
But my service is not getting registered. While registering it, I don't get any error message. Also I didn't find any entry in event viewer (I saw event viewer first time. Don't know where to see the log about registration of my service). And I didn't find entry for my service at Control Panel\Administrative Tools\Services.
In my application Iam calling a method in C# in the fallowing way. It is a com method.
Array ar = iFuncs22.GetCheckEntriesNew();parameter to function is an IID.purpose of this function is to get all the properties of a structure named "Entry" into an array. Implementation of function GetCheckEntriesNew()is in VC++ like
STDMETHODIMP CARadApi::GetCheckEntriesNew(long CheckId, LPSAFEARRAY *pRetVal)
In the implementation part everything is fine except in the call
hr = SafeArrayPutElement(psaEntriesNew, &index, &ce1);
here ce1 is a "Entry" strucure which is filled properly.But while putting ce1 values into Array using "SafeArrayPutElement" values are changing. some random values are appering. Please let me know the solution. Thanks in Advance
Are you sure you don't have memory errors somewhere in your program? I've used COM's SafeArrayPutElement without a problem, but I have seen very weird errors like those you describe when applications have memory errors. This is often due to someone forgetting that Excel often passes unitialized values to dlls.
I am using DIA SDK for extracting user defined complex types(just I used in my C++ code). I don't know all my types(used in code) before extracting from DIA SDK with names and members(data members& functions).
It shows everything, I mean all those user defined types which I don't need at all(i.e kernel types and enums & structs). I only want to enumerate those which are strictly used in my code(i.e in Dll/EXE in any format).
Is there is any way out at all by which we can restrict those unwanted (Kernel source types or MSFT specific source code) types to appear?