atl

Convert void* representation of a dword to wstring

I am having dumb monday so my apologies for posting such a newbie-like question. I am using CRegKey.QueryValue to return a dword value from the registry. QueryValue writes the value into void* pData and the length into ULONG* pnBytes. Now there is a way of getting it from pData into a wstring probably via stringstream. The closest I ...

ATL::CComModule::RegisterServer

What EXACLTY (what registry keys it writes) does the ATL::CComModule::RegisterServer(TRUE) call do? ...

Crash generated during destruction of hash_map

I am using hash_map in application as typedef hash_map<DWORD,CComPtr<IInterfaceXX>> MapDword2Interface; In main application I am using static instance of this map static MapDword2Interface m_mapDword2Interface; I have got one crash dump from one of the client machines which point to the crash in clearing this map I opened that cra...

Error in ATL Project generated header with importlib

I need to importlib a VB6 dll for consumption by an ATL component. I'm not able to use the MIDL import keyword for various reasons. I'm getting a C2061 error in my project in the generated header file (test_i.h) : syntax error: identifier '_MyDataType'. My idl file is import "oaidl.idl"; import "ocidl.idl"; [ uuid(8BB809C6-B5EC-48B1-9...

Implementing a Windows Explorer extension view interface

I have a Visual Studio 2008 C++ ATL project that is a namespace extension for Windows Explorer. In the tool bar rebar for Windows Explorer in Windows XP, there is an icon labeled "views". In a normal view, it creates a drop-down menu that allows the user to select "Thumbnails", "Tiles", "Icons", "List", or "Details" as the view type. ...

Do without USES_CONVERSION macro...

I have this code that uses the USE_CONVERSION macro in a C++ project... I was wondering if this is written well, (not written by me), and if there's any better ways to do it, without the USES_CONVERSION and W2A macros. STDMETHODIMP CInterpreter::GetStringVar(BSTR bstrNamespace, BSTR bstrVar, BSTR *pbstrValue) { USES_CONVERSION; try { ...

ATL Compile Error when using attribute implements_category

I'm following through a tuturiol to develop a tool for ArcGIS, and everything seems to work fine except that ArcGIS requires the ATL attribute implements_category(__uuidof(CATID_ControlsCommands)) to be specified in order for the control to be accessable from the host software (ArcMap). Unfortunately, this always throws the error (31) : ...

strange double pointer null check

Is this a valid null check on a DOUBLE pointer parameter passed in a function if (!pdblValue) return E_POINTER; ...

checking for failed new

why does this ATL/COM code check for successful alloc? I would have expected a custom allocation to be visible through CoGetALloc or some such api. A standards-conforming C++ runtime should be throwing std::bad_alloc, but then again maybe the allocator has indeed been traded out for a non-throwing impl. DDClientData* pNewData = new DDCl...

Is this a self-assignment bug in ATL::CComVariant?

ATL::CComVariant has a handful of assignment operators. What I see in the implementation is that in assignment operators accepting LPCOLESTR, IUnknown* or IDispatch* the first action is to call Clear(). If the operator in invoked in such a way that a member variable of the same object is passed CComVariant variant; variant = L"string...

E_NOINTERFACE returned

I have a COM Client and a COM Server, the COM Server holds an Interface exposed by the client, now the client is actually just an EXE, how do I make sure that the Interface exposed by the client is visible to the Server? Because when I call CoCreateInstance now on that interface in the server I get a E_NOINTERFACE and I suspect it's bec...

What are these odd files added to my Visual Studio MFC project?

Hi, I have a visual studio solution where one of the projects has somehow acquired several .bin files. They are named bin00001.bin, bin00002.bin, etc... and contains some kind of registry information. The contents of these files are one section repeated a number of times. bin00001.bin: HKCR { NoRemove AppID { '%APPID%'...

How to read a user's input from the console into a Unicode string?

A C++ beginner's question. Here is what I have currently: // From tchar.h #define _T(x) __T(x) ... // From tchar.h #define __T(x) L ## x ... // In MySampleCode.h #ifdef _UNICODE #define tcout wcout #else #define tcout cout #endif ... // In MySampleCode.cpp CAtlString strFileName; if (bIsInteractiveMode) { char* ...

How does Visual Studio determine the order to compile IDL files?

I have a COM project that contains a number of IDL files, some of which are imported into other ones. How does Visual Studio decide which ones to compile (using MIDL) first? I want to control the order. I have a master IDL file which contains my library declaration with several imports, and I get a build error if it is not the first one...

How to get the Last Active Date of a Process?

Hi all, I have an assignment were in I have to print the last active date of the process using a COM In Proc Server in C++. I tried doing that with getProcessTimes() function, but that gives me an access violation error. First of all, I want to know if there is anyother command that gives the last active date of the process.. Second wh...

Visual Studio's default MIDL Output properties wrong for Midl File?

Are Visual Studio 2008's default MIDL Output properties wrong when I add a new Midl file to my project? I have a basic ATL project, suppose it's named SomeProject. By default Visual studio creates a file called SomeProject.idl. Then I add a new Midl file named SomeMidl.idl (via Add Item and selecting Midl file). When I open the Propert...

Managing definitions in a COM type library with a lot of IDL interfaces

I'm creating a COM type library with over one hundred interfaces. Defining all of the interfaces and coclasses in a single library is unreasonable... the IDL file becomes thousands of lines long! So I'm trying the idea of putting each interface in its own file, and using imports to satisfy its dependencies. What strategies can I use to ...

is it possible to build ATL project in VS express 2010

Hi i know that ATL and MFC are now part of Windows Driver Kit my question is how can i (if it possible .. ) to build project or import ATL project to visual studio express ...

How to get access of <iframe> body using c++/ATL/COM?

Hi All, I have written a browser helper object to get the text between the tags and use it for data mining purpose. I tried using it on igoogle (basically to test its capability on gadgets) and it failed in some of the cases where an <iframe> is present with some external source. I can get the <div> and its child <iframe> but fail to ...

Importing interfaces in IDL from an external type library

I have two type libraries with COM interfaces that I wrote using ATL and Microsoft's IDL. I would like an interface in one library to inherit from an interface in the other. Essentially, I would like to do the same thing that Steven described at How do I create interface methods using .tlb types in VS C++?. The only person who answered ...