atl

Handling ATL/ActiveX events from within JavaScript

I have an ATL ActiveX control that raises three events (Connected, Authenticated, Disconnected) which need to be handled in IE/JavaScript. So far as I can tell, I'm doing everything right, specifically: (1) I've told ATL to implement the IProviderClassInfo2 interface, as described here. (2) I've implemented connection points within my...

How can I get the right click event object file name?

I created a ATL/COM project, and implement the IShellExtInit interface. In the Initialize method, I use the DrapDropFile function to get the file names of the files whose selected in the folder. e.g. 1.In the folder C:\WINDOWS\MyFolder\ contains the files: a.png, b.bmp, c.jpg 2.Right click the "b.bmp". 3.In the Initialize method, I...

make my activex control removable from manage addons

I have an activex control. I want my users to be able to remove it. This MS article implies that you can remove controls if you installed them yourself: You can only delete ActiveX controls that you have downloaded and installed. You can't delete ActiveX controls that were preinstalled or add-ons of any kind, but you can ...

Why do people use ATL for COM programing?

Can you provide an example that through comparation shows the benifit of ATL? ...

What's the ATL way to open a named pipe in windows in c++?

hPipe = CreateFile( lpszPipename, // pipe name GENERIC_READ | // read and write access GENERIC_WRITE, 0, // no sharing NULL, // default security attributes OPEN_EXISTING, // opens existing pipe 0, // default attributes N...

Microsoft ATL equivalent to Borland OleCheck function

Borland C++ Builder provides the function OleCheck(HRESULT Result);. Its description in the documentation is this: OleCheck is used to wrap many COM routines, so that if that routine fails, users will have an opportunity to handle it in the resulting exception that is raised. If ECode is a value less than zero, OleCheck raises...

Do I still need to call CoInitialize(NULL) and CoUninitialize() if I switch to ATL?

Are CoInitialize(NULL) and CoUninitialize() automatically called by ATL? Or I still have to call CoInitialize(NULL) and CoUninitialize() at the beginning and end of my COM application respectively? ...

How to rewrite the function below with ATL?

HRESULT EnumerateVideoInputFilters(void** gottaFilter) { // Once again, code stolen from the DX9 SDK. // Create the System Device Enumerator. ICreateDevEnum *pSysDevEnum = NULL; HRESULT hr = CoCreateInstance(CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC_SERVER, IID_ICreateDevEnum, ...

COM - what does _pAtlModule->Lock() lock exactly?

Hi I'm working my way through learning writing a COM control. I've got an example project, and it uses the lines _pAtlModule->Lock() _pAtlModule->Unlock() in the OnCreate() handler and the OnDestroy() handler for the COM control respectively. I realise that the _pAtlModule is an instance of the CAtlModule - the "application" object ...

COleDateTimeSpan: GetTotalDays vs GetDays

Both functions GetTotalDays and GetDays of COleDateTimeSpan class returns number of days contained in object: GetTotalDays: http://msdn.microsoft.com/en-us/library/d22h87z4(v=VS.80).aspx This date/time-span value expressed in days GetDays: http://msdn.microsoft.com/en-us/library/ze8kz4yw(v=VS.80).aspx The day portion of this d...

How to avoid including standard interfaces in type library

In my ATL project I have an interface that looks like this interface IGenericDecorator : IUnknown { HRESULT CreateInternalObject([in] IClassFactory* pClsFactory); }; After I build the project I see definition of IClassFactory included in the type library. How can I avoid this? I don't need IClassFactory to be defined in my type ...

CAtlHttpClientT::SetProxy causing failed connection

I have some client code which needs to call methods on a remote web service. To allow the client out through any proxy server which may be in use I'm trying to use the CAtlHttpClientT::SetProxy function which, according to MSDN: "Calling this method causes all HTTP transactions to be routed through the given proxy server. Calling SetPro...

how to raise resize request to active-x container?

We have an active-x control developed using ATL with MFC support. Our active-x control shall be used in something called frame application. The frame application create its own active-x control and embed our active-x control inside it at runtime. There are 20+ frame applications in the industry. Now the issue is that each frame applicat...

Adding new line to button's title/description in outlook 2007 ribbon

Hi I am developing an add-in for Outlook ribbon 2007 using ATL/C++. The ribbon tab contains a dynamic menu which has a list of buttons generated at run-time. I would like to add new line to the button's label and/or description but not sure how. I tried adding newline character ("\n") to the button's label and description but it looks l...

Does using atlbase.h makes my compiled app to have some extra dependencie?

I would like to know if including atlbase.h in my c++ project will make the compiled application to have a dll dependency or something like that. ...

Migrating ActiveX Component from VC++6 to VC++2008 giving errors in cstdio and xiosbase

I am trying to port VC++6 code which builds an ActiveX component to VC++2008. Whenever I use "#include", it is giving me errors which point to cstdio and xiosbase. I dont understand the reason for it, Can someone let me know why this is happening? Error trace: c:\Program Files\Microsoft Visual Studio 9.0\VC\include\cstdio(34) : error C...

Adding includes causes compilation error

Compiling with Visual Studio 2005, on Windows XP. I add the following headers to my "stdafx.h" file like so: #include <atlbase.h> #include <atlcom.h> #include <atlcore.h> #include <atlstr.h> (technically the same error appears with just atlbase.h included) which produces the following errors: error C2334: unexpected token(s) precedi...

Can I use streaming structures in ATL ?

Hi I'm developing a COM component in an ATL project. I want to use std::ostringstream for logging some trace by log4cxx. Unfortunately seems that ATL doesn't support std::ostringstream and derivatives. Does any of you have an idea how can I use streaming classes in an ATL project or any alternative way? Thanks. ...

How Can I pass message from DLL to Application

I have a ATLCOM Shell Extension which adds Right Click Extension to Windows Explorer. How Can I pass a message from my DLL to another MFC application. To Sumarize, I want to pass a Message from DLL to MFC application. ...

Can I add MFC support to an Existing ATL COM project

I have created a Shell Extension using ATL COM Object . But during creation I haven't added MFC support. Can I change the setting now to add MFC support ...