How do i implement Mutex lock in Nant,
the reason why i need this feature is because
i register COM components in order to get my build working , and then end of the build
i Un Register the COM components.
without mutex lock, different version of COM are registered and face some issues.
so it would be better if we apply mutex lock i...
I'm implementing a COM interface that should return int values either S_OK or E_FAIL. I'm ok returning S_OK as I get that back from another call (Marshal.QueryInterface), but if I want to return a failure value what actual value do I use for E_FAIL?
(It's such a basic fundamental question that it's hard to find an answer to)
Assuming i...
So I found this example on registering DLLs: http://blogs.msdn.com/robmen/archive/2004/04/28/122491.aspx
and WiX complains about the "AssemblyRegisterComInterop" attribute. I removed that and changed the "Assembly" attribute to win32 and it says I need to specify the AssemblyManifest attribute, but I don't know what to put there.
...
I have a .NET assembly which I have exposed to COM via a tlb file, and an installer which registers the tlb. I have manually checked that the installer works correctly and that COM clients can access the library. So far, so good...
However, I am trying to put together some automated system tests which check that the installer is working...
Hi,
I have developed a prototype C# Excel 2003 add-in in VS2005 that supports an object with some simple calls, plus a separate RTD class, all sitting atop a large existing in-house C# stack.
It all works fine as-is, but...
I'm told that in order to avoid potential conflicts with other Excel add-ins that might want a different .Net ru...
I have an .Net Froms application that displays web pages through a WebBrowser control.
Is there anyway that I can detect if the control shows a 'Page not found' or 'Cannot display webpage' error?
There doesn't seem to be any error event handlers.
...
When I try to connect to WMI from Powershell, ConfigMgr, or WMI explorer, I can talk to the majority of my computers, but some (maybe 30%?) return an 0x800706ba (RPC server is unavailable).
If I turn the firewall off on the remote machine, the queries start working. I have tried a bunch of different configurations of firewall settings,...
I have an old C++ COM component which has to stay in Visual Studio 6.0 format. I can't for the life of me figure out how to debug the code in the actual COM component.
I'm able to build it in debug mode, add breakpoints and attach it to the dllhost.exe process, but the Visual Studio environment will only show me the disassembly from dl...
I would like to extract a bitmap from an html page. I expected to find a IStream, IPersistStream or IPersistStreamInit from the IHTMLImgElement I got in the web page. However I can't found any of those.
I could read the picture from the cache but this is somewhat unreliable and I would like to avoid reading from the filesystem.
Is ther...
I have a c# class which uses the WindowsIdentity namespace to return details of the current Active Directory user. This is accessible through a web part on SPS and sure enough returns the desired record values specific to that user.
I have a classic ASP application which I would like to have inherit this functionality. After wrapping ...
I am building a C# ActiveX DLL... do I use REGASM or REGSVR32 to register it?
How do I register the 64-bit interface vs the 32-bit interface?
...
I have a strange phenomenon while continuously instantiating a com-wrapper and then letting the GC collect it (not forced).
I'm testing this on .net cf on WinCE x86. Monitoring the performance with .net Compact framework remote monitor. Native memory is tracked with Windows CE Remote performance monitor from the platform builder toolkit...
Using VS 2008, here is my COM object
using System;
using System.Collections.Generic;
using System.Text;
using System.Runtime.InteropServices;
using System.Windows.Forms;
namespace TestCom
{
[Guid("9E5E5FB2-219D-4ee7-AB27-E4DBED8E123E")]
[ClassInterface(ClassInterfaceType.AutoDual)]
[ProgId("Test9.COMINT")]
public cl...
I am working with a COM component. There is a method that does this call to the component, and this method is used many times in my application, for each document to be processed, this method is called.
One weird thing happens sometimes suddenly, doesn't matter the amount of documents processed, it can happen after processing 60, 100 or...
When I define an interface in IDL which does not derive from anything, the MIDL precompiler warns as such (Visual C++ 2008) :
warning MIDL2271 : [object] interfaces must derive from another [object] interface such as IUnknown (...)
And if I derive my interface from another which does not derive from IUnknown, MIDL fails :
error ...
I've seen a lot of example c++ code that wraps function calls in a FAILED() function/method/macro.
Could someone explain to me how this works? And if possible does anyone know a c# equivalent?
...
I have an ATL control that I want to be Unicode-aware. I added a message handler for WM_UNICHAR:
MESSAGE_HANDLER( WM_UNICHAR, OnUniChar )
But, for some reason, the OnUniChar handler is never called.
According to the documentation, the handler should first be called with "UNICODE_NOCHAR", on which the handler should return TRUE if you...
when reading data through serial port
VARIANT data;
BSTR k;
if(m_mscom.GetCommEvent() == 2)
{
data = m_mscom.GetInput();
k = data.bstrVal;
}
What is BSTR k; and
what do you mean k=data.bstrVal? What is bstrVal?
...
I have an MFC wrapper over a COM object. There is a function that takes a large number of options, which are mostly optional. How do I pass some arguments but not others?
For what it's worth, the optional arguments are listed as VARIANT*.
Below is the code
CComVariant vFalse = false;
CApplication application;
{
application.Cr...
I've added a reference to a co-worker's COM DLL -- MyLogic.dll -- to my C# project in Visual Studio 2005. As expected, this auto-generates Interop.MyLogicLib.dll in my output folder. However, the version number of the COM DLL is 2.1.0.180, whereas the version number of the auto-generated interop assembly is 1.0.0.0. How do I get Visual S...