com

what's wrong in my code related to COM?

不羁的心 提交于 2019-12-04 19:09:15
*****BLOCK_1**** if( strcmpi(appName.c_str(),MSSQL)==0 ||strcmpi(appName.c_str(),MSSQL2005)==0 ) { if (FAILED(CoCreateInstance (CLSID_SQLDMOServer, NULL, CLSCTX_INPROC_SERVER, IID_ISQLDMOServer, (LPVOID*)&m_pSQLServer))) { DMOAvailable=false; IDiscoverPtr pICalc; HRESULT hRes=CoCreateInstance(Test::CLSID_SqlClass, NULL, CLSCTX_INPROC_SERVER,Test::IID_IDiscover, reinterpret_cast<void**> (&pICalc)); if(FAILED(hRes)) { cout << "CoCreateInstance Failed on CLSID_SQLDMOServer\n"; return FALSE; } ***BLOCK_2*** if((strcmpi(appName.c_str(),MSSQL2008)==0 || strcmpi(appName.c_str(),MSSQL2005)==0 ) &&

What's the best/easiest way to manipulate ActiveX objects in Java?

北慕城南 提交于 2019-12-04 19:04:21
I want to open and manipulate Excel files with ActiveX. I've had success with Python's Win32 Extensions and Groovy's Scriptom libraries on other projects but need to do this is pure Java this time if possible. I've tried the Jacob Java COM Bridge but that doesn't seem as straightforward or simple to use, and I couldn't get it to retrieve cell values (even though this is the library underlying Scriptom). Are there alternatives? Jacob is really the tool for the job here. I recommend that you take the time to learn a bit about how COM and ActiveX work, and I think you'll find that it's easier to

From VB6 to .net via COM and Remoting…What a mess!

若如初见. 提交于 2019-12-04 18:50:01
I have some legacy vb6 applications that need to talk to my .Net engine application. The engine provides an interface that can be connected to via .net Remoting. Now I have a stub class library that wraps all of the types that the interface exposes. The purpose of this stub is to translate my .net types into COM-friendly types. When I run this class library as a console application, it is able to connect to the engine, call various methods, and successfully return the wrapped types. The next step in the chain is to allow my VB6 application to call this COM enabled stub. This works fine for my

Handle HTMLElementEvents2 when DWebBrowserEvents2 has been handled using ATL's macros

感情迁移 提交于 2019-12-04 18:38:23
I'm creating a Browser Helper Object using VS2008, C++. My class has been derived from IDispEventImpl among many others class ATL_NO_VTABLE CHelloWorldBHO : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<CHelloWorldBHO, &CLSID_HelloWorldBHO>, public IObjectWithSiteImpl<CHelloWorldBHO>, public IDispatchImpl<IHelloWorldBHO, &IID_IHelloWorldBHO, &LIBID_HelloWorldLib, /*wMajor =*/ 1, /*wMinor =*/ 0>, public IDispEventImpl<1, CHelloWorldBHO, &DIID_DWebBrowserEvents2, &LIBID_SHDocVw, 1, 1> { . . . BEGIN_SINK_MAP(CHelloWorldBHO) SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID

AccessViolationException from WebBrowser control with custom IDownloadManager

半城伤御伤魂 提交于 2019-12-04 18:24:38
My .NET application hosts a WebBrowser control, and I've attached a custom download manager. Everything seems to work fine except for requests with the following two HTTP headers: Content-Type: application/octet-stream Content-Disposition: attachment; filename=blahblahblah Change or omit the content type header, and everything works fine; it's just application/octet-stream that has the problem. Remove the content disposition header and the download manager isn't used. Interestingly, this problem only happens on 32 bit machines (I've tested XP and Win 7 32 bit. Win 7/8 64 bit do not crash).

How to set ScriptingContext Response cookie after upgrade to .Net

限于喜欢 提交于 2019-12-04 18:24:05
We have a number of classic ASP websites using a VB6 DLL (COM) object for their functionality in the standard way. The DLL is regsvr32'd and the pages use Server.CreateObject to create an instance of the necessary object in the DLL, which in turn triggers the OnStartPage function of the object being created, passing in the ScriptingContext which we then use to get Request (querystring, form) information, read/update session information and read/write cookie information (etc). For clarification, the way you update/store a cookie value using ScriptingContext is objSC.Response.Cookies(Key) =

Third party code is modifying the FPU control word

*爱你&永不变心* 提交于 2019-12-04 18:23:24
问题 The introduction - the long and boring part (The question is at the end) I am getting severe head aches over a third party COM component that keeps changing the FPU control word. My development environment is Windows and Visual C++ 2008. The normal FPU control word specifies that no exceptions should be thrown during various conditions. I have verified this with both looking at the _CW_DEFAULT macro found in float.h , as well as looking at the control word in the debugger at startup.

VB.NET/COM Server code way slower than Excel VBA code

孤街醉人 提交于 2019-12-04 18:20:47
Background I have a client who needs Excel VBA code that produces formula values moved to VB.NET. He is in the business of providing financial analytics, in this case delivered as an Excel add-in. I have translated the VBA into VB.NET code that runs in a separate DLL. The DLL is compiled as a COM Server because, well, Excel-callable .NET UDFs have to be. So far, so good: Excel cells have "=foo(Range1, Range2, ...)", the VB.NET Com Server's UDF is called, and the cell obtains a value that matches the VBA code's value. The problem The VB.NET code is way slower. I can stretch a range of VBA-based

Getting CLSID for a DLL file?

妖精的绣舞 提交于 2019-12-04 18:05:17
问题 I want to create a small app to add and remove user defined context menu entries from the registry. To make this, somehow I need to get the CLSID of an arbitrary DLL so I can back up previous entries if they exist before writing new ones. Although regsrv32 somehow manages to create this magical number, I didn't find any way to get that number myself. I hope there is something better than this: scanning registry for the DLL name if not found, register it, scan again, and then unregister it

Component Object Model

不羁的心 提交于 2019-12-04 17:57:01
My question is directed towards developers who are familiar with COM. I am currently writing my college thesis which is partially about Microsoft COM. is COM still used today for purposes besides legacy code everyone says COM is obsolete. Why is the new Windows Runtime an 'enhanced' COM based API? What is meant by the word 'enhanced' are there any significant upsides to COM compared to .NET or vice versa any recommendations where to learn more about COM and .NET Interop and how exactly does it work Please support your answers with facts as much as possible! Thank you. Yes. COM is still core to