|
|
Thanks a lot for your reply. The problem is that I don't know how to retrieve IWebBrowser2 from within Outlook.
--
md
|
|
|
|
|
|
Great help. Thanks a lot. Really.
Now it works. I have a few questions to understand it a little deeper.
In my add-in I have retrieved the browser interface in OnConnection method as main clas does not implement SetClientSite
I used Outlook::_Explorer as base. Something like this:
CComQIPtr<iserviceprovider> spServiceProvider(theSpExplorer);
ATLASSERT(spServiceProvider);
CComPtr<iserviceprovider> spTopServiceProvider;
hr = spServiceProvider->QueryService(SID_STopLevelBrowser, IID_IServiceProvider, reinterpret_cast<void>(&spTopServiceProvider));
ATLASSERT(spTopServiceProvider);
...
hr = spTopServiceProvider->QueryService(SID_SWebBrowserApp, IID_IWebBrowser2, reinterpret_cast<void>(&theSpWebBrowser2));
ATLASSERT(theSpWebBrowser2);
It works. Please tell me if it is correct attitude. I don understand fully this construction with
SID_STopLevelBrowser.
--
Best regards and thanks again
md
|
|
|
|
|
I believe so. Just make sure the interfaces are released at appropriate time. The MSDN Support page I mentioned earlier has the example.
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
Can i create add in for outlook 2002 in Vs2005 in C# if yes then how
wasim khan
|
|
|
|
|
I need to use a COM object which needs an IDispatch-based event sink. I've only found code for doing this using MFC or ATL. Can someone help me out on how to do this through only C++? I just need to know how to create the event sink class that I will implement in my application. Do I create a class based on IDispatch using DECLARE_INTERFACE and STDMETHOD ... PURE macros? If so, how do I instantiate this class since it has pure virtual members?
|
|
|
|
|
Hi,
I have a COM dll. IS there a way that i can access the interface methods only by importing the DLL.
I dont have the TLB ot _i.c file.
Only having the COM Dll. can i access it?
Regards,
Ramachandraraju KK
|
|
|
|
|
- You could #import the dll which will generate the relevant .h and .c files
- Use the interface declaration files shipped with the DLL and use raw interface pointers
- Use IDispatch if it's supported by the COM inproc server (DLL) coclass
Sohail
modified 21-Apr-21 21:01pm.
|
|
|
|
|
I have a com object, created on c++ (using VS2005)
And another c# library that referenced to that object.
When I try to create new object - I get the follows:
Retrieving the COM class factory for component with CLSID {B1901D41-……….} failed due to the following error: 80040111
I googled for that error, and only found it out when using external programs, like Excel, IExplorer, etc.
I’m afraid in one of my tries I destroyed something in the registry…
Can someone help me with my problem? This is driving me crazy…
Moreover, I am looking for a good site who explains clearly about the COM objects, interop, and the correct use of them.
Thanks,
Sara
|
|
|
|
|
|
have a problem with an OLE document container, which is developed in VS 6.0 and by the use of ATL no MFC is involved.
It is so when a document is loaded in the container it is loaded maximized and the menu with comes with the document is show ok. But if I restore the document down and then maximize it again then is the menu/toolbar, which comes with the document, not correctly redrawn. If I then minimize the document and then maximize it seems to be OK again. I have tried to search for similar cases on the internet but no luck so if anybody have a proposal to the solution then it would be great - many thanks in advance.
Jakob
|
|
|
|
|
I am beginner to a com and want to learn com.
Please help
|
|
|
|
|
Been looking for and not finding a simple com (vb 6.0) dll with will let me decrypt and encrypt a data string. Lots of .net stuff and several enrcypt only ... but I need both.
Any help would be great
gollnick
Gollnick
|
|
|
|
|
hi friend i created a add-in for outlook 2003 and now i need to use it for outlook 2002 can it is used in outlook2002. friend of my tell me that the Architecture of MS-Office2002 is different from 2003 can any body tell what i should do??????????????????????
wasim khan
|
|
|
|
|
wasimsharp wrote: friend of my tell me that the Architecture of MS-Office2002 is different from 2003 can any body tell what i should do?
Ask him what the differences are and take it from there
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
"Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
|
|
|
|
|
From within the project server 2007 event handler when i try creating the MS Project COMponent I get this error. I'm running application on windows 2003 server, using C# on VS2005. I've already configured the security settings of dcom, giving rights to "Network Service" user for launching/activating the MS project component. There is no issue in creating the COMponent if I do so using simple dialogue based application. The error is reported only if creating from within the Project server event handler, which runs as an exe (Microsoft.Office.Project.Server.Eventing ) under the user "Network Service".
Any help plz
Madni
|
|
|
|
|
You mantioned that you "have already configured the security settings of dcom" - can you specify more:
what it the meaning of that? where did you do that - in the registry? under which path?
thanks!!
|
|
|
|
|
Thanks for replying . on "Run" you write dcomcnfg and press enter. A "component services" console is opened. expand "component services" -> Computers -> My Computer -> DCOM Config ... There in the tree i selected Microsoft Project Component. Right click -> properties and there configure the security settings ..
tm_xprt - Life is full of Dreams - But life isn't a Dream.
|
|
|
|
|
I create a COM dll through ATL. I'm using some other libraries like system libraries (MSVCRT.LIB LIBC.LIB) and own libraries in this dll. Dll can be register in release mode but when i try in debug mode it failed and give the error "initialization routine failed".
Please suggest how to resolve it. I have tried to use all release file of all libraries in debug mode. But problem is not resolve.
|
|
|
|
|
If i build ATL COM dll in debug mode then it's fail to register. If i build in release mode without debug info then it's register successfully. While in release mode if i generate debug info and try to register then again it's fail. The error in registering is initialization routine fail.
|
|
|
|
|
there is 2 others kinds of libraries: debug libraries and release libraries:
the debug are all end with D
you have to use the right dll - in order the registry will success.
you can check your dll with dependency walker
good luck!
|
|
|
|
|
Hi all,
I am trying to subscribe for events like this:
CComPtr<IDispatch> spDisp;
HRESULT hr = m_spWebBrowser2->get_Document(&spDisp);
if (SUCCEEDED(hr) && spDisp)
{
CComQIPtr<IHTMLDocument2, &IID_IHTMLDocument2> spHTML(spDisp);
if (spHTML)
{
CComQIPtr<IHTMLElement, &IID_IHTMLElement> spElem;
hr=spHTML->get_body(&spElem);
if (SUCCEEDED(hr))
{
IConnectionPointContainer* pCPC = NULL;
hr = spElem->QueryInterface(IID_IConnectionPointContainer, (void**)&pCPC);
if (SUCCEEDED(hr))
{
IConnectionPoint* pCP = NULL;
hr = pCPC->FindConnectionPoint(DIID_HTMLInputTextElementEvents2, &pCP);
if (SUCCEEDED(hr))
{
....
}
}
}
}
}
FindConnectionPoint fails.
Please show me where I am wrong or how else I can subscribe?
modified on Monday, August 4, 2008 7:38 AM
|
|
|
|
|
Thanks, I found the error.
|
|
|
|
|
The code sample is as below,
_bstr_t bstrwer(_bstr_t(charPointer).Detach(),false);
HRESULT hr = CallToManagedWorld(bstrwer.GetBSTR()); // C# code CallToManagedWorld(string xml);
=======================================================
There is a memory leak in the above code for the memory allocated internally by the (_bstr_t(charPointer).Detach() code.
Can you provide any solution to this?
|
|
|
|