com

C# - How to test at runtime which COM coclass was used to instantiate an interface?

有些话、适合烂在心里 提交于 2019-12-06 11:18:35
问题 Suppose you have a COM interface ICOMInterface that is implemented by coclasses Coclass1 and Coclass2 . Neither of these coclasses have interfaces of their own (for simplicity's sake and to illustrate my issue). In C#, you can create an instance of a COM interface from a coclass like so: ICOMInterface myComInterface = new Coclass1(); Now, how can you determine whether myComInterface was instantiated by Coclass1 or Coclass2 ? Using the "is" statement like follows always returns true, and as

Call C++ function in C# from DLL - strange parameters

穿精又带淫゛_ 提交于 2019-12-06 11:12:35
I have a function writen in C++ with the next header: void EncodeFromBufferIN(void* bufferIN,int bufferINSize, unsigned char* &bufferOUT, int &bufferOUTSize); I've edited the .h and .cpp files like this, to be able calling the function by importing the DLL in C#: **EncodeFromBufferIN.h** extern "C" { __declspec(dllexport) void EncodeFromBufferIN(void* bufferIN, int bufferINSize, unsigned char* &bufferOUT, int &bufferOUTSize); } **EncodeFromBufferIN.cpp** extern void EncodeFromBufferIN(void* bufferIN, int bufferINSize, unsigned char* &bufferOUT, int &bufferOUTSize){ // stuff to be done } But

run vba code from .net applications

拜拜、爱过 提交于 2019-12-06 11:10:58
I have a very large amount of code written in VBA that I need to migrate to a .Net application. It isn't practical to rewrite all of it as there is just too much, so I was wondering if there is a way to call these vba functions from .NET Thanks. Update: I've been investigating these and it turns out they aren't appropriate. The application isn't Microsoft Office and doesn't expose any sort of "Run" macro functionality. Having done a comparison of the files produced by our legacy third party application and by the sample notepad application, the file formats (viewed in notepad) look very

Get iplImage or Mat from directshow to opencv

雨燕双飞 提交于 2019-12-06 11:07:38
问题 I had to change to directshow for my eyetracking software due to the difficulties to change resolution of the camera when using c++ and opencv. Directshow is new to me and it is kind of hard to understand everything. But I found this nice example that works perfectly for capturing & viewing the web cam. http://www.codeproject.com/Articles/12869/Real-time-video-image-processing-frame-grabber-usi I am using the version that not requires directShow SDK. (But it is still directshow that is used

How do i set Identity of COM+ server type application to Network Service in power shell

梦想的初衷 提交于 2019-12-06 11:00:23
I need to do the following thing. Create com+ application -> set activation type to Server type-> set identity as Network service->Add user group under creater owner. I am able to set activation type,but i am not able to set identity and the further steps. I am new to com+ applications. the script i have written is as follows $comAdmin = New-Object -comobject COMAdmin.COMAdminCatalog $apps = $comAdmin.GetCollection(“Applications”) $apps.Populate(); $newComPackageName = “test7” $appExistCheckApp = $apps | Where-Object {$_.Name -eq $newComPackageName} if($appExistCheckApp) {

Need to remove an Object from DCOM config (DCOMCNFG)

情到浓时终转凉″ 提交于 2019-12-06 10:37:45
We have an application with activex exe and a com dll. After installing we get an object created in DCOM config. If we try to delete this object from DCOM config, it goes off till we again reopen it. Want to know if there's any procedure to delete this object completely from DCOM and its registries. No idea why this would be tagged VB.Net, but... You can remove most of the server's registration entries by running the EXE with a command line switch as in: MyAx.EXE /unregserver However this leaves a system-synthesized entry under HKCR\AppID after first use. As far as I know you must manually

Embedding objects into Microsoft Word and OpenOffice Writer

徘徊边缘 提交于 2019-12-06 10:26:12
问题 I am looking for some references on how to implement the following feature: ability to embed objects (e.g. diagrams) into word processors and being able to edit them in their respective "mother" application For example, MS Word and Visio work like this together, allowing the user to easily edit/tweak the diagrams after adding them to the word processor. I am interested in how this is done on the following platforms: Microsoft Word OpenOffice So far I know that: Microsoft Word -- uses OLE/COM

How can I find out about undocumented .NET / COM library functions?

一笑奈何 提交于 2019-12-06 10:23:39
How can I find out the properties and methods of COM objects returned from some .NET functions, which do not appear to be documented? In the particular example I'm looking at, I'm inserting a picture into Excel using a function like: Set NewPic = ActiveSheet.Pictures.Insert(FileName) (See the SO post on this here .) However, the MSDN documentation for this function only says that Worksheet.Pictures returns an Object, and when I put a watch on the variable during debugging its type is System.__ComObject. Can I find out what other properties and functions might be available for that class (for

WinApi: Get Control Name of COM Forms

自闭症网瘾萝莉.ら 提交于 2019-12-06 10:17:30
问题 I want to replace my current UI automation tool (QTP) with .Net framework. I need to test VB6 (COM) application. One of the fundamentals of framework is using the form name. So far I failed to find a way to get this data using Win API. There is only one constrain for the solution and its that the solution MUST rely on .Net code - meaning: no commercials tools allowed . Does anyone is familiar with this subject? These links are my major references: http://msdn.microsoft.com/en-us/library

How to enable early binding of VBA object variable to COM classes created in .NET

回眸只為那壹抹淺笑 提交于 2019-12-06 09:50:16
I seem to be having trouble getting my COM class library (.NET-based) to support early binding. I am creating a class library in VB.NET 2003 for use in Office 2003 VBA (and later for Office 2010). Documentation @ StackOverflow and elsewhere has brought me to this bit of code: Imports System.Runtime.InteropServices <InterfaceType(ComInterfaceType.InterfaceIsDual), _ ComVisible(True), _ Guid("<some valid GUID>")> _ Public Interface _TestCOMClass Function Test() As String End Interface <ClassInterface(ClassInterfaceType.None), _ ComVisible(True), _ Guid("<another valid GUID>"), _ ProgId(