I have a console application that uses CString. Unfortunately, as soon
as one uses CString the linker drags in all the windowing stuff that I
don't need at all. I have linked statically to avoid DLL version
problems. For example the following app is 101K. That's big in my
opinion.
#include <afx.h>
void main (void)
{
CString x ("hello");
}
If I comment out that one line with CString in it it reduces to 21K
which is still big for an app that does nothing but I can live with that
;-). Any ideas why the windowing code gets linked? A solution would be
even better. I'm sure that it is possible. It's just that I ain't clever
enough....yet.
Thanks in advance.
Raju
All the best,
Andy.
Raju Varghese wrote:
>
> Hi,
>
> I have a console application that uses CString. Unfortunately, as soon
> as one uses CString the linker drags in all the windowing stuff that I
> don't need at all. I have linked statically to avoid DLL version
[ deleted ]
Hey please make your signature bigger!
--
Andy Duplain <an...@syntegra.bt.co.uk>
Syntegra, Brighton, UK.
CString is MFC, why not try the string facilities suppplied as part of the
standard library.
dave
Raju Varghese wrote in message <352B5FCF...@ubs.com>...
>Hi,
>
>I have a console application that uses CString. Unfortunately, as soon
>as one uses CString the linker drags in all the windowing stuff that I
>don't need at all. I have linked statically to avoid DLL version
> Implement your own String class; it's text-book and good for the soul
> 8-) Seriously though, I wouldn't recommend using any MFC unless
> AppWizard has generated it... you're in for a whole mess of problems.
> Just you wait and see.
What happened to that holy grail of programming i.e. reuse. I was trying to
be a Good Programmer and "do the right thing" by reusing Microsoft's tried
and tested code. I used to reinvent the wheel; on occasion several times a
day even ;-) I see your point. I was hoping that there would be a simple way
to extricate CString from the rest of MFC. I remember seeing a KB article
several years back to this effect; I have not been able to locate it
recently.
> > I have a console application that uses CString. Unfortunately, as soon
> > as one uses CString the linker drags in all the windowing stuff that I
> > don't need at all. I have linked statically to avoid DLL version
> [ deleted ]
>
> Hey please make your signature bigger!
My message had two signatures: my first name on a line by itself and the one
put in by Netscape in vCard format. The latter might have got filtered out
by an NNTP server. I admit that the former was a bit short. Both together
would have been just right.