com

“com.jacob.com.ComFailException: Can't find moniker” Why?

爱⌒轻易说出口 提交于 2019-12-11 04:39:59
问题 I use jacob last version and jacobgen. I put all need dll in c:\windows\system32 I generated wrapper about dll by jacobgen. But I got an exception. Google didn't help. :( com.jacob.com.ComFailException: Can't find moniker May be need registy dlls in windows registry? 回答1: COM objects have to be registered to be found. It does not matter in which folder they reside. Call regsvr32 mycomdll.dll on the dll. 来源: https://stackoverflow.com/questions/2904225/com-jacob-com-comfailexception-cant-find

ATL COM - How To Reuse Code for Interface Method

社会主义新天地 提交于 2019-12-11 04:39:53
问题 I have several interfaces, e.g. IA, IB, IC, and so on, that share common properties, e.g. Site. I would like to know how to reuse code for these interfaces (please save me the answer on COM aggregation). Current implementation is as follows: class CA // ATL specific... { STDMETHODIMP get_Site(...) {...} STDMETHODIMP put_Site(...) {...} } class BA // ATL specific... { STDMETHODIMP get_Site(...) {...} STDMETHODIMP put_Site(...) {...} } class CC // ATL specific... { STDMETHODIMP get_Site(...) {.

Using a 3rd party COM dll in ASP.NET

对着背影说爱祢 提交于 2019-12-11 04:18:24
问题 I have an ASP.NET project using a COM dll. When I load the site, I login without a problem and I can browse the site fine as long as I don't go to a page which uses the COM library. When I go to a page which uses the COM library to get data from a database, the page loads fine. The problem comes when I navigate away form this page. For some reason I am sent back to the login page as if the initial session was dropped. If I take away the component on the page which displays the data which the

Win 2012R2 Server - ActiveX component can't create object aspmail 4.0 (SMTPsvg.Mailer) IIS8.5

若如初见. 提交于 2019-12-11 04:08:42
问题 I've had to move a classic ASP application from windows server 2008 to Windows Server 2012R2 and the app uses a com object called (aspmail 4.0) from a company called ServerObjects - which is no longer in business (at least there's no way to contact them). Anyway, I've registered the DLL ( C:\Windows\SysWOW64\regsvr32.exe d:\components\aspmail4\smtpsvg.dll ), that works as I checked the registry (it's 100% installed no issues nor errors). I've verified the DLL is correct and the registry is

Permission denied on frame

允我心安 提交于 2019-12-11 04:07:17
问题 I have a window based on the CAxWindow. In this window I create WebBrowser control. When the DISPID_DOCUMENTCOMPLETE happens I do: void __stdcall document_complete( LPDISPATCH pBrowser, VARIANT* ) { CComQIPtr< IWebBrowser2 > wb( pBrowser ); CComPtr< IDispatch > doc; if( SUCCEEDED( wb->get_Document( &doc ) ) ) { _docs.push_back( doc ); } ... } When the page is loaded I call for each document in _docs the script (IActiveScript and IActiveScriptSite): function main( doc ) { try { return doc.URL;

How to get the current reference count of an object?

好久不见. 提交于 2019-12-11 03:59:48
问题 I have a pointer to a COM object (in C++). Is there a way to get the current reference count of the object which the pointer is pointing to? 回答1: Call IUnknown::AddRef and then immediately IUnknown::Release . The value returned by the latter is current count of outstanding references. Note that the value does not have to be accurate, it is informational only. 来源: https://stackoverflow.com/questions/30703812/how-to-get-the-current-reference-count-of-an-object

Memory leak using pywin32com for opc

淺唱寂寞╮ 提交于 2019-12-11 03:56:48
问题 I am having a hard time trying to figure out how to address leaking memory. I think this might be an issue with pywin32 but I am not completely sure. My code to do reading/writing individual items seems to work just fine, but when using group functions it slowly leaks memory. I suspect this is from the 1-based array that must be passed in the server_handles. Does anyone know of a work around? def read_group(self, group, mode=OPC_SYNC, source=OPC_DS_CACHE): """ Read a group returning a list of

Using .Net classes through COM Objects in Delphi sometimes hangs

自闭症网瘾萝莉.ら 提交于 2019-12-11 03:56:06
问题 I have a set of libraries written in Delphi.NET (.NET 1.1) which I want to use in my Win32 (Delphi) application. For performance related issues, I've decided to follow the COM route. Sometimes, after rebuilding the DLL, when I try to instantiate the objects exposed through COM, the Win32 application hangs at the CreateComObject call. How can I solve this problem? To expose the Delphi.NET libraries through COM, I add the following attributes above each class deceleration: [Comvisible(true)]

How to determine whether two word documents are the same using word interop

我与影子孤独终老i 提交于 2019-12-11 03:47:07
问题 Is there a good way to see if two documents are the same using the word interop? I have tried using something like: Word.Document tempDoc = app.CompareDocuments(document1, document2); My issue is that tempDoc is not null if they are the same, so I'm not sure how to use this result to determine whether the documents are the same. Thanks in advance! 回答1: The document it returns is a document with track changes turned on. So all you have to do is see if there ARE any changes. So: Document

Date conversion issue with Excel Interop and CSV file

不想你离开。 提交于 2019-12-11 03:43:48
问题 I have a CSV file which contains dates formatted as m/dd/yyyy as follows 1/06/2013,15,1,1/06/2013 0:15,1,6.44 When I open the file in Excel, the dates are correctly converted - 1/06/2013 has numeric value 41,426.00 and the MONTH() function returns 6. When I use Microsoft.Office.Interop.Excel to open the same file using either the Open() or OpenText() method the date gets converted to 41,280.00 (6/01/2013). Can you open a CSV file using Microsoft.Office.Interop.Excel so that it opens the same