I have a VB6 ActiveX DLL that has run fine on all our machines for several years. Recently our IT manager setup several locations so they remote into Terminal Server 2008 and run the program that accesses my DLL on the Terminal Server so that their databases are local to the corporate network. My DLL runs very slowly on the terminal serv...
I have a COM object written in managed code (C++/CLI). I am using that object in standard C++.
How do I force my COM object's destructor to be called immediately when the COM object is released? If that's not possible, call I have Release() call a MyDispose() method on my COM object?
My code to declare the object (C++/CLI):
[Gui...
UPDATED
I'm trying to programmatic-ally set a COM+ component's ConstructorString with a value for later initialization.
The code in question works fine on WinXP, Win2k3, Vista and Win2k8.
I'm failing on Win7 - Home Premium version.
I've determined by trial and error that there seems to be a size limit on the constructor string - if t...
Hi,
In ATL if I create webbrowser control using IWebBrowser2, it works great in Windows Mobile. I am able to visit all sites, progress bar comes, everything is fine..
rest of UI content I can't do in ATL, since it's time consuming. I would like to go for c#.
can any one suggest me how to make ATL activex control and use it in c#.
Thank...
In ATL there's a BEGIN_COM_MAP macro for declaring a table that controls how the QueryInterface() behaves when called on the corresponding class object.
Inside it has the following line:
static const _ATL_INTMAP_ENTRY _entries[] = { DEBUG_QI_ENTRY(x)
which means that the first table entry will be DEBUG_QI_ENTRY which expands as f...
ATL END_COM_MAP macro is defined as follows:
#define END_COM_MAP() \
__if_exists(_GetAttrEntries) {{NULL, (DWORD_PTR)_GetAttrEntries, _ChainAttr }, }\
{NULL, 0, 0}}; return _entries;} \
virtual ULONG STDMETHODCALLTYPE AddRef( void) throw() = 0; \
virtual ULONG STDMETHODCALLTYPE Release( void) throw() = 0; \
STDMETHOD...
What's the best way to get a chunk of memory (i.e. void*) from a COM server to C#?
We have been using an IStream (using CreateStreamOnHGlobal) and passing that back, which worked. However when we tried this on x64 CLR with x32 C++ COM it blows up.
The COM has to be x32 because it uses external 32 bit DLLs. The C# could be forced to r...
I have an ATL/COM-based DLL, written in VC++ 6.0. Until recently, there was a one-to-one correspondence between my COM interfaces and classes. For example, let's say there was a ICar interface; then there was also a CCar class which implemented it, and no class other than CCar implemented ICar, and CCar implemented no interface (of min...
Is it possible to know if a given DISPID (result of GetIDsOfNames) is either a method, a property getter or setter ?
...
I am trying to develop an IThumbnailProvider for use in Windows 7. Since this particular thumbnail would also be dependant on some other files in the same directory, I need to use something other than IInitializeWithStream to a path to work with, this being IInitializeWithItem. (Alternatively, I could use IInitializeWithFile, but that is...
I am working on a set of what are essentially plugins, which are COM servers. Each plugin has a set of configuration data which is managed by another component, the primary key to the configuration data is the plug-in's ProgID. When the plugin needs to access a configuration item, it makes a call and passes in its ProgID and the name of ...
I have some MFC code (custom CWnd controls and some classes to expose) that I need to make into an activex / COM object with interfaces. Is it easier to make an ATL project with MFC support and make my ActiveX that way or make an MFC ActiveX control?
When doing an activeX control, is doing dual interfaces (like that explained in ACDual ...
ATL provides a bunch of macros for creating so-called COM maps - chains of rules of how the QueryInterface() call behaves on a given object. The map begins with BEGIN_COM_MAP and ends with END_COM_MAP. In between the the following can be used (among others):
COM_INTERFACE_ENTRY, COM_INTERFACE_ENTRY2 - to ask C++ to simply cast this cla...
Suppose my COM object implements two or more COM interfaces:
class CMyClass : public IPersistFile, public IPersistStream {
};
when implementing QueryInterface() I need to be able to return an IUnknown* pointer. Since both base interfaces are derived from IUnknown I cannot upcast implicitly - such upcast would be umbiguous. To upcast e...
Assume I have a class implementing two or more COM interfaces:
class CMyClass : public IInterface1, public IInterface2 {
};
Almost every document I saw suggests that when I implement QueryInterface() for IUnknown I explicitly upcast this pointer to one of the interfaces:
if( iid == __uuidof( IUnknown ) ) {
*ppv = static_cast<IIn...
I'm in the process of converting an application from Visual Studio C++ 6.0 to Visual Studio 2008 and am running into problems with ATL.
I've been having a whole host of issues, but this is the first call that differs in return values between the two different compilers.
The following line, when compiled with VC++ 6.0, returns S-OK. Wh...
I'm new to COM. What exactly is the advantage of replacing:
L"String"
with
CComBSTR(L"String")
I can see a changelist in the COM part of my .NET application where all strings are replaced in this way. Would like to know what is the need for this.
...
What are the most frequently encountered causes for COM memory leaks?
I have read that passing the address of an initialized CComBSTR to a function as an [out] parameter causes leak. I'm looking to enumerate other common programming mistakes like this.
...
I'm finding leaked heap blocks by using the following command in WinDbg
!heap –l
With each leaked heap block I get, I'm running to following to get the stack trace.
!heap -p -a leakedheapblock
The following is the result of this command:
address 1c841cc0 found in
_HEAP @ 3930000
HEAP_ENTRY Size Prev Flags UserPtr UserSize - s...
I am writing a native COM/Ole/ActiveX wrapper for a scripting language.
I need some advices to implement events/callback (like onreadystatechange from Microsoft.XMLHTTP object)
I noticed that some COM objects can call my custom object through an IDispatch interface. Is it the only way to manage events ?
...