Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Merging code for Win32 Cosole COM App with another MFC App

11 views
Skip to first unread message

near_e...@yahoo.com

unread,
Oct 17, 2009, 3:37:00 PM10/17/09
to
Looking for urgent help from MVPs:

App (1) I have a Win32 Console App that uses COM. (using KB article
276505)
App (2) Then I have a simple MFC AppWizard generated Dialog
application exe.
The Modal dialog has two drop down lists, an OK CANCEL button.

I want to merge the code for both so that I have a final MFC App (no
need for console) that carries the COM features from (1). Simply put
the COM feature of App 1 is going to help me get the contents for the
list box from a XML data file. The COM feature is the XML reader.

CONCEPTUALLY, I am asking how to merge a COM app with MFC app to get a
MFC app. I can take the headers and class implementation and from App
1 and use in App2, but any pitfalls?????

TIA

Scott McPhillips [MVP]

unread,
Oct 17, 2009, 5:08:23 PM10/17/09
to
No big deal, just copy and paste the COM code into the MFC app. I would not
expect any pitfalls. MFC has its own ways of supporting COM but any way
will work in an MFC app.

Anything in particular you are uncertain about?


<near_e...@yahoo.com> wrote in message
news:e1062930-0120-41f8...@o10g2000yqa.googlegroups.com...

--
Scott McPhillips [VC++ MVP]

near_e...@yahoo.com

unread,
Oct 17, 2009, 8:28:31 PM10/17/09
to
(Re KB article
276505)

Do you have any sample that shows the ISAXContentHandler
implementation in a better way than this article? In this
implementation they show how to parse (and print) the XML doc, but I
want an elegant solution that goes to a finer level with some local
helpers to identify value given a tag, <tag>value</tag> ordered pairs
etc, than just using the catchall characters() method. By this I mean
when I parse a huge XML doc I want to print only certain tag values on
the screen, without buffering when the SAX reader calls the handler's
characters() method.

Any help is appreciated.

TIA

near_e...@yahoo.com

unread,
Oct 17, 2009, 10:42:49 PM10/17/09
to
Here is another help I need. For some strange reason this instance of
the CMap gives syntax error. I checked several online examples for
usage and they look the same and I can't figure what the heck is wrong
with this:

// XMLAppDlg.cpp : implementation file
//

#include <afxtempl.h>
#include "stdafx.h"
#include "XMLApp.h"
#include "XMLAppDlg.h"
#include "DlgProxy.h"


#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif


CMap <CString,LPCSTR ,CString, LPCSTR> gMap; //<-------- this line
syntax error


--------------------Configuration: XMLApp - Win32
Debug--------------------
Compiling...
XMLAppDlg.cpp
G:\TESTAPP\XMLApp\XMLAppDlg.cpp(18) : error C2143: syntax error :
missing ';' before '<'
G:\TESTAPP\XMLApp\XMLAppDlg.cpp(18) : error C2501: 'CMap' : missing
storage-class or type specifiers
G:\TESTAPP\XMLApp\XMLAppDlg.cpp(18) : error C2143: syntax error :
missing ';' before '<'
Error executing cl.exe.

XMLApp.exe - 3 error(s), 0 warning(s)


TIA

Igor Tandetnik

unread,
Oct 17, 2009, 11:37:04 PM10/17/09
to
near_e...@yahoo.com wrote:
> #include <afxtempl.h>
> #include "stdafx.h"

Switch these two lines. With precompiled headers on, the compiler ignores everything above #inluce "stdafx.h" line.
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925

0 new messages