Mixing ATL/MFC in VS2005

Does anyone know of some sample code created using VS2005
that implements an out-of-proc COM server mixing MFC and ATL.
I tried creating one from scratch but the wizard no longer allows
MFC support in an ATL .EXE.


dam4330 (47)
6/11/2007 9:38:45 PM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 36

On Mon, 11 Jun 2007 16:38:45 -0500, "Drew" <dam@dam.dam> wrote:

>Does anyone know of some sample code created using VS2005
>that implements an out-of-proc COM server mixing MFC and ATL.
>I tried creating one from scratch but the wizard no longer allows
>MFC support in an ATL .EXE.

Here's a freeware program of mine which implements EXE com server
using MFC and ATL: http://www.naughter.com/redrat.html. It basically
implements a server which provides a high level COM wrapping for a
serial port device which because it is implemented as a EXE can be
shared by multiple clients. It also implemented multi thread safe
Connection points if you are interested. Also my blog entry about this
may be of interest:

PJ Naughter [Windows - SDK MVP]

Naughter Software
Mail: pjna at naughter.com
Web: www.naughter.com
Hotmail/MSN Messenger: pjnaughter at hotmail.com

Interested in extending SQL Server, check out my book on Extended Stored Procedures:
pjna (22)
6/20/2007 11:19:01 PM

Similar Artilces:

Session mix-up issue
We ran into a strange issue 2 days back in our client's production environment. A remote user, logs in and finds out that the data available in the web page are from a different user. The client environement is having ..net 3.5 running on Windows 2003 server connected to an Oracle 10g DB. The web server is on NLB and in a DMZ. The sessions are maintained In proc. We analysed the IIS logs and the network logs for that duration and were not able to conclude if this was a security issue or a genuine application related issue. Request your inputs in solving this issue. Ben...

Timer inside MFC Extension DLL
Hello, I am trying to create a timer inside an MFC extension DLL. For some reason the timer creation is: 1. Crash the application if I use CWnd::SetTimer and 2. Never being called inside the DLL if I use ::SetTimer Any ideas?! Eitan What does crash mean in terms code? Did you debug and see what is the problem? ---------- Ajay Kalra ajaykalra@yahoo.com "Eitan" <Eitan@discussions.microsoft.com> wrote in message news:0FE34876-A770-45F6-9B78-4B049924B6BA@microsoft.com... > Hello, > > I am trying to create a timer inside an MFC extension DLL. For some > r...

More Outlook bugs... Rules are mixing up accounts!
*sigh* WHY do the rules in Outlook 2003 keep changing the accounts they are to apply to. ie. "When message arrives through MYACCOUNT@HERE.COM move it to the MYACCOUNT folder." ....changes to... "When message arrives through ANOTHERACCOUNT@HERE.COM move it to MYACCOUNT folder." - These rules were manually entered by me, not imported from OE6. - This is a fresh installation of Win XP Pro SP1 - Only action in OE6 was to import the old email account settings and contents through the Transfer Settings Wizard. The Outlook 2003 was installed and account info imported. If I fix...

When firing events in ATL and COM it leaks thread handles?
Hi All, I have a problem that I can't seem to resolve. I have an ActiveX control written with ATL. The problem is that when I fire an event from within PThread that I have created everything works fine but it leaks 2 thread handles each time. The thread exits OK though. If fire the event without the PThread then it works fine without the leaky handles. The only problem is that for some reason I cannot call other functions from within the COM from the client code. Any body got any ideas what is leaking and how to get around it? many thanks, The relevant code is: void conn::dostuff(...

problem invoke an MFC callback function from Non MFC app
Hi i am having problem invoking an mfc callback function from a non mfc dll. any samples that I can look at? What is happening is when I call function (not callbacks) in this MFC dll from my non MFC app it works fine. But when i try to invoke the callbacks nothing seems to happen. It doesn't fail/not exception. When i cut and paste the same code into an MFC app (ie; call the mfc dll from and MFC app) the callbacks get invoked without any problem. Now my question is do i need to do something different as i am calling it from a non mfc app?like a message map? if so how do i do that? T...

VS2005... #3
Stupid question maybe - does VS2005 have full mfc capabilities? If I'm comfortable with VC++ 6.0 will there be any changes I have to make in the way I write code (unmanaged that is)? Also, is it possible to use C++ .dll's for web applications? Or anything written in VC++ for that matter? ...

.MIX files
I have several .MIX files (Microsoft Photo Draw) that were sent to me. Are there any other Microsoft programs that can read these files ?? I tried to even insert them into MS Word (XP version) but I have received errors everytime I try. Windows XP will preview in a window but I cannot import them into any application ! ...

Mixed Icons
I created an application with Visual Studio 2005 under Vista and changed the only icon that the wizard created. When the app runs, the correct icon appears in the task bar and also if I click properties. However, the default icons appear on the quick lanch toolbar and in Windows Explorer. I read through about a years worth of messages on icons, but didn't see anything exactly like my problem. Thanks for any help, Curt You will want to make sure that the default icon is the first one in the EXE and that it has both a large and small icon (and 48x48 if you are specifying for XP or Vist...

printing document a mix of text and photos imported from photoshop
Printer prints document where the text is accurate, however most of the phots come out black...anyone know why? Hi j hall (jhall@discussions.microsoft.com), in the newsgroups you posted: || Printer prints document where the text is accurate, however most of || the phots come out black...anyone know why? Microsoft Office Publisher 2003 and older are critical about printer drivers. Usually upgrading (or downgrading in some cases) will fix the problems you are encountering. If you have not already done so, you would want to visit the manufacturers website of your printer to download and inst...

ActiveX in MFC
I'm trying to create an ActiveX control in MFC. I have a library which was provided for the development of an MFC program NOT ActiveX. I made a sample ActiveX and included the library under Project->Settings->Link Tab but after building the ActiveX and viewing the control in Test Container, no methods were exposed?? Am I doing something wrong or will the library NOT work with an ActiveX??? Thanks David David, This is a difficult question to answer. First of all, you should try to build the ActiveX without the static lib, and see if any methods are exposed. If that is the case...

MFC (VS2008SP1) app deploying
Hi I've created app using MFC in VS 2008 SP1, when tested on other machines I've got error(s), all point to missing dll's. Did try to statically link but that provided more errors on compiling my project, so I've decided to build msi setup deployment. My first issue is weather to use merge modules or redistribute re-dist packets (which I would download from MS). Then (if I would go for later solution) I would need to resolved next few steps: - check if target PC already have vs2008 sp1 re-dist files installed - if not, check for platform version 32 or 64 and then - in...

[MFC | XP] OnToolHitTest bug?
Hi all, In my application I have dynamic tooltips in several lists. We display certain items which can have notes or jpeg previews, and if an item has a note or preview we just display an icon. When the user goes over such icon, a tooltip should show the note or the image. What I did to implement this is the following: I set a tooltip control on the whole client area of the list. Then I overloaded the OnToolHitTest function and determine whether the user is over the right column AND if there's a note or preview. If none is found, I return -1 otherwise the control's ID with Get...

How to accomplish mixed page orientation?
How can I have some pages with portrait and some pages with landscape orientation in the same visio file? Thanks, Keith Brickey Keith, In the File > Page Setup dialog, go to the "Page Size" tab and make sure that "Same as printer paper size" is not checked. When printing, you'll need to change the printer orientation to match the page that you want to print. This is only necessary if you're running a version of Visio older than Visio 2003. -- Dawn This posting is provided "AS IS" with no warranties, and confers no rights. "Keith Brickey...

[Outlook] mixed accounts
Dear Sirs, we work in a corporation with an exchange server and outlook client on every workstation. on some workstations we have installed an internet smtp account, so on these machines we have 2 mail accounts: 1 intra/exchange account and 1 internet/smtp account. The main question is: how can the user tell outlook which account should outlook use? Do you mean to send mail? >-----Original Message----- >Dear Sirs, >we work in a corporation with an exchange server and >outlook client on every workstation. on some workstations >we have installed an internet smtp account, so on...

Overloading new and delete operators with MFC
I have overloaded new and delete operators in a library that I use in every program I create. Everything is fine EXCEPT when I use my library in a MFC project. My overload functions are : void *operator new(size_t size) { return my_alloc(size) ; } void operator delete(void *ptr) { if (ptr) my_free(ptr) ; } The functions my_alloc() and my_free() are just calling malloc() and free(), but in debug version they add size counter and special data that are used to verify memory leak and buffer overflow. All this works perfectly well in non-MFC projects, but when I try linking my library i...

.NET and MFC
in deciding what visual language to use in the long run, I wonder if MFC will be phased out or be replaced by C#. Should I stick with MFC, or learn something new? What to learn then? These questions are being asked on almost daily basis. Search google to see various replies. -- Ajay Kalra [MVP - VC++] ajaykalra@yahoo.com "MattC" <anonymous@discussions.microsoft.com> wrote in message news:036301c3d338$a2c71050$a401280a@phx.gbl... | in deciding what visual language to use in the long run, I | wonder if MFC will be phased out or be replaced by C#. | Should I stick with MF...

mixed mode...
I presently have a exchange 5.5 server and a exchange 2003, I'm presently doing a migration. on the serveur 5.5 I have a mailbox called : Publisher. the primary user accound is set to : Domain USER. this mailbox is needed by our publishing software. If I understand well exchange 2003 there's no such a config. any replacement for this function? thank you Hi, Unclear as to what the problem here is? If you are migrating users from 5.5 to 2003 this user should be able to be moved with out a problem in regards to mail. The Domain Users is a global group that every person in AD ne...

Odd COleDropTarget behaviour in MFC MDI application
I have an MFC MDI app. For discussion purposes, we can assume it has a Main Frame, an MDIChild window, and a 'floating' tool window. (The tool window has the following style flags set: DS_SETFONT, DS_SETFOREGROUND, DS_FIXEDSYS, WS_POPUP, WS_CAPTION, WS_SYSMENU, WS_THICKFRAME, WS_EX_TOOLWINDOW.) I derived a drag-handler class from COleDropTarget, one for the Main Frame and one for the tool window. I've overridden the OnDragEnter(), OnDragLeave(), OnDragOver(), and OnDrop() methods. I've declared one of these as a member/field in each of the Main Frame and tool window clas...

Purchasing Mix & Match Tables- what do you think???
Microsoft should add a Mix & Match table for purchasing. It would act the same way it would for the sale of an item only it would help calculate the Purchase Orders. Example: I buy cases of coke. I need 100 cases to reach a qty discount. A purchase order report would calculate the products needed to reach the level. This would be an priority trigger over the ROP. For example if I sold 25 cases of each (coke, diet coke, caf free coke, caf free diet coke) and my reorder point was 30 case sales(for each) a purchase order would not be generated. If the Mix & Match PO could do a: cal...

MFC apps spawned by NT services
Hi, Q164166 states that an assertion may occur in wincore.cpp when a service launches a mfc application. Well, frankly, I can't reproduce this behaviour. Some time ago I made a service which is able to launch any win32 program, mfc apps, too. Is the KB article out-of-date? I think the operative word is "may" as opposed to "will." "Carmen Neumann" <mola@italia.it> wrote in message news:d9rkn7$946$1@online.de... > Hi, > > Q164166 states that an assertion may occur in wincore.cpp when a service > launches a mfc application. ...

Migrating from MFC 7 to 8 (error C2440)
Hello everybody. I'am migrating a project from MFC 7 to 8, and the compiler gives me the error: ....\MyCode.cpp(53) : error C2440: 'static_cast' : cannot convert from 'UINT (__thiscall CMyDerivedCwndClass::* )(CPoint)' to 'LRESULT (__thiscall CWnd::* )(CPoint)' Cast from base to derived requires dynamic_cast or static_cast The error is in the message map: BEGIN_MESSAGE_MAP(CMyDerivedCwndClass, CWnd) //{{AFX_MSG_MAP(CMyDerivedCwndClass) ON_WM_NCHITTEST() //Here is the error!!! //}}AFX_MSG_MAP END_MESSAGE_MAP() I need the MFC 7 version too, so, the c...

expression with mixed types
Hello! if I have this expression long = int * uint * ushort * short; how is the implicit conversion done here for the different types in this expression. //Tony Tony Johansson wrote: > Hello! > > if I have this expression > long = int * uint * ushort * short; That's not legal C# syntax. Are you trying to refer to some arbitrary expression where the operands have the given types? > how is the implicit conversion done here for the different types in this > expression. See section 6.1, "Implicit conversions" in the C# specificati...

A2007 Mix/Max buttons missing
When I try to design a new form in A2007 it is always maximized and the Min/Max buttons do not show despite the appropriate property settings. Furthermore I cannot change the value of the Moveable property, it is locked to No. However forms designed under A2003 and brought forward behave as expected. (The exception is that the Moveable property is set to Yes for Modal, Pop-up forms but the Min/Max buttons still do not show.) Another symptom is the the Windows category does not show on the Ribbon. I've searched the KB to no avail. Any thoughts? I run A2007 SP1 under Windows Vist...

Handling HTML events using MFC/C++ #2
Hello guys! I have following situation: I created application and embedded Microsoft Web Browser ActiveX, so I can modify HTML content, iterate through element collections (suppose I have button with id="myButton" - I already can change its caption, change elements, pictures, etc.). The problem is that I can not capture events from within the ActiveX control (here: Web Browser). There is a HTMLElementEvent2 interface, but I don't know how to create my own implementation of Event Sink. Please look at code below and help me with this, or point to proper paper or sample code. Help...

Mix Characters
Hello and Merry Christmas, I have the following problem: I had created my websites with Pub2003 on my PC, before few months i copy all my websites (pub files) in my laptop that i also have Pub2003, the problem is that when i try to change language ( i work with greek and english languages) i always get this message: "If you remap your keybord to another character set, you may mix characters in your publication. This mix of characters may not show correctly in a browser. If you want to map your keybord to different character set, press OK to continue. To cancel remapping ...