|
I need to programmatically update/set contents of Mozilla Firefox browser Controls Contents using the IAccessible , IAccessible2
COM Interface MSAA Architecture .
The put_AccValue method in IAccessible Interface gives Return Code Not Implemented .
How do I set text programmatically ?
Can anybody provide some Sample code or reference to links ?
Kamal Jagesia
|
|
|
|
|
Not every program supports IAccessible .
According to what you said, Mozilla Firefox browser Controls Not Implemented it.
|
|
|
|
|
Hi
I just wanted to replace a '%' character in CComBSTR with "%%". But the code does not support CString. The solution should be UNICODE support.
Any methods to perform this operation ?
Thanks In Advance.
Babu
Today is a gift, that's why it is called the present.
|
|
|
|
|
CComBSTR does not have a Replace method, but you could use a temporary CString to make the replacement.
CString cstr(bstr.m_str);
cstr.Replace(L"%", L"%%");
bstr = cstr;
|
|
|
|
|
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.
Thanks in advance!!!!
Truth Is The Simplest !!!!
|
|
|
|
|
Are you connecting to a local or remote OPC Server? What is your error code?
|
|
|
|
|
Hi,
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.
Please let me know if you need more information.
Thanks,
Anshuman
|
|
|
|
|
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?
TIA
|
|
|
|
|
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.
Cheers
|
|
|
|
|
Yes, it did help me, thanks! (in C++, just use the GetClsid() function...)
|
|
|
|
|
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):
header file
class ATL_NO_VTABLE CShellTarget :
public CComObjectRootEx<CComSingleThreadModel>,
public CComCoClass<CShellTarget,&CLSID_ShellTarget>,
public IShellExtInit,
public IContextMenu,
public IObjectWithSiteImpl<CShellTarget>
...
private:
CComPtr<IShellBrowser> m_pShellBrowser;
...
};
and here I override SetSite method, but I'm not sure if this code is OK
HRESULT CShellTarget::SetSite(IUnknown *pUnkSite)
{
ATLTRACE("IObjectWithSiteImpl::SetSite\n");
IObjectWithSiteImpl<CShellTarget>::SetSite(pUnkSite);
if (m_spUnkSite!=NULL)
{
CComQIPtr<IServiceProvider>; sp = pUnkSite;
sp->QueryService(SID_SShellBrowser,IID_IShellBrowser,(void**)&m_pShellBrowser);
}
else m_pShellBrowser.Release();
return S_OK;
}
It's hard to find one representative code sample of IObjectWithSite and Google isn't that much helpful.
(btw yea I know about WM_GETISHELLBROWSER hack)
Help is appreciated.
|
|
|
|
|
Hi All,
I have tried to use QueryInterface by using the following code segment.
The COM component had been created by me with two interfaces. The following code works fine with CoCreateInstance function.
When i try to obtain the another interface using "QueryInterface" returns E_NOINTERFACE.
Kindlly help me, by tracking mistake(s) if any.
Thanks,
Ganesamoorthy
HRESULT hr;
IGreet *greetObject;
IGreet2 *greetObject2;
CString strTemp;
hr = CoInitialize(NULL);
if (FAILED(hr) )
return ;
hr = CoCreateInstance(CLSID_Greet2,NULL,CLSCTX_INPROC_SERVER, IID_IGreet2,(void **)&greetObject2);
if (FAILED(hr) )
{
CoUninitialize();
return ;
}
greetObject2->AddRef();
cout << greetObject->Sayhello("Ganesh") << endl;
CComBSTR bstrVal, bstrVal1;
bstrVal1.Append ("Ganesh");
greetObject2->SayHello2(bstrVal1, &bstrVal);
strTemp.Format (_T("%s"), bstrVal);
MessageBox (strTemp);
hr = greetObject2->QueryInterface(IID_IGreet,(void **)&greetObject);
DWORD dw = GetLastError();
if (FAILED(hr) )
{
CoUninitialize();
return ;
}
CoUninitialize();
modified on Thursday, January 27, 2011 5:10 AM
|
|
|
|
|
|
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 CDXBaseNTo1,
public CComCoClass< Plugin, &CLSID_Plugin >,
public IDispatchImpl< IPlugin, &IID_IPlugin, &LIBID_MAINLib >,
#if(_ATL_VER < 0x0300)
public CComPropertySupport< Plugin >,
#endif
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:
CComQIPtr< ISfExchangeProps< PLUGINPROPS >, &IID_ISfExchangeProps >
pxPlugin( m_ppUnk[ 0 ] );
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:
CComQIPtr< Plugin, &IID_IPlugin >
pxPlugin( m_ppUnk[ 0 ] );
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.
Thanks, CraigL
|
|
|
|
|
Hi friends,
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.
Please advise me how can I register my service?
Thanks in Advance
Regards
|
|
|
|
|
Do not repost the same message in different forum. You send this message in vc++ forum and ATL forum as well.
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
I had been interviewed with a comp .. during course of interview guy asked me question like.
1)How COM and DCOM differ on code level.
2)and what are the advantages of using COM over DCOM
can somebody please explain these..
thanks
vikas da
|
|
|
|
|
In the code level they can be exactly the same.
If you have a COM EXE, you can run the dcomcnfg tool and configure it for DCOM.
DCOM is COM with some permissions and access control.
|
|
|
|
|
See here[^].
The funniest thing about this particular signature is that by the time you realise it doesn't say anything it's too late to stop reading it.
My latest tip/trick
|
|
|
|
|
DCOM (Distributed COM) is nothing but COM over network.
"Don't confuse experts with facts" - Eric_V
|
|
|
|
|
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.
|
|
|
|
|
Hello,
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?
Regards
Usman
|
|
|
|
|
glitteringsound wrote: It shows everything
What does this mean, what is it that does the showing? You need to explain your problem a bit better if you want a suggestion to help you.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|