com

Delphi and COM: TLB and maintenance issues

試著忘記壹切 提交于 2019-12-18 04:44:13
问题 In the company that i work, we develop all the GUI in C#, but the application kernel is mainly developed in Delphi 5 (for historical reasons), with a lot of components made in COM+. Related to this very specific sort of application a I two questions: Experienced guys in Delphi and/or COM, do you have any workrounds to work with the buggy TLB interface ? Some of the bugs are: IDE crashing during edition of a large TLB, lost of methods IDs, TLB corruption, etc. Here, we haven't found any good

SaveAs vs SaveAs2 in the Microsoft Office Word object model

坚强是说给别人听的谎言 提交于 2019-12-18 04:34:10
问题 It looks like SaveAs has gone away in Office 2010 in favor of SaveAs2. What is going on here? Are there any important differences between the two? My fix has been to check for SaveAs2 first, and then fall back to SaveAs. Is this reasonable? 回答1: It hasn't gone away, you've just got another way to save the document. Save2() takes an extra argument, CompatibilityMode. If you don't care about the compatibility mode then just keep using Save(). If you do then check Application.Version to verify

basic playback with programmatically created windows media player

老子叫甜甜 提交于 2019-12-18 04:26:10
问题 I was trying to "just quickly integrate" the Windows Media Player via COM to play single files from the local file system or http sources - but due to the sparse documentation and online resources to its usage when not embedding into some kind of an Ole container, i couldn't get that supposedly trivial use-case to work. Initialization etc. works fine, but actually playing some file always fails. Example code, starting with initialization (error handling stripped, basically translated from the

calling C# from c++ com add-in

北城以北 提交于 2019-12-18 04:24:10
问题 I have a COM add-in written in C++ (not C++ / CLI). I want to call a C# library objects/methods from this C++ com library. I guess the CCW comes into picture here, which i am currently reading about. Are there any quick pointers to this stuff from your experience? Also, i have a method in my Com add-in that i would like my C# library code to call - i.e. a method pointer invocation. Can you help telling me how i can do this please - i.e. how do i go about passing the method pointer to the C#

How to use COM (Component Object Model) in Golang

為{幸葍}努か 提交于 2019-12-18 04:20:09
问题 I have a Windows DLL (XA_Session.dll) file but I don't know how to use it in golang. This is a DLL Viewer picture I want to use the ConnectServer COM Method. Here is my code package main import ( "syscall" "fmt" ) var ( mod = syscall.NewLazyDLL("XA_Session.dll") proc = mod.NewProc("DllGetClassObject") ) func main() { var bConnect bool bConnect = proc.ConnectServer("hts.ebestsec.co.kr", 20001) if bConnect { fmt.Println("Success") } else { fmt.Println("Fail") } } compile error: .\main.go:17:

Getting the helpstring attribute applied to C# properties exposed via COM interfaces

风流意气都作罢 提交于 2019-12-18 04:14:33
问题 I'm currently working on a library that's to be exposed to COM for use in a legacy project that's being upgraded. I'm creating interfaces that are to be exposed, and they have properties on them with long, int, etc types. Using the DescriptionAttribute, I can get helpstrings generated in the .tlb for interfaces, classes, and methods, but for some reason it doesn't seem to want to work for properties. Is there anyway to get a helpstring generated in the TLB output for properties ? 回答1: You

Getting the helpstring attribute applied to C# properties exposed via COM interfaces

淺唱寂寞╮ 提交于 2019-12-18 04:14:11
问题 I'm currently working on a library that's to be exposed to COM for use in a legacy project that's being upgraded. I'm creating interfaces that are to be exposed, and they have properties on them with long, int, etc types. Using the DescriptionAttribute, I can get helpstrings generated in the .tlb for interfaces, classes, and methods, but for some reason it doesn't seem to want to work for properties. Is there anyway to get a helpstring generated in the TLB output for properties ? 回答1: You

Export a Python List to Excel

陌路散爱 提交于 2019-12-18 04:09:43
问题 I am trying to export a list to excel via the Win32COM client whihc i have imported at the header. The object i created is coded as below, but I cant seem to get it to export each value to its own row in the spreadsheet. If I can get a good pointer (other than give up python!! :D), I would appreciate it. class XcelExport(): def excel(self): app = 'Excel' xl = win32.gencache.EnsureDispatch('%s.Application' % app) ss = xl.Workbooks.Open(r'C:\MyFile.xls') sh = ss.ActiveSheet xl.Visible = True

Why do we need “this pointer adjustor thunk”?

大城市里の小女人 提交于 2019-12-18 04:09:32
问题 I read about adjustor thunk from here. Here's some quotation: Now, there is only one QueryInterface method, but there are two entries, one for each vtable. Remember that each function in a vtable receives the corresponding interface pointer as its "this" parameter. That's just fine for QueryInterface (1); its interface pointer is the same as the object's interface pointer. But that's bad news for QueryInterface (2), since its interface pointer is q, not p. This is where the adjustor thunks

How to pass an array (Range.Value) to a native .NET type without looping?

耗尽温柔 提交于 2019-12-18 03:42:48
问题 What I am trying to do is populate an ArrayList using .AddRange() method in VBA using late binding on native C# ArrayList , but I can't figure out how to pass an object other than another ArrayList to it as argument... anything else I have tried so far fails... So basically what I am doing now (Note: list is C#'s ArrayList via mscorlib.dll) Dim list as Object Set list = CreateObject("System.Collections.ArrayList") Dim i As Long For i = 1 To 5 list.Add Range("A" & i).Value2 Next But this is