When I try to sign the assembly I get the following error:
Error 1 Assembly generation failed -- Referenced assembly 'comlib' does not have a strong name
Is it possible to sign an assembly that reference unsigned assemblies or do I have to sign the COM interop assemblies as well?
...
We are using a software library from a major US manufacturer. For years the library had mainly two interfaces, a bunch of C API DLLs and a collection of ActiveX controls which encapsulate the DLL functionality. The ActiveX interface worked pretty well back in the old days of Visual Basic 6. Then .NET appeared with it's COM Interop compat...
This questions is a follow up on an answer by Paul Alexander to the question "Should interop assemblies be signed?".
Depending on how complex your Interop assemblies are - you can generate the proxy code into a separate .CS/.VB file and compile it directly into your assembly. Then you won't have to worry about strong name issues.
H...
I'm trying to test my code that reads from a USB port (COM25 when the device is connected) that is created when a device is connected to my computer and to a boat. I cannot power the USB device when not on the boat so testing is difficult. Can someone let me know how to simulate a COM port and write data to it so my test program is able ...
Hello.
I need to access a third-party COM server with following interface definition (idl):
interface IDisplay : IDispatch
{
HRESULT getFramebuffer (
[in] ULONG aScreenId,
[out] IFramebuffer * * aFramebuffer,
[out] LONG * aXOrigin,
[out] LONG * aYOrigin );
};
As you can see, it returns 3 values via [out] parameter m...
I am working on an Outlook Addin where I create a lot of COM objects(Outlook mail, Outlook folder etc). My understanding is that since these objects are COM objects,CLR won't release memory from these objects and i'll have to take care of releasing memory from these objects.So to release memory from these object I use
Marshal.ReleaseCo...
I'm using Powershell to test a COM object method call. Due to poor design/coding/everything, this COM object method simply hangs when it errors. My default instinct is to control+c out of it, but this does not work. Do I have to kill Powershell to kill a hung COM method call?
Thanks in advance.
...
I have a legacy Delphi COM library that accepts an ANSI string (code page 1252) as parameter.
The generated .net wrapper accepts a string for this parameter. Passing in a regular string however doesn't end well. If passed in the '°' character a question mark takes up it's spot.
How can I go and debug this? Is it the com wrapper not reco...
I have a COM method which returns a MFC CRect:
GetMFCRect(LONG* pRect)
*((CRect*)pRect) = m_currentRect;
In my .NET application I try the following:
int pointer = new int();
Rectangle rc;
IntPtr pIntResult;
unsafe
{
int* p = &pointer;
_COMobj.GetMFCRect(ref *p);
pIntResult = new IntPtr(p);
rc = (Rectangle)Marshal.PtrT...
I'm thinking that I'm going to have to run monthly reports in Crystal Reports. I've read that you can automate this with COM/ActiveX but I'm not that advanced to understand what this is or what you can even do with it.
I'm fairly familiar with Python and it looks like from what I've read, I might be able to open the report, maybe cha...
Hi-
I'm working on implementing directshow capability in a C# dll. I'm basing my work off of the C++ based "CameraCapture" example Microsoft provides with the Windows Mobile 6 sdk.
Things were going well (thanks to earlier help on this site), but I've run into a bit of a snag while trying to listen for directshow events in C# land:
I ...
I have defined the following CComPtr object and method in my class:
private:
CComPtr<IRawPdu>& getRawPdu();
// Returns the RawPdu interface pointer from the mRawPdu data member.
// mRawPdu is initialized, if necessary.
CComPtr<IRawPdu> mRawPdu;
// Initialized to 0 in the ctor. Uses lazy evaluation via getRawPdu()....
What is the necessity for the GUID attribute? why don't just let the compiler handle this automatically?!
...
Can a .NET component be used from a COM component?
...
Hi
I've added a new library to my application (multiple projects-DLLs) - SQLite, to perform some in memory caching. There is just one library/project that is affected by this change - Lib1.
A build goes through fine. All libraries are built successfully and no errors are reported, including a couple of Com Objects.
If I try to registe...
Hi, we're considering exposing some C# types to C++ clients via COM. What problems can we expect to hit over the life of the project? E.g. how will versioning be managed?
On versioning, it would seem from reading this that we should decorate our types to be exposed with [ClassInterface(ClassInterfaceType.None)] and use an explicit int...
I'm trying to return a detailed error to VB6 using CComCoClass::Error, but it seems I can only return an error code /or/ a message - but not both.
return Error(_T("Not connected"), __uuidof(IMyInterface), HRESULT_FROM_WIN32(ERROR_CONNECTION_INVALID));
results in a generic "Method 'Request' of object 'IMyInterface' failed" error messag...
Hi
We have native Win32 C++ code and a set of C# assemblies which we wish to call from the C++ code. I summaries our optios as:
Use COM. The C# code would need to be decorated with additional attributes (GUID, COMVisible). The C# assemblies would need to be registered regasm and would then be available to the native C++ code via CO...
I have some code that implements the IReflect interface for presenting an IDispatch face onto some .NET objects without sticking all of the COM interop goo onto the classes themselves.
We used this because we had a scripting client that wanted to use these classes, but we didn't want to put all the COM interop stuff onto the classes the...
I'm trying to get the Global Interface Table by using the following code (Delphi):
uses Comobj, ActiveX;
var
cGIT : IGlobalInterfaceTable = NIL;
const
CLSID_StdGlobalInterfaceTable: TGUID = '{00000146-0000-0000-C000-000000000046}';
function GIT : IGlobalInterfaceTable;
begin
if (cGIT = NIL) then
OleCheck (CoCreateInsta...