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

including files in projects-a DLL and Main question

7 views
Skip to first unread message

Andrew Sellon

unread,
Dec 28, 2009, 8:53:44 PM12/28/09
to
hello,
I was curious if anyone has ever done the following and if so, how. I
have a class written in a .cpp and .h file. Currently, this class is a
member of an MFC extension DLL project, so I have the AFX_EXT_CLASS macro
before the name of the class

class AFX_EXT_CLASS foo
{
... blah...
};

now, these two files reside in a common folder for me to use, or so I would
like, in other projects as I see fit. The wrinkle is, I would like to have
the ability to include this class in a project directly (sans DLL business)

as an initial attempt, I did try

#ifdef _NOT_IN_DLL
#undef AFX_EXT_CLASS
#endif

class AFX_EXT_CLASS foo
{
... blah...
};

but that does not work. And yes, I see that by doing that I would screw
that definition up for the remainder of the program and likely hose up any
other DLLs I might be using, or trying to. That said, I was trying to see
if that worked at all. VC08 totally ignored that I JUST undefined
AFX_EXT_CLASS and just went on about its business telling me how stupid I
am.

So.. can this be done? And have I explained what I am trying to do
thoroughly enough?

thanks for your help

Andy

Joseph M. Newcomer

unread,
Dec 29, 2009, 3:35:04 AM12/29/09
to
On Mon, 28 Dec 2009 19:53:44 -0600, "Andrew Sellon" <ase...@cox.net> wrote:

>hello,
> I was curious if anyone has ever done the following and if so, how. I
>have a class written in a .cpp and .h file. Currently, this class is a
>member of an MFC extension DLL project, so I have the AFX_EXT_CLASS macro
>before the name of the class
>
>class AFX_EXT_CLASS foo
>{
>... blah...
>};
>
>now, these two files reside in a common folder for me to use, or so I would
>like, in other projects as I see fit. The wrinkle is, I would like to have
>the ability to include this class in a project directly (sans DLL business)
>
>as an initial attempt, I did try
>
>#ifdef _NOT_IN_DLL
> #undef AFX_EXT_CLASS
>#endif

****
This would not make any sense whatsoever. It guarantees that the compilation will fail
because the symbol is not defined.

If you wanted it to go away, you could use

#define AFX_TEXT_CLASS

which would give it an empty body.

If you want to make this local to the header file, you would use

#pragma push_macro("AFX_EXT_CLASS")
#define AFX_EXT_CLASS
...stuff
...end of everything interesting
#pragma pop_macro("AFX_EXT_CLASS")

that will preserve the integrity of the macro elsewhere
joe
****


>
>class AFX_EXT_CLASS foo
>{
>... blah...
>};
>
>but that does not work. And yes, I see that by doing that I would screw
>that definition up for the remainder of the program and likely hose up any
>other DLLs I might be using, or trying to. That said, I was trying to see
>if that worked at all. VC08 totally ignored that I JUST undefined
>AFX_EXT_CLASS and just went on about its business telling me how stupid I
>am.
>
>So.. can this be done? And have I explained what I am trying to do
>thoroughly enough?
>
>thanks for your help
>
>Andy

Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm

sunny

unread,
Dec 29, 2009, 9:48:18 PM12/29/09
to

hi,all

I am using windows xp sp2 which have been installed the latest version of
Microsoft Internet Explorer 8. I create a mfc project which used Microsoft
's WebBrowser control. i need catch the DocumentComplete event. but the
DocumentComplete event does not fire when WebBrowser is not visible. I have
tried to use the solution in article
http://support.microsoft.com/kb/259935/en-us/,but the problem is still
exist. why?,is there any solutions in windows xp sp2.

any suggestions is appreciate.

thanks.

best wishes.

David Ching

unread,
Dec 29, 2009, 9:52:02 PM12/29/09
to
"sunny" <sound_o...@hotmail.com> wrote in message
news:55129AFE-1C45-4666...@microsoft.com...

> hi,all
>
> I am using windows xp sp2 which have been installed the latest version of
> Microsoft Internet Explorer 8. I create a mfc project which used Microsoft
> 's WebBrowser control. i need catch the DocumentComplete event. but the
> DocumentComplete event does not fire when WebBrowser is not visible. I
> have tried to use the solution in article
> http://support.microsoft.com/kb/259935/en-us/,but the problem is still
> exist. why?,is there any solutions in windows xp sp2.
>

Did you make the IE control visible after moving it off the screen? The
Visible property must be set to true.

-- David

sunny

unread,
Dec 30, 2009, 12:26:40 AM12/30/09
to
hi,all

I am using windows xp sp2 which have been installed the latest version of
Microsoft Internet Explorer 8. I create a mfc project which used Microsoft
's WebBrowser control. i need catch the DocumentComplete event. but the
DocumentComplete event does not fire when WebBrowser is not visible. I have
tried to use the solution in article
http://support.microsoft.com/kb/259935/en-us/,but the problem is still
exist. why?,is there any solutions in windows xp sp2.

any suggestions is appreciate.

thanks.

best wishes.

Sheng Jiang [MVP]

unread,
Jan 1, 2010, 1:40:31 PM1/1/10
to
try the microsoft.public.inetsdk.programming.webbrowser_ctl newsgroup.


"sunny" <sound_o...@hotmail.com> wrote in message

news:11D5C414-C159-4DA5...@microsoft.com...

sunny

unread,
Jan 4, 2010, 3:58:32 AM1/4/10
to
thanks for your reply.


"Sheng Jiang [MVP]" <sheng...@hotmail.com.discuss> wrote in message
news:F845DBF2-23F4-4243...@microsoft.com...

0 new messages