Click here to Skip to main content
15,881,898 members
Everything / Desktop Programming / ATL

ATL

ATL

Great Reads

by Michael Dunn
A tutorial on writing a shell extension that can be used on the Send To menu.
by Michael Dunn
A tutorial on writing a shell extension that provides custom drag and drop functionality.
by Tim Smith
Color picker control for WTL applications including optional support for XP themes
by Ernest Laurentin
Full-fledged ATL Windowless ActiveX Container. Ideal for hosting Windows Media Player, Transparent Flash and Silverlight Animations.

Latest Articles

by Javad Taheri (drjackool)
Show or hide, reorder, save and restore list view column headers
by Shivprasad koirala
This blog will discuss the difference between server.transfer and response.redirect.
by Nick Pirocanac
Linker errors due to CStringT template classes and ATL vs. MFC issues
by Midi_Mick
Using ATL and STL to create collections of COM objects without circular references

All Articles

Sort by Updated

ATL 

20 Sep 2023 by Javad Taheri (drjackool)
Show or hide, reorder, save and restore list view column headers
22 Sep 2021 by Member 638
Hi there, Using Visual Studio 2019 I created a OCX, using MFC ActiveX control wizard. This works correctly in Microsoft Access, it's useable on an access-form. Now from my CCOleControl I would like to get access to the msaccess Application or...
22 Sep 2021 by Member 638
NEWINFO: AccessibleObjectFromWindow() seems to be what I need to get to MS access from OLE-ActiveX. Still struggling with RowSource property.. access crashes when property with this name is on the OLE-control. Anybody any hints/suggestions for this?
16 Jun 2021 by Shivprasad koirala
This blog will discuss the difference between server.transfer and response.redirect.
30 May 2021 by Donny Hardo
A lot of people still use Visual Foxpro, even though Microsoft stopped supporting it years ago. You can download the legacy oledb driver (VFPOLEDB) but it is only 32 bit. There are lots of well documented troubles of people struggling to use it...
30 May 2021 by KarstenK
Your starting point should be OLE DB Providers Overview from Microsoft. But I think that your efforts to "ride a dead horse" arent the best investment of time and money. Consider changing the data connection of VFP to the database. My best guess...
27 Apr 2021 by RichardK151
Hi, i have a partially transparent windowless ATL control. The control is hosted in a third party container, which i can't change. When the control paints via OnDraw, the transparent part is flickering (showing a black background in the...
27 Apr 2021 by KarstenK
Dont set the background to transparent. Read this Understanding OnPaint() article to better understand the drawing system. You must return TRUE from OnEraseBkground. Best is to drawn an own background color in it. Be sure that no reload or...
15 Nov 2020 by Nick Pirocanac
Linker errors due to CStringT template classes and ATL vs. MFC issues
8 Nov 2020 by rajesh482
I've implimented a ATL single thread apartment based project . class ATL_NO_VTABLE CMySrv : public CComObjectRootEx, public CComCoClass, public IMySrv In the method, I'm creating multiple worker...
29 Jun 2020 by Member 14875971
Hello, we are developing software for a 'Smart Device' for WEC2013 using VS2013. Basis is a C++ ATL COM Project (ATL Simple Object with Connection points) using the 'Smart Device' specific SDK, which results in a DLL. That DLL is referend by a...
29 Jun 2020 by Richard MacCutchan
You cannot use a null GUID to refer to a COM interface. Check the actual value that it use to register itself.
20 Dec 2019 by SuperMiQi
Hello Everyone, I have to improve an old c++ atl drawing control which has some public properties. During his configuration on a winform c#, I made changes via the devstudio properties toolbox. Once I ran the c# application, I discovered the modified properties like his title,... were not the...
20 Dec 2019 by KarstenK
These abstract classes are used as parent class for your implementation. So create a child class. You shouldnt rely on the work of these base implementations because of security reason. Read the documentaion is boring, but it helps.
28 Jun 2019 by Member 14515951
#include using namespace std; class ToyotaModel { public: void name(char z); void codition(char y); void modelno(double x); }; void ToyotaModel::modelno(double x) { cout
28 Jun 2019 by Somesh Dhal
I have the following code -intellisense identifier is undefined// First_ATL.h : Declaration of the CFirst_ATL#pragma once#include "resource.h" // main symbols#include "ATLProject1_i.h"#if defined(_WIN32_WCE) && !defined(_CE_DCOM) &&...
16 Apr 2019 by sumangvs
We have a MMC Snap In Code built on VS 2005. The snap in has few property pages derived from CSnapInPropertyPageImpl Here is the code snippet for the class definition class TTreeConfigPage02 : public CSnapInPropertyPageImpl Here is the code snippet which works fine...
16 Apr 2019 by Shao Voon Wong
Did you register the COM server/dll with regsvr32 command on Windows Server 2016?
18 Nov 2018 by Prajyoth
Hello, I have created a COM DLL using the ATL project (Composite object) which basically has one tree control (which is a part of VS toolbox) within a dialog. After registering it, I'm trying to insert it in a dialog based MFC/ATL application by using the standard approach of using "Insert...
9 Oct 2018 by P.Gnanaraj
We have ATL COM activex DLL . It exposes properties and events . We have interop DLL created on this ActiveX DLL . We are able to access the properties and events of ActiveX control in C# .NET Winform application . In a MFC dialog based application, when we add the ActiveX control we are able...
11 Jun 2018 by Michael Haephrati
When I use ATLENSURE_SUCCEEDED is used with in a code, the compiled binary (.exe) won't run on Windows Server 2012. That makes it harder to test on leased virtual desktop machines, as all virtual desktops are in fact machines with Windows Server 2012 and not any Windows Desktop OS. What could...
14 Jan 2018 by Michael Haephrati
I am looking for a way to convert a textual date and time into a CTime. Textual date and time could be: Quote: "27 December 1999" "8:30:00" "20:30:00" "January 25, 1996 8:30:00" "8:30:00 Jan. 25, 1996" "1/25/1996 8:30:00" What I have tried: I wrote the following function, however...
14 Jan 2018 by KarstenK
The call of ParseDateTime should work for valid date string. A reason for problems could be that your locale settings on your computer arent fitting to that date format. Check that - maybe fix it with additional parameter to ParseDateTime. Or is it another problem from the input parameter or...
22 Aug 2017 by navneet@ISM
I am working on a large piece of c++ code related to COM and ActiveX controls. In this I have one project compiling into .DLL file, and another project compiling to an .OCX file. Now, when I look into all registered Automation objects on my machine, it shows that .DLL file registered as .OCX 32...
22 Aug 2017 by KarstenK
The registration is done by some reg-files which the IDL-compiler is creating. So must look into your project and modify them. By the way: an ocx file is a dll. Change the GUID in the idl-file at all occurances!!!
13 Jul 2017 by Midi_Mick
Using ATL and STL to create collections of COM objects without circular references
12 Mar 2017 by Gregory Morse
Deserialization and serialization classes for JSON objects in native C++ with COM and ATL
3 Dec 2016 by Member 10477163
I used the MSDN ActiveX Template Library (ATL) Tutorial to build the "Polygon" ActiveX Control. I followed the instructions on the MSDN Tutorial, and everything went well until I added the "PolyCtl" control to the project. After adding the PolyCtl control, it generated PolyCtl.cpp and PolyCtl.h...
3 Dec 2016 by Arthur V. Ratz
You would better to use the previous version of Visual Studio such VSS6.0, in which there's no IntelliSense, since the ATL is old for Visual Studio 2015 intended for C#.NET programming.
11 Nov 2016 by Subrat 4708266
I am using Access 2007. I am Getting exception "Unspecified Error" during execution._ConnectionPtr m_pcon;try { _bstr_t conStr = _T("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=\"d:\\bank.mdb\""); hr = m_pcon->Open(conStr, L"",L"",adConnectUnspecified);} catch(_com_error& ce)...
11 Nov 2016 by Jochen Arndt
There is a semicolon missing at the end of your connect string.Try this (using a wide string here to avoid conversions because the BSTR type uses wide strings internally):_bstr_t conStr = L"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=d:\\bank.mdb;";
12 Aug 2016 by format_hugui
hello everybody,I have a problem。IE plug-in, go to read the mouse device Need to close the IE protected mode。After loading plug-ins, IE to adjust the mouse interface.When protected mode to open the access to this interface, you will always fail.If close the protected mode, to be...
12 Aug 2016 by AnvilRanger
Are these computers on a network that you or your company controls? One of the only ways to do this would be using Group Policies from you DC. You can talk to your network administrator about this.If the computer you want to disable protected mode on is a remote computer not part of your...
11 Jun 2016 by harishkharvi
i want to know how to concatenate two string (Eg: str1 & str2)
21 Mar 2016 by farhad Najib
Floppy = CreateFile("\\\\.\\A:", GENERIC_READ | GENERIC_WRITE,FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL, NULL );if( hFloppy != INVALID_HANDLE_VALUE ){ bRes = DeviceIoControl( hFloppy, FSCTL_LOCK_VOLUME, NULL, 0, NULL, 0, &dummy, NULL ); if(...
21 Mar 2016 by ameyakoshti
Hello I am doing computer engineering and i needed some guidanceregarding my project.1st of all i want to know whether it is possible to disable usb portsand CD rom "POWER" through VC++.If yes then could you please guide me on it?Thanks
10 Feb 2016 by Aescleal
Your exported function doesn't look like a COM object to me. I'm not a great expert on C# but if all you've got is a C function can't you just call it directly after importing it:class urgle{ [DllImport("test.dll")] public static extern UINT Find();};is the sort of thing you need.
10 Feb 2016 by JEEPRFAM
trying to call Find() from a test dll im messing with and I keep getting the error"Specified cast is not valid."here's a little snippet of what im working with.....test.dllfoo.h__declspec(dllexport) UINT Find();foo.cppUINT Find(){ return 1;}C# test.exe using interface...
16 Dec 2015 by Member 12192742
LRESULT CUIWindowPage::OnMouseWheel(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled){ ??}
29 Nov 2015 by Member 11589333
Adding a item to desktop right-click menu using shell extension, it does not work. A registry entry was created successfully at HKEY_CLASSES_ROOT\Directory\Background\shellex\ContextMenuHandlers.When right-click desktop, everything on desktop disappear in seconds. Is there something special...
19 Nov 2015 by Member 12154882
Hi I am trying to add an event in my existing ATL project , when i try to Add connection point. It Gives me an error"Error in OnFinish. Failed to return new Code Element. Possibly syntax error. New Element "".Can anybody help me?I tried This after deleting .ncb and .clw file. As this...
16 Sep 2015 by Member 3282487
1. frmChild.TopLevel = False2. frmChild.Dock=DockStyle.Fill2. panel.controls.add(frmChild)
12 Aug 2015 by Philippe Mori
If you code in C/C++ without using any wrapper stuff, then both out and retval would have the same effect. If you generate wrappers or use other langages, then one argument would become the return vale of the function.HRESULT Test([out, retval] int *rv) { ... } would becomeint Test() {...
11 Aug 2015 by chandanadhikari
hi,check out these links :stackoverflow questions[^]MSDN links::link 1[^]link 2[^]hope this helps !!
11 Aug 2015 by Somesh Dhal
I think retval is used to return a value to the user & in is for input. But i cant differentiate between out & retval. I have gone through several articles but not able to understand it. can anyone explain it for me?
11 Aug 2015 by Member 11899075
One possibility...VB (script) might be complaining about the type LONG* for an out/retvalYou don't show your idl, so I can't see how the method is declaredBut it might be worth using a variant for the result, e.g.[out, retval] VARIANT* retval
10 Aug 2015 by Somesh Dhal
I have a c++ COM dll which i am trying to access through the vbscript. The Object is created just fine but always shows the error "type mismatch: function name"VB SCRIPT CODE-d dim obj1 set obj1=CreateObject("Begineers.first") Dim lngReturnValue Dim a a=5 Dim b b=7 ...
6 Aug 2015 by Sergey Alexandrovich Kryukov
Please see my comment to the question. Now, proper attribute name is System.Runtime::InteropServices::ClassInterfaceAttribute and it's parameter you tried to use is of the type System.Runtime.InteropServices.ClassInterfaceAttribute.You did not use those full names...
6 Aug 2015 by Somesh Dhal
The c++ code is -// SimpleCom.cpp : Implementation of CSimpleCom/*#include "C:\Users\georget\Documents\Visual Studio 2012\Projects\Pro1\Pro1\stdafx.h"#include "C:\Users\georget\Documents\Visual Studio 2012\Projects\Pro1\Pro1\SimpleCom.h"#include "stdafx.h"*/#include...
21 Jul 2015 by Ram Shelke
HiI am working on outlook addinI am having following calls which calls when New mail comes and if user sents mail. void __stdcall OnNewMail(); void __stdcall OnSend(IDispatch * item, bool...
12 Jul 2015 by Jochen Arndt
Just add a CTimeSpan[^]:CTime AdjustedDateTime = LocalDateTime + CTimeSpan(0, -8, 0, 0);To avoid problems with time zone conversions, all times should be stored as UTC and converted to local time for display.As an alternative you can also use the COleDateTime[^] class.To convert...
12 Jul 2015 by Michael Haephrati
I would like to store in a CTime variable a given date and time adjusted by the timezone. The timezone is a number from -12 to 12.Can someone give me an example of :CTime LocalDateTime = ...int timezone = -8; // exampleCTime AdjustedDateTime = ...Also, how can I store...
3 Jun 2015 by john morrison leon
An alternative approach in which dialogs are entirely specified as C++ code that requires neither IDE support to be written nor IDE generated resources to be executed. Powered by the C++ type system.
24 May 2015 by bhushan0508
I am working on Enterprise MFC application where the resource ID's are out side the Microsofts recommended range. Due to this ...1. So when this application is run in Debug build asserts are shown(bcoz of out of range resource ID) and I am not able to run this application in Debug build. In...
19 Mar 2015 by barneyman
The entry points for Services and Local Servers are slightly different - there is a member bool (m_bService)you can query to determine how you're runningGiven that you can execute the thing as a local Server, your COM glue is all working - there's probably some element that you don't handle...
19 Mar 2015 by KarstenK
The normal use of regsvr32 on the command line (as admin) is:regsvr32 FILENAME (PARAMETERS)The Parameters are optional and get input for the executed file in which the function DllRegisterServer is called. You can set a breakpoint in your binary and debug. Really!!!Some further...
19 Mar 2015 by mallews
Hello, I work for some time with COM and especially with ATL template classes, but I am not an expert so please be patient with me if this is a stupid question.I now want to create a singleton COM Object which is hostet by a windows service. I decide to use a service cause it can run under...
13 Mar 2015 by CarlOlen
I used the Visual C++ > ATL Project wizard to create a COM dll in Visual Studio 2013. I then used the ATL Simple Object Wizard to create an object in that dll with the following names.C++Short name: "PT2_B_db" .h file: "PT2_B_db.h"Class: "CPT2_B_db" .cpp file:...
9 Mar 2015 by sunhui
Integrate .NET Component to your Native MFC Application at runtime
23 Feb 2015 by KarstenK
You are in dll hell. Use the Tool dependency viewer to open your dlls on the target machine and see what is going on. My first tip is, that you have some debug dlls installed. Check for release build settings and use static linking.
23 Feb 2015 by Member 10558751
Dears, I've developed an ATL COM server with Visual Studio 2008, C++. I call it for registering with 'Exefile.exe /RegServer'. It works fine when I execute it on a computer with Visual Studio 2008 installed, but it crashes if no installed. I've verified that the target computer has...
17 Feb 2015 by Vladimir Svyatski
The problem is that your IZInterface is not derived (according to your code) from IBClass, therefore it doesn't have the method Method1. Your code should look something like[ object, uuid(8CA6DBF2-E402-464D-96AE-3D6642D91E14), pointer_default(unique)]interface IBClass :...
17 Feb 2015 by Zon-cpp
Hi,I have a DLL Project with IDL interfaces.I want to have two interfaces in my dll so that one of them can be derived from another.I created two interfaces with ATL Simple Object Wizard. [ object, uuid(7359AF6C-6E90-4372-991F-556602CB3977), dual, nonextensible, ...
3 Jan 2015 by Member 10284444
i want to embed osg in ie,but with window activex controller ,that can't be covered by other div element.i have to make a windowless ATL contrller for osg.Thanks!!!!
14 Dec 2014 by Marius Bancila
Experiences and recommendations from modernizing legacy C++ code using C++11/14
28 Aug 2014 by KarstenK
If you use Nelek receipt you already have found the solution. ElseHere is a nice tutorial right for you: Create ActiveX in .NET Step by Step.This one looks like for newbies: How to develop and deploy ActiveX control in C#
27 Aug 2014 by vininet
How to create ATL ActiveX component like ImageList(C#)?Need to create ActiveX component without displaying the contents.
21 Aug 2014 by Member 11020981
I am declaring a structure in my directshow application :- mfxFrameInfo outFrameInfo;And when I try to build it, I get the following error :"Error 2 error C2065: mfxFrameInfo: undeclared identifier"I am may be failing to set the environment properly. Can anybody help me out...
5 Aug 2014 by Adnan Shaheen
I want to make a context menu item entry on disk management console in mmc.How to do it? Does any one have some sample that'd be great.
23 Jul 2014 by Chad Z. Hower aka Kudzu
What if objects could move from machine to machine? Not just automated downloads, or remotely controlling objects as in remoting, but a system in which the object actually moves about. Mobile software agents do exactly that. In this article I will provide an introduction to this fascinating concept.
2 Jul 2014 by Mohammed El-Afifi
Given an existing win32 application, how to provide COM automation capability to it?
25 Jun 2014 by Darryl Bryk
Code is described for a multi-document interface (MDI) image processing application utilizing the CImage class in C++
12 May 2014 by Nitesh Kejriwal
How to do case sensitive string match in SQL Server
6 May 2014 by KarstenK
An easy way is using URLDownloadToFile.At the first step download an info-file into the Temp and check for the update and proceed if an update is available. Dont ferget to delete the downloaded files after you are done. ;-)
1 May 2014 by Singh, Yashpal
Hi,I am working on an help viewer kinda app that is developed and maintained using ATL/ WTL library. The application uses some help content in form of XHTML pages that is installed separately in the system independent of the help viewer itself. Now we are planning to put the content on some...
14 Apr 2014 by john morrison leon
A smart pointer system for safe application development in C++.
9 Apr 2014 by pooja work
Is there any way that if i m in one COM Control class n m firing event. which i can catch to related clients without using listener.
6 Apr 2014 by pooja work
I am having ATL Project in visual studio 2010I am having ATL Control with all interfaces inside ATL Project.Now i want dat:if i am running more than two atl control's each in individual different applications.From any one application i will click on method.which should give me...
29 Mar 2014 by CHill60
The simple answer is No. But a program can transmit a message to say "my button was clicked" and either send it to a specific process or broadcast it for anything to pick upStarting point here[^]However, if you are having specific problems with the code you posted, then there is a...
28 Mar 2014 by pooja work
Create the ATL COM DLL Start Visual Studio .NET Start a "New Project" Select "Visual C++ Projects" Select "ATL Project" Click "OK" Name the project "ATLDemo" Click "OK" As the default option is "Dynamic-link library (DLL)", Click "Next Select...
11 Feb 2014 by pooja work
I have Created ATL Project in VS2010.I am having my ATL Control.I have added Method given below.Code in IDL File:[id(2)] HRESULT GiveOutput([out] VARIANT* theArray);Code in Header File:STDMETHOD(GiveOutput)(VARIANT* theArray);Code in CPP File:STDMETHODIMP...
11 Feb 2014 by pooja work
I have Created ATL Project in VS2010.I am having my ATL Control.I have added Method given below.Code in IDL File:[id(1)] HRESULT GetInput([in] LONG* lnInput);Code in Header File:STDMETHOD(GetInput)(LONG* lnInput);Code in CPP File:STDMETHODIMP CATLSampleCtrl::GetInput(LONG*...
10 Feb 2014 by qsy101
中文:MyDllTest调用HwaRader.dll,在...
1 Feb 2014 by Ram Shelke
Hi,I have developed outlook plugin for 2007, it is working perfectly if i logged in administrator accountif i login using another limited user account, the plugin failed to load.Please help me if anyone aware on this issue, its very urgent :(Thanks,Ram.
24 Jan 2014 by pooja work
Step:(1) Create ATL Project(2) Right Click on ATL Project, Added COM Control(3) Added Context Menu Manganer Event 1. CMenu 2. SetMenuItemInfo -- Inserted Transperant Png for each Menu ItemProblem:Transperant Png is appearing with black background in XP, it should be...
22 Jan 2014 by imagiro
How to use the shell to unzip a file to a folder location
16 Jan 2014 by Richard MacCutchan
See the remarks section under CDC::Rectangle[^], particularly The interior of the rectangle is filled using the current brush.. So you need to add the text as the very last action.
16 Jan 2014 by Singh, Yashpal
Hi,I design a custom TreeView control that wraps the text string of a tree item when the tree is resized, and to achieve that I draw the tree items in OnPaint() handler, I use CDC::DrawText() to draw the text strings and CDC::FillRect() on the same rectangle to draw a selected tree item. In...
10 Jan 2014 by Nitesh Kejriwal
Solution to a very common problem that we face while working with SQL
9 Jan 2014 by Nitesh Kejriwal
How to count work days between 2 dates in SQL Server
8 Jan 2014 by Mạnh Lê
Hi !I'm using VC6 to design a softwareIn this project, I need to use atlenc.h, atlstr.h, atltime.h but, in ATL3.0 (version for VC6)do not included it. (There header included by ATL 9.0 in VS2008)Are you have any way to using it in my code (VC6.0)Best Regards !
6 Jan 2014 by Mạnh Lê
This way for everyone have same problem.Create a dll file with any function you need (in VS2008) and using this dll in VC6Thank KarstenK !
31 Dec 2013 by Sam Varadarajan
This is a really quick tip on how to reset password for the administrator id “jagadmin” used in EA Server.
24 Dec 2013 by Sergey Alexandrovich Kryukov
The question makes no sense: "this" parameter is the pointer to the instance passed to the method. It cannot be supported or not supported (for instance methods); this is a feature of C++ and other OO languages.The code sample also makes no sense, as "this" depends on the context. This is...
24 Dec 2013 by moon_lu
In the MFC ,Create modeless dialog ,such as CDialog *modelessDialog = new CDialog;modelessDialog->Create(IDC_DIALOG,this)But in the Composite Control,I want to create modelss dialog,Which not support 'this' params,what can i do?
11 Dec 2013 by OriginalGriff
If you got the code from a different site, then surely the best place to get help with it is the site you got it from, not an unrelated site with different people on it?Go back there, look at the main men, and try under "Support".
11 Dec 2013 by @BangIndia
I have refered the following linkhttp://www.integration.co.nz/FAQ-ClientService.htm[^]To indegrage the Dialog box with my service exe. but its throughing error at create option. I am using project as "Use MFC support with shared dll".
5 Dec 2013 by KarstenK
search in the installation directory like C:\Program Files (x86)\Microsoft Visual Studio 9.0\VCfor folders with "templates". There is a hole bunch and work with the approbiate. It isnt too hard to understand: it is working with some text macro processing.Dont put to much effort in it,...
5 Dec 2013 by Nishuluck001
I am currently working on visual studio extensibility..I have build a ATL project using Visual Studio 2008 given template and customize it by adding code and some methods...But now I want to add this project to the "Add Projects" option in visual studio 2008 so that I can use it again and...
1 Dec 2013 by Aydin Homay
HiYou need to socket programming with serial port so please follow of these links and review samples about it just pay attention to for do this purpose you need have familiarity with Telnet, Hyper Terminal and serial socket programming ;-) Simple...