CString into a non-MFC app
-
Hi, I'd like to use a XML parsing library (http://www.codeproject.com/soap/markupclass.asp) that uses CString (I guess that's the only MFC thing it uses). I'd like to use it in a pure WinAPI app, is there a way to add CString there:confused:? (which files/libs to link, never worked with MFC really). An alternate solution would be another XML library. Thanks for your answers
-
Hi, I'd like to use a XML parsing library (http://www.codeproject.com/soap/markupclass.asp) that uses CString (I guess that's the only MFC thing it uses). I'd like to use it in a pure WinAPI app, is there a way to add CString there:confused:? (which files/libs to link, never worked with MFC really). An alternate solution would be another XML library. Thanks for your answers
CString w/o MFC? No! I Thought I saw CString equivalent here at CP some where, or you could write your own. INTP
-
CString w/o MFC? No! I Thought I saw CString equivalent here at CP some where, or you could write your own. INTP
Thanks... I found it at http://www.codeproject.com/string/stdstring.asp... seems nice, unfortunately it also uses CArray (I'm currently looking if I might replace it somehow myself). Still if you new a way to add MFCs CArray (and CString eventauly) to a non-mfc project (I guess I'll have to link to the MFC dll anyway... All I need it to do is to be a WinAPI app that makes use of MFC... sounds weird, doesn't it... )
-
Hi, I'd like to use a XML parsing library (http://www.codeproject.com/soap/markupclass.asp) that uses CString (I guess that's the only MFC thing it uses). I'd like to use it in a pure WinAPI app, is there a way to add CString there:confused:? (which files/libs to link, never worked with MFC really). An alternate solution would be another XML library. Thanks for your answers
In VC7.x CString is a shared class that is shared between MFC and ATL. AFAIK all you have to do is
#include <atlstr.h>
and you can use CString in non MFC apps. If you are using VC6 you are SOL.
[
](http://www.canucks.com)"You're obviously a superstar." - Christian Graus about me - 12 Feb '03 "Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04 Within you lies the power for good - Use it!
-
Hi, I'd like to use a XML parsing library (http://www.codeproject.com/soap/markupclass.asp) that uses CString (I guess that's the only MFC thing it uses). I'd like to use it in a pure WinAPI app, is there a way to add CString there:confused:? (which files/libs to link, never worked with MFC really). An alternate solution would be another XML library. Thanks for your answers
You can also use WTL, which has minimal overhead and its
CString
is identical to MFC's --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- If my rhyme was a drug, I'd sell it by the gram. -
You can also use WTL, which has minimal overhead and its
CString
is identical to MFC's --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- If my rhyme was a drug, I'd sell it by the gram. -
Could you also, please please please, tell me if it has this CArray? Before I download and install it... Thanks
You can use the ATL class
CSimpleArray
--Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- Laugh it up, fuzzball. -
You can use the ATL class
CSimpleArray
--Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- Laugh it up, fuzzball.I know I'm being annoying, but does it have the same interface as teh MFC's CArray. Can I use it as a drop-in replacement (after a typedef of course) PS: I'm really sorry to be such a pain, but I really don't do MFC/ATL/WTL stuff at all (yes, I've looked up MSDN... lists less member functions that CArray, but it's only the ATL CSimpleArray - just really not sure about it all) thanks
-
I know I'm being annoying, but does it have the same interface as teh MFC's CArray. Can I use it as a drop-in replacement (after a typedef of course) PS: I'm really sorry to be such a pain, but I really don't do MFC/ATL/WTL stuff at all (yes, I've looked up MSDN... lists less member functions that CArray, but it's only the ATL CSimpleArray - just really not sure about it all) thanks
I haven't looked them both up and compared them, but you can look at
CSimpleArray
in atlbase.h --Mike-- Personal stuff:: Ericahist | Homepage Shareware stuff:: 1ClickPicGrabber | RightClick-Encrypt CP stuff:: CP SearchBar v2.0.2 | C++ Forum FAQ ---- #include "witty-quote.h" -
Hi, I'd like to use a XML parsing library (http://www.codeproject.com/soap/markupclass.asp) that uses CString (I guess that's the only MFC thing it uses). I'd like to use it in a pure WinAPI app, is there a way to add CString there:confused:? (which files/libs to link, never worked with MFC really). An alternate solution would be another XML library. Thanks for your answers
a) VC7 : makes the CStringT template available for both ATL and MFC projects b) WTL (clickety[^]) : provides a 1:1 CString clone for ATL/WTL projects under VC6. The ATL/WTL framework emphasizes "link on demand", so you could basically create a raw Win32 application/library with CString c) On Codeguru you'll find a macro that extracts the CString sources from your MFC library, so oyu can add them to any other project d) there are some CString clones[^]. However, with the availability of WTL, there's rarely a need, unless you need to be portable e) finally, you can "rip out" the WTL CString class. All that CString needs from the framework is the Ressource HINSTANCE for implementing LoadString and similar functions. (IIRC there are some more system-dependent elements, which can be easily replaced)
we are here to help each other get through this thing, whatever it is Vonnegut jr.
sighist || Agile Programming | doxygen -
CString w/o MFC? No! I Thought I saw CString equivalent here at CP some where, or you could write your own. INTP
John R. Shaw wrote: CString w/o MFC? No! IIRC, CString is nowadays (also) under the CPL - MS made it part of the WTL library which they made free software.
-
Hi, I'd like to use a XML parsing library (http://www.codeproject.com/soap/markupclass.asp) that uses CString (I guess that's the only MFC thing it uses). I'd like to use it in a pure WinAPI app, is there a way to add CString there:confused:? (which files/libs to link, never worked with MFC really). An alternate solution would be another XML library. Thanks for your answers
ofcourse it is possible. to the best of my knowledge everything is possible. click the "Project" menu then choose Settings. In the "General" tab you will see that you project isn't currrently using MFC. You can choose to use MFC in a static LIBRARY or in a DLL. I f you choose to have it in a library you'll have to include these files in stdafx.h : #include // MFC core and standard components #include // MFC extensions #include // MFC Automation classes #include // MFC support for Internet Explorer 4 #include #include // MFC support for Windows Common I haven't used MFC in a dll and I don't know if you have to include them there but i know that you won't have to carry all those DLL's if you want to check your app on a computer without VC++ installed gabby