comp.lang.ada
 help / color / mirror / Atom feed
* passing an Hwnd from a C lang prog to a MFC dll
@ 1999-12-13  0:00 bill rawlinson
  1999-12-14  0:00 ` David Lowndes
  0 siblings, 1 reply; 5+ messages in thread
From: bill rawlinson @ 1999-12-13  0:00 UTC (permalink / raw)


----------this message is cross posted between the following newsgroups
                    comp.lang.ada, comp.lang.c, comp.lang.c++,
microsoft.public.vc.language
----------thanks :O)


Does anyone here know if the following is possible..

from a C program I want to pass an hwnd for my current window to
a MFC DLL written with VC++ 5.  Within the dll I create a small
status window with the progress meter, a status line, animation..etc..

this is created by creating an instance of the CDialog class.  which
requires
a pointer to a Cwnd.  as my C program, or an Ada program, don't
use classes but do have an Hwnd, which is a member of the CDialog::m_Hwnd

I want to be able to associate the passed Hwnd with a Cwnd so that I can
create the instance of the CDialog.   Cwnd::Attach(new Hwnd) doesn't work..

is there a way?  or am I wasting my time?? Has anyone of you ever attempted
this
before??
thanks

Bill Rawlinson








^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: passing an Hwnd from a C lang prog to a MFC dll
  1999-12-13  0:00 passing an Hwnd from a C lang prog to a MFC dll bill rawlinson
@ 1999-12-14  0:00 ` David Lowndes
  1999-12-14  0:00   ` Mark McIntyre
  1999-12-15  0:00   ` Bill Rawlinson
  0 siblings, 2 replies; 5+ messages in thread
From: David Lowndes @ 1999-12-14  0:00 UTC (permalink / raw)


>I want to be able to associate the passed Hwnd with a Cwnd so that I can
>create the instance of the CDialog.   Cwnd::Attach(new Hwnd) doesn't work..

Bill,

It should work. I've used it like this:

	CWnd Parent;
	Parent.Attach( hwnd );

	CMyDlg dlg( &Parent );

Dave
-- 
My address is altered to discourage junk mail.
Please post responses to the newsgroup thread,
there's no need for follow-up email copies.




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: passing an Hwnd from a C lang prog to a MFC dll
  1999-12-14  0:00 ` David Lowndes
@ 1999-12-14  0:00   ` Mark McIntyre
  1999-12-17  0:00     ` David Botton
  1999-12-15  0:00   ` Bill Rawlinson
  1 sibling, 1 reply; 5+ messages in thread
From: Mark McIntyre @ 1999-12-14  0:00 UTC (permalink / raw)


On Tue, 14 Dec 1999 19:24:22 +0000, David Lowndes <davidl@mvps.org>
wrote:

>>I want to be able to associate the passed Hwnd with a Cwnd so that I can
>>create the instance of the CDialog.   Cwnd::Attach(new Hwnd) doesn't work..
>
>Bill,
>
>It should work. I've used it like this:
>
>	CWnd Parent;
>	Parent.Attach( hwnd );
>
>	CMyDlg dlg( &Parent );
>
>Dave
please take this away from Comp.lang.c as it is not c and has nothing
to do with the ANSI C language.

Mark McIntyre

C- FAQ: http://www.eskimo.com/~scs/C-faq/top.html




^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: passing an Hwnd from a C lang prog to a MFC dll
  1999-12-14  0:00 ` David Lowndes
  1999-12-14  0:00   ` Mark McIntyre
@ 1999-12-15  0:00   ` Bill Rawlinson
  1 sibling, 0 replies; 5+ messages in thread
From: Bill Rawlinson @ 1999-12-15  0:00 UTC (permalink / raw)


David
Hope you don't mind me asking some more about this.. but when you attach the
hwnd don't you get an assertion failure if the hwnd /= NULL?

If not.. then i must be screwing up elsewhere and just think that it is
here.

thanks for your help
Bill

David Lowndes <davidl@mvps.org> wrote in message
news:quvb5ssmdbp14rhucjra7ahht1irg3v9i4@4ax.com...
> >I want to be able to associate the passed Hwnd with a Cwnd so that I can
> >create the instance of the CDialog.   Cwnd::Attach(new Hwnd) doesn't
work..
>
> Bill,
>
> It should work. I've used it like this:
>
> CWnd Parent;
> Parent.Attach( hwnd );
>
> CMyDlg dlg( &Parent );
>
> Dave
> --
> My address is altered to discourage junk mail.
> Please post responses to the newsgroup thread,
> there's no need for follow-up email copies.






^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: passing an Hwnd from a C lang prog to a MFC dll
  1999-12-14  0:00   ` Mark McIntyre
@ 1999-12-17  0:00     ` David Botton
  0 siblings, 0 replies; 5+ messages in thread
From: David Botton @ 1999-12-17  0:00 UTC (permalink / raw)


His question spec. mentioned that he had Ada code that was creating the HWND
and is certainly an appropriate question.

To put my own 2cents in, I have also done:

CWnd Parent;
Parrent.Attach(hwnd);

and used that CWnd in code where the hwnd was created in Ada code and it
should work.

David Botton

Mark McIntyre wrote in message <1NNWOC7RSh2Rk+gwNwkrvDlnSpqy@4ax.com>...
>please take this away from Comp.lang.c as it is not c and has nothing
>to do with the ANSI C language.







^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~1999-12-17  0:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-12-13  0:00 passing an Hwnd from a C lang prog to a MFC dll bill rawlinson
1999-12-14  0:00 ` David Lowndes
1999-12-14  0:00   ` Mark McIntyre
1999-12-17  0:00     ` David Botton
1999-12-15  0:00   ` Bill Rawlinson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox