atl

ATL: I want to create a coclass that I can use as a parameter for a method in my class. Why can't I get this to work?

Hello Everyone, I've created a COM object using ATL. I want to create a new object that can be returned from a method, and passed in as a parameter. I've created the coclass, but I can't figure out how to add a method that will accept it as a parameter. The error I'm getting is MIDL2025: syntax error: expecting a type specification nea...

What's the difference between calling CComModule.RegisterServer, _AtlComModule.RegisterServer, and LoadTypeLibEx for TypeLib registration?

In my DllRegisterServer method of my COM dll, I previously had code that called LoadTypeLibEx(module, REGKIND_REGISTER, &pTypeLib) to register my COM classes and their corresponding TypeLib's. My COM DLL is a 64-bit. I've noticed that on my 64-bit Vista system, under HKCR:\\TypeLib\{myguid}\1.0\0 I find a win32 subkey with the location t...

WTL/MFC/Native Win32 vs. .NET + Native Compilation

I have been working on an WTL UI app lately and tearing my hair out with how absolutely archaic everything is. I went with ATL because I needed to be able to offer the application to users who don't have or don't want to be bothered with the .NET Framework installation. I wanted to be able to distribute it without anyone having to do any...

Windows 2008 DCOM problem

Hi, I have an DCOM server and when a process calls a method that changes the password of an user the next petition fails. This problem only occurs when the machine is a Windows 2008 working as Domain Controller. Anyone knows how to fix it? Thanks EDIT: There is an audit security error with the code 4625, I have been searching in goog...

Passing the "enter key" event to flash player in an ATL Window?

I have a Flash player (flash9.ocx) embedded in an ATL window and have coded functionality into the swf to respond to the return/enter key being pressed. Works fine from the standalone swf player but as soon as its played from within my embedded player it doesn't execute. It's as if my window is getting in the way somehow? Is there any wa...

How to keep global variable value unchanged in ATL project?

Hello, I need help on global variable usage in an ActiveX(ATL) project. Basically the ActiveX component function is to navigae to a specified URL in composite control(webbrowser embedded). The URL string is initialize in the beginning and saved in a global variable. here is my source code file of ActiveX project. (Do not be concerne...

C# subtring parse using regular expression (ATL >> NET)?

What is the C# & .NET Regex Pattern that I need to use to get "bar" out of this url? http://www.foo.com/bar/123/abc In ATL regular expressions, the pattern would have been http://www\.foo\.com/{[a-z]+}/123/abc ...

COM with ATL Versioning

My Visual Studio 2008 ATL project has a control that defines a version number in several places. The IDL file: uuid(56CD4ADB-B72D-4BF8-B5AC-6CA320EAD27D), version(1.0), helpstring("MyProject 1.0 Type Library") The control's header file: class ATL_NO_VTABLE CMyControl : public CComObjectRootEx<CComSingleThreadModel>, ...

Equivalent of OnFinalMessage for MFC windows?

ATL CWindow class has a useful virtual method OnFinalMessage which is called after the last window message for the window is processed - at this point it is safe to destroy or deleted any objects associated with the window. Is there any equivalent for windows derived from the MFC CWnd class? ...

Where can I get the Active Template Library?

I've never worked with COM before, and I've been tasked with writing an application that uses some third party COM objects. If anyone could point me to some good tutorials on how to use them it would be much appreciated. More immediately, it appears that I don't have the Active Template Library installed. I've searched online but can'...

#include <atlrx.h> error

Hello, I have a Visual Studio project that fails on compile with this error : "cannot open include file 'atlrx.h' : No such file" . I was told that I should download ATL server from Codeplex and install the files. I have downloaded ATL Server, but i don't know how to proceed. thanks for the help. ...

TAB control background in ATL App, XP styles

I have an ATL application with a dialog containing a TAB control. The App uses a common controls manifest. Under XP with visual styles, the tab control background is a different color than the dialog and the controls (mostly checkboxes), so it looks quite ugly. Screenshot How can I fix that? ...

Wrapping a 3rd party DLL

Hi, I have a 3rd party DLL that needs to be loaded dynamically using LoadLibrary() and which uses the __cdecl calling convention. I need to be able to use the dll from VB6 so I've created a wrapper DLL of my own that uses the __stdcall calling convention and exports the functions that are needed. An additional requirement has now arri...

Search Outlook Contact using COM?

I want to add support for searching for local Outlook contacts to my ATL/WTL app. Does anyone know of the Outlook COM interface (Office 2003 or greater) allows you to search for contacts? I already have LDAP lookup support but users want to be able to search their private contacts as well. Any information would be welcome. ...

Break out of ATL class into Win32 functions

Bit of a dumbass question... I think I left my brain in the car... I'm trying to call the Win32 version of SetWindowPos from within an ATL class (I need to specify a different first hWnd, which ATL normally handles), but I can't 'break out' of the ATL class and get the following error: error C2661: 'ATL::CWindow::SetWindowPos' : no ove...

How do I decide whether to use ATL, MFC, Win32 or CLR for a new C++ project?

I'm just starting my first C++ project. I'm using Visual Studio 2008. It's a single-form Windows application that accesses a couple of databases and initiates a WebSphere MQ transaction. I basically understand the differences among ATL, MFC, Win32 (I'm a little hazy on that one actually) and CLR, but I'm at a loss as to how I should choo...

How to convert an ActiveX (webbrower hosted) project into static library project?

I have an ActiveX component which contains a control (webbrowser control embedded in composite control dialog pane) for accessing certain URL. The ActiveX component accessing URL can be used in other MFC or VB projects. The usage is to register the ActiveX component (use regsvr32 cmd) and then insert the control in a dialog window by usi...

Pros and Cons of the available Visual Studio 2008 c++ project platforms?

If choosing between: ATL Windows Forms MFC Win32 Specifically the application will be: for completely in-house use. Most users lack basic windows/pc knowledge. (consider simple UI) used for automated testing which entails:-bringing in lots of data from external equipment (can choose VXI, USB, or Ethernet)-very heavy on graphics - l...

What is required to enable marshaling for a COM interface?

I have a 32-bit ATL COM component without a type library. It has a class factory for one given class that implements several interfaces. When I use it as an in-proc server, everything works fine - the client side invokes CoCreateInstance(), the object is instantiated and QueryInterface() retrieves a pointer to a requested interface. But...

Why would I get a GPF in DLLMain when run as a restricted user?

Why is this code crashing when run as a restricted user, but not when run as an admin of the machine? extern "C" BOOL WINAPI DllMain(HINSTANCE hInstance, DWORD dwReason, LPVOID lpReserved) { hInstance; m_hInstance=hInstance; return _AtlModule.DllMain(dwReason, lpReserved...