atl

Handle HTMLElementEvents2 when DWebBrowserEvents2 has been handled using ATL's macros

I'm creating a Browser Helper Object using VS2008, C++. My class has been derived from IDispEventImpl among many others class ATL_NO_VTABLE CHelloWorldBHO : public CComObjectRootEx<CComSingleThreadModel>, public CComCoClass<CHelloWorldBHO, &CLSID_HelloWorldBHO>, public IObjectWithSiteImpl<CHelloWorldBHO>, public IDispatc...

Never ending WM_PAINT loop with ATL CWindowImpl

I have a very simple Win32 application that uses CAtlExeModuleT. The module simply creates a class CTestWindow derived from CWindowImpl. It just has a single message handler for WM_PAINT. After I create the window and display it, the OnPaint method (WM_PAINT message) is called infinitely and there by consumes 100% CPU. The code that cre...

Strange ATL WebBrowser problem

I'm having a strange problem with WebBrowser control in a simple ATL application. I'm using the CAxWindow to create the web control. Everything works fine except that the browser always shows up as a POPUP window at the top left corner of the screen instead of within my main window as a child. My main window is created with these styles...

Error 997 (ERROR_IO_PENDING) from CSMTPConnection::SendSimple ("Overlapped I/O operation in progress"

CSMTPConnection is an ATL (VC++) class in atlsmtpconnection.h. Code: static _TCHAR mailserver[ 256 ]; static _TCHAR mailsender[ 256 ]; static _TCHAR mailrecips[ 256 ]; static _TCHAR subject[ 256 ]; static _TCHAR msg[ 256 ]; static DWORD mailtimeout=10000; static CSMTPConnection con; ... if (con.Connect( mailserver, mailtimeout )){ if ...

Create a new connection point in VC++ 6?

I have an ATL/COM project, in VC++ 6. I want an existing class, that has never before been defined to raise events, to raise events. To do this, the class will have to implement a "connection point". These events are of a type that no class has ever raised before, so I will have to create a new connection point, rather than reuse an...

Using MFC in Windows service?

I'm starting to develop a Windows service. I want to use some classes from my own, that has little dependencies to some MFC classes like CString, CSocket, CArchive, CMemFile and CObject. MSDN says you need to be very careful about which pieces of MFC you use in the Windows service, but don't specifies it and don't describes the problems ...

Handling windowStateChanged - Tab change in IE extension

I have the following in my IE extension to handle when a tab is switched in IE, etc. [ATL project, VS2008, C++ using IDispEventImpl] SINK_ENTRY_EX(1, DIID_DWebBrowserEvents2, DISPID_WINDOWSTATECHANGED,WindowStateChanged) . . . void WindowStateChanged (DWORD dwFlags, DWORD dwValidFlagsMask); . . . . void CHelloWorld::WindowStateChang...

Problem in hosting ActiveX on Vista (in a Visual Studio 6 C++ application)

Hello everyone, I just installed Visual Studio 6 (SP5) on a Vista Enterprise machine. Had some problems but I think it’s set up alright. The problem is my VC++ 6 application fails when trying to host an ActiveX. I was able to compile it ok, though got a warning message from Vista about the rc.exe (“This program has known compatibility ...

How to prevent coclass implementations from being exposed in an ATL type library

I am building an ATL type library with a type of class factory. Something sorta like this: [ object, uuid(...), ... ] interface INumber : IDispatch { [propget, id(0)] HRESULT Value([out, retval] LONG* pVal); } [ object, uuid(...), ... ] interface INumberFactory : IDispatch { [id(1)] HRESULT GetNumber([in] BSTR numberName, [out,...

Problem in hosting ActiveX on Vista (in a Visual Studio 6 C++ application) II

Hi, (I'm re-posting this message since I signed up as a user now) I just installed Visual Studio 6 (SP5) on a Vista Enterprise machine. Had some problems but I think it’s set up alright. The problem is my VC++ 6 application fails when trying to host an ActiveX. I was able to compile it ok, though got a warning message from Vista about ...

Problem using a COM interface as parameter

I have the following problem: I have to projects Project1 and Project2. In Project1 I have an interface IMyInterface. In Project2 I have an interface IMyInterface2 with a method that receives a pointer to IMyInterface1. When I use import "Project1.idl"; in my Project2.idl, a #include "Project1.h" appears in Project2___i.h. But this fi...

MS09-035 Vulnerability & Impact On Application Development

Hi all, Does anyone know if these patches http://www.microsoft.com/technet/security/bulletin/ms09-035.mspx and http://www.microsoft.com/technet/security/bulletin/ms09-034.mspx will apply to software built using one of the 'pure' (ie. not managed C++) .NET languages? I believe the answer is that they are unaffected as this seems to be a...

ATL Security update broke compatibility for DLLs depending on the older version

The recent ATL security update updated the C++ runtimes to version 8.0.50727.4053. Unfortunately, this update broke one of our DLLs that dynamically links to the runtime, as we only have 8.0.50727.762 available to us on the target machine (we don't even use ATL). Is there a way we can get Visual Studio to dynamically link to the older ...

Delphi and Microsoft ATL security issue

My impression is that standard Delphi uses the Win32 API. Recently Microsoft has been communicating a problem regarding ATL that requires application developers to rebuild ATL-using applications after installing an update on their machines. Will this practice be the general case also for Delphi developers, or are they in the clear wit...

Where do I put ATL dlls so they will work

A colleague developed a IE Plugin which I require to run for a piece of work using ATL. I have all of the source code and the compiled dll as well as a regedit. I have run the reg edit and moved the dll to the C:\Windows\System32 directory where I thought it was supposed to reside but that doesn't appear to have worked. Where should I ...

Atl71.dll denpendency still exists even Static link to ATL is selected

I already spent whole day to trouble shoot this problem, but no luck yet. In my project, I set the Use of ATL property to Static Link to ATL on the General property page and set the Runtime Library property to Multi-threaded (/MT) on the Code Generation property page (C/C++ folder). However DependencyWalker still shows Atl71.dll dependen...

CAtlRegExp for a regular expression that matches 4 characters max

Short version: How can I get a regex that matches [email protected] but not [email protected] using CAtlRegExp ? Long version: I'm using CAtlRegExp http://msdn.microsoft.com/en-us/library/k3zs4axe(VS.80).aspx to try to match email addresses. I want to use the regex ^[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}$ extracted from here. But the syntax t...

Marshalling BSTRs from C++ to C# with COM interop

I have an out-of-process COM server written in C++, which is called by some C# client code. A method on one of the server's interfaces returns a large BSTR to the client, and I suspect that this is causing a memory leak. The code works, but I am looking for help with marshalling-out BSTRs. Simplifying a bit, the IDL for the server metho...

What is Microsoft using as the data type for Unicode Strings?

I am in the process of learning C++ and came across an article on the MSDN here: http://msdn.microsoft.com/en-us/magazine/dd861344.aspx In the first code example the one line of code which my question relates to is the following: VERIFY(SetWindowText(L"Direct2D Sample")); More specifically that L prefix. I had a little read up, and...

How to get print preview of webpage in smartphone application.

Hi, how to get an print preview content of an webpage using HTML control or web-browser control in windows mobile smart phone application using c#, c++ or ATL control. please guide us with any technical detail or any sample application associated with it. -Thanks in advance. GrabIt ...