atl

Error: MFC projects cannot define _ATL_NO_EXCEPTIONS

I'm extending an open source project. After including afxcoll.h in a new C++ file in order to use CStringArray, I get this error: Error: MFC projects cannot define _ATL_NO_EXCEPTIONS I suspect I'll be able to fix the error by adding #defines or changing or rearranging the inclusion of headers, or, if that's not possible, using somethi...

Handle when IE window moves - Visual C++

I want to handle window move events. My first try was to handle DWebBrowserEvents2::WindowSetHeight, WindowSetLeft, WindowSetTop and WindowSetWidth events, but for some reasons, these events didn't get fired at all.I've handled window resize by handling HTMLWindowEvents2::onresize. How would I handle when the window moves? I've also trie...

How to compare two BSTRs or CComBSTRs?

Hi, What is the right way to compare two CComBSTRs? I tried to use bool operator ==( const CComBSTR& bstrSrc ) const throw( ); However it always return false even two ComBSTRs are the same. It did not work correctly. Do I have to convert CComBSTRs to ANSI string first and then use strcmp? Thanks! -bc ...

What's the point of _MERGE_PROXYSTUB?

I have generated an ATL COM object using VS2008 and the code contains references to a definition called _MERGE_PROXYSTUB (because I chose the 'Merge proxy/stub' option when I initially ran the wizard.) What is the point of a proxy/stub? If I don't select the the merge option then I get a separate MyControlPS.DLL instead - when would th...

Is it possible to prohibit putting my in-proc component into COM+?

I have an ATL C++ in-proc COM component. This component is not for external use - I only need it for use in our application. Once in a while users put it into COM+ and this leads to all sorts of weird errors - "Access denied", etc which I'd like to just never hear about. The best way would be to do something that would prohibit putting ...

Looking for .NET 3.5 (or upcoming 4.0) GUI Performance Benchmarks

Using ATL/COM-based technology as the basis of comparison, I'm looking for some recent and fairly in-depth benchmarks on .NET Windows forms & controls which compare the two frameworks (if any). For example: Application load/start-time. Resource usage (GDI handles, memory, etc.) Garbage collection pauses (obviously, applies to .NET onl...

text change event in ATL c++

I have handle of a text box and want to trigger an event in ATL c++ on any text change in text box. ...

HASP key on ATL Web Service and Windows Vista / IIS 7

Hi! I developed a ATL C++ Web Service on VS 2005 to access a HASP hardware key. This code works fine on Windows XP and IIS 6. When i try it to run under Windows Vista and IIS 7, the w3wp.exe process that is responsable to run the web service, crash with a access violation error. Someone had already this problem ? sugestions needed. Than...

VB6 GUI not working in multithreaded COM environment

I have a VB6 COM client that makes calls to an inprocess STA ATL/COM server. One of the Server methods, X, can take a while to finish so I need to be able to cancel it. What I tried was to run the method code in a new thread and include another method, Y, that does a timed WaitForSinleObject. So the client first calls X then goes into a ...

How to marshall COM object on the server side in visual c++?

I have a out-of-process COM server with an ATL Simple Object which creates another thread. The new thread will need to make calls to ATL Simple object. Since ATL Simple Object and new thread are created different apartments, ATL Simple Object needs to be marshalled in the new thread, otherwise error 0x8001010e will be generated. How do...

Is there a document on .rgs files syntax?

Resource scripts loaded from .rgs files are used with ATL CComModule::UpdateRegistryFromResource(). It's quite common to see samples of such files on the net but I've never seen a complete description on what constructs are allowed in .rgs files. Is there such a document? ...

How to inject script to listen for activeX events?

HI, I've trying to listen for events fried by my ATL object. I find that if I include a script as follows directly in the HTML of the page it picks up the event correctly. <html> <head> <script event="genericScriptEvent(param0, param1, param2, param3, param4, param5, param6, param7, param8)" for="CMyControl" type="text/javascript"> ...

How to fix COM outproc server initializing error 0x80004015?

I have a COM outproc server written in ATL that registers itself using _Module.RegisterClassObjects(CLSCTX_LOCAL_SERVER, REGCLS_SINGLEUSE) and it results in an HRESULT error code 0x80004015 (which means CO_E_WRONG_SERVER_IDENTITY). What causes this error code, and how can I work around this error? ...

Do the new ATL CComModule replacements implement RegOverridePredefKey correctly?

I have a project that stated in an old version of Visual C++, so it uses CComModule. The only problem is that I set up RegOverridePredefKey to install in HKCU if HKCR fails. This works fine in XP, but on Vista, the implementation is broken! I found some posts on the internet corroborating that it is indeed broken. I was wondering: 1) ...

How does Install Shield "COM Extract at Build" work?

Our product contains a VC++ ATL in-proc COM server with two COM-exposed classes - ClassA and ClassB. This COM server is added into an Install Shield 2008 installer package and "COM Extract at Build" property is set for the component. ClassA and ClassB are exposed in exactly identical manner by the component - there's an .rgs file for ea...

Firing a COM Event From Another Thread

I have created an in-process COM object (DLL) using ATL. Note that this is an object and not a control (so has no window or user-interface.) My problem is that I am trying to fire an event from a second thread and I am getting a 'Catastrophic failure' (0x8000FFFF). If I fire the event from my main thread, then I don't get the error. ...

Does an ATL COM Object Have a Message Pump?

If you create a new ATL project and add a simple COM object to it (note: an object and not a control) that uses the Apartment threading model, will there be a message pump running under the hood? I want to create a hidden window that is a member of my COM object class but I'm not sure if any messages will actually be delivered to it or ...

How do I create a 64-bit native ATL C++ DLL in Visual Studio 2003?

I have a 32-bit ATL C++ in-proc COM server soultion. How do I port it to 64-bit Windows? I mean how do I make VC++7 emit 64-bit code? Is it possible with Visual Studio 2003? ...

What are easy ways to use a 32-bit in-proc COM server from 64-bit applications?

I have a 32-bit native C++ ATL in-proc COM server which depends on a huge set of legacy 32-bit libraries. I need to use it from a 64-bit application with the smallest changes possible. One option is putting it into a COM+ application. What are other easy options? ...

Is there any exist API for URL-encoding in mfc c++?

I am using the following code: CAtlNavigateData navData; CStringA m_strForm = "name=+++&priv=1&password="; navData.SetPostData((BYTE*)(LPSTR)(LPCSTR)m_strForm, m_strForm.GetLength(), QHTTP_FORM_URLENCODE); special symbols such as :"+++" need to do url-encoding, without url-encoding, +++ will turned into space. I need a converer. CSt...