[continued from Is there a way to tell whether two COM interface references point at the same instance?]
I've got references to Inspector objects from two different sources and need to be able to tell which item from one source corresponds to which item from the other source. However, none of the approaches I have been able to come up w...
The following code produces an error hr=0x80020005 (wrong type).
#import <msi.dll>
using namespace WindowsInstaller;
main()
{
::CoInitialize(NULL);
InstallerPtr pInstaller("WindowsInstaller.Installer");
DatabasePtr pDB = pInstaller->OpenDatabase(
"c:\\foo\\bar.msi",
msiOpenDatabaseModeTransact);
}
I think...
In C#, it is possible to retrieve assembly related information like product name, version etc using reflection:
string productName = Assembly.GetCallingAssembly().GetName().Name;
string versionString = Assembly.GetCallingAssembly().GetName().Version.ToString();
How do I do the equivalent if the executing assembly is written in unmanag...
I have a COM .dll registered successfully with regsvr32 but somehow CoCreateInstance() fails to create one of its interfaces. Is there a freeware tool which can determine the reason for the failure?
...
I'm encountering problems with my .NET Framework 3.0 SP1 application. It is a C# winforms application communicating with a COM exe. Randomly either the winforms app or the COM exe crashes without any error message and the event log contains this entry:
[1958] .NET Runtime
Type: ERROR
Computer: CWP-OSL029-01
Time: 11/25...
We have built some .NET controls, and we are using them as COM controls in a PowerBuilder application.
They (mostly) consist of controls with other controls on them, some other of our custom controls, some from DevExpress. All of ours inherit from a common base - and this has the DevExpress LookAndFeel control on to ensure that we can e...
Is it possible to register a COM interface independent of assembly version?
Right now I get a registry key like
MyIfaceName, Version=1.0.3259.17799, Culture=neutral, PublicKeyToken=1234567890abcdef
But since the assembly has auto-versioning (1.0.*.*), every day I do a new build the COM-iface needs to be re-registered.
How would I re...
I am trying o load a custom font in C#, so it is usable by COM libraries (like ESRI) and by GDI+.
I want to load the font from disk and don't want to install the font on the system.
COM font is of type stdole.IFontDisp.
EDIT: using in AddFontResourceEx combination with the PrivateFontCollection solves the issue.
...
What is the C++ equivalent to GetObject in JavaScript and VBScript?
The closest match I found to my question is:
http://codewiz51.blogspot.com/2008/06/vb-script-getobject-c-api-cogetobject.html
However the sample use an unexisting interface and asking for the IUnknown returns null. Did someone have an example that works?
...
Anyone can explain the difference between types mentioned above and some sample usage to clearly explain the difference between the two?
Any help would be highly appreciated!
Note: this question is a spin-off from this other question
...
I'm using Office Automation in .NET. It is leaving behind the excel.exe program. I know the fix - it is all about explicitely defining the variables. Once defined, I can properly de-allocate the ram and the GC will clean them up.
The problem is, I have literally thousands of lines of code to go through. So I'm wondering: Is there some s...
I've created a .Net library at work that is used by all of our developers. The security part of it uses Microsoft AzMan for the security backend. In order to create a security (AzMan) ClientContext I have to pass it a token value (as a uint). This is all fine an dandy until I needed to make a COM wrapper for our common library so some of...
Has anyone managed to do this? I tried making a managed wrapper class for IPropertyStore but am getting AccessViolationExceptions on the methods (i.e. IPropertyStore::GetValue) that take a pointer to PROPVARIANT (rendered as a MarshalAs(UnmanagedType.Struct) out parameter in my managed version) Probably my understanding of COM and inte...
I need to invoke a VBA macro within an Excel workbook from a python script. Someone else has provided the Excel workbook with the macro. The macro grabs updated values from an external database, and performs some fairly complex massaging of the data. I need the results from this massaging, and I don't really want to duplicate this in ...
I'm trying to make a small tool that makes use of the Debugger Engine API, but I'm having very limited success.
I can get my IDebugClient and IDebugControl instances, and from there I am able to attach into an already running user process. I then enter a main loop where I call WaitForEvent, OutputStackTrace, SetExecutionStatus(DEBUG_ST...
I've read many of the other threads here about managing COM references while using the .Net-Excel interop to make sure the Excel process exits correctly upon exit, and so far the techniques have been working very well, but I recently came across a problem when adding new worksheets to an existing workbook file.
The code below leaves a z...
I imagine I can compile a C# DLL and then expose it as a COM object so that it can be CreateObject'd from VBscript. I'm just not sure the steps involved in doing this...
...
I am using a program that talks to my COMM port, but I have made another program that I want to "sniff" the comm port messages and perform it's own actions against those messages in addition. Is this possible in .NET c#?
...
I have an x64 server which, since my libraries are compiled to AnyCPU, run under x64. We are needing to access a COM component which is registered under x86. I don't know enough about COM and my google searches are leading me nowhere.
Question: Can I use a symbolic registry link from x64 back to x86 for the COM component? Do I need t...
I Use Jacob (JAVA COM Bridge) on a 64 Bit Machine and want to load COM Objects from a 32 bit DLL. How can I do that?
...