com

Creating COM objects with Java

谁说我不能喝 提交于 2019-12-12 16:09:56
问题 To add support for some new features in a VB3.0 legacy application, I need to create a COM object in Java. I found some tutorials in the Internet, but they all refer to the discontinued javareg.exe tool distributed by Microsoft. I was unable to find a download place nor the MSJVM virtual machine required to run the COM object's code. So, in nowadays, how can I expose a COM-object written in Java to any other application? 回答1: Check the ActiveX Bridge. The ActiveX Bridge allow a component

How to import IDL into Delphi?

与世无争的帅哥 提交于 2019-12-12 15:23:47
问题 How do i import an Interface Definition Language ( idl ) file into Delphi; converting the types and interfaces to a pascal file? I've tried: File , Open : it just shows the text of the .idl text file Project , Add to project : It just (acts like) it adds a .idl text file to the project Component , Install component , Import a Type Library , Add : But it causes a handled crash Component , Install component , Import ActiveX Control , Add : But it causes a handled crash using Embarcadero's

Can UDT's be used as method parameters in any way?

非 Y 不嫁゛ 提交于 2019-12-12 14:45:38
问题 For years I've been avoiding the use of Public Type UDT's in VBA, because they're hard to pass around and I never really bothered trying to understand why.. until now - it was simply easier to just create a class module and work with actual objects instead. But recently I gave it a shot, and once I figured they had to be passed ByRef (as an array would), things started to look like I could start using them. So I defined a Public Type in a standard module, got this compile error: So I moved

How to handle external not stable code?

こ雲淡風輕ζ 提交于 2019-12-12 14:29:44
问题 I have asp.net Web Api 2 Application that is working with External COM Object (pvxcom) . In Some reasons COM Object is hanging, there is no chance for me to report bug for pvxcom . I need to figure out something to bypass this issue. I want to clarify some points. How can I set maximimum execution time for external source ? How can I force browser to resent request ? ( is it possible ? ) How can I figure out in which procedure of COM Object is hanging ? Is it good practice to dispose com

Calling a method of a WMI Class

我只是一个虾纸丫 提交于 2019-12-12 14:13:46
问题 I'm attempting to call the following method: https://msdn.microsoft.com/en-us/library/dn469242(v=vs.85).aspx The corresponding powershell is: wmic /namespace:\\ROOT\Microsoft\Windows\DesiredStateConfiguration class MSFT_DSCLocalConfigurationManager call GetConfigurationStatus I can't quite figure out how to do it correctly using go-ole. Here's what I have so far. It fails with: invoke_test.go:47: wmi: error calling method GetConfiguration: Exception occurred. Generic failure ) When I try

XmlSchema.Read gives COMException “Catastrophic failure”

狂风中的少年 提交于 2019-12-12 13:55:23
问题 I've got a utility class with a few method relating to XML schemas. Without any code changes nor any know changes to the environment, it has suddenly started to fail systematically. The method that fails: public static XmlSchema GetSchema(string xsdFileName) { string path = MyConfiguration.XmlSchemaLocation; if (!path.EndsWith(@"\")) { path += @"\"; } path += xsdFileName; return XmlSchema.Read(File.OpenRead(path), null); } The stack trace shows XmlSchema.Read is internally attempting to

Memory Leak in Threaded COM Object with Python

时光怂恿深爱的人放手 提交于 2019-12-12 13:37:57
问题 I am creating a COM client within a thread and performing several operations with this client. Each thread is spawned from a server that uses Python's socketserver module which has built-in threading support. When I am loading and using this COM object there is an expected spike in memory usage by python.exe. With 10 concurrent threads there is a peak in memory usage of about 500Mb. However when the operations are finished and the COM object is apparently released, there are 50Mb of

Why I don't need call CoInitialize in a thread created inside a COM Thread?

╄→尐↘猪︶ㄣ 提交于 2019-12-12 13:27:05
问题 In order to learn multithreading, I've created a thread inside a COM Thread ( TRemoteDataModule ). This is my Component Factory: TComponentFactory.Create(ComServer, TServerConn2, Class_ServerConn2, ciMultiInstance, tmApartment); Inside the Thread, I didn't needed to Call CoInitialize to use TADOQuery.Create , .Open ... .Exec I read that I need to initialize the COM library on a thread before you call any of the library functions except CoGetMalloc, to get a pointer to the standard allocator,

How to pass an ADO Recordset (or any COM object) across thread boundaries?

夙愿已清 提交于 2019-12-12 13:17:53
问题 i have an ADO Recordset object that is created in a background thread: var conn: TADOConnection; rs: _Recordset; begin conn := CreateDatabaseConnection(); rs := conn.Execute(CommandText, cmdText, []); conn.Free; //Give the recordset to the UI thread //Don't forget to add a reference before we stuff it into a 32-bit variable rs._AddRef(); PostMessage(hwndUIThreadWindow, WM_HeresTheRecordsetYouAskedFor, WPARAM(rs), 0); end; And then the Recordset is handed to my "main" thread: procedure

Why AddRef returns zero

我只是一个虾纸丫 提交于 2019-12-12 13:17:46
问题 I'm debugging C++/COM application, looking at how we AddRef and Release COM objects. I came around weird case when AddRef returns 0. Here is how I get the return value: ULONG TraceAddRef(LPUNKNOWN pUnk, const std::string &a_msg) { ULONG count = pUnk->AddRef(); // count == 0 at some point after execution ATLTRACE("%s *** AddRef: pUnk = 0x%p, referenceCount = %lu\n", a_msg.c_str(), pUnk, count); return count; } pUnk is actually IWebBrowser2 COM interface to a web control: pUnk 0x20d763ac