comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Can a CALL_EXTERNAL .dll create a window?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Can a CALL_EXTERNAL .dll create a window? [message #36303] Fri, 29 August 2003 08:37 Go to next message
Matt Feinstein is currently offline  Matt Feinstein
Messages: 33
Registered: July 2002
Member
Hi all--

I'm trying to write a CALL_EXTERNAL .dll that does off-screen
hardware-assisted OpenGL rendering. My first try crashes IDL pretty
much immediately, so I'm trying to eliminate possibilites for bugs.
This tends to be difficult, since you can't run a .dll by itself... &
it would be good if I could get some help in focussing my efforts on
likely suspects.

The first suspect I can think of is that I have to create a Win32
window in the .dll. The reason I have to do this is that to get an
off-screen hardware assisted rendering context one -has- to begin with
an on-screen hardware assisted rendering context, which, in turn,
means that you have to create a window. Is there a fatal difficulty in
doing this in an IDL CALL_EXTERNAL .dll? Or, better, is there some
combination of window properties that make it OK?

Any help here would be appreciated.

Matt Feinstein

--
There is no virtue in believing something that can be proved to be true.
Re: Can a CALL_EXTERNAL .dll create a window? [message #36361 is a reply to message #36303] Thu, 04 September 2003 05:27 Go to previous message
Matt Feinstein is currently offline  Matt Feinstein
Messages: 33
Registered: July 2002
Member
On Wed, 3 Sep 2003 12:37:56 -0700, "Rick Towler"
<rtowler@u.washington.edu> wrote:

>
> Hi Matt,
>
> Would you be willing/able to share some example code? I understand if you
> can't, but need to ask. I have wanted to play with this for a while but I
> am having a hard time justifying the investment of time. Anything that
> could help speed the process would be greatly appreciated.
>
> -Rick
>

We've drifted off-topic here-- into the wilds of OpenGL and Win32
programming...

I'll email you code for a Win32 executable that creates an off-screen
hardware-accelerated OpenGL context and then queries it for its
properties. It's not hard to convert this code into a CALL_EXTERNAL
.dll, but note the comments I made in my previous post.

If anyone else wants the code, email me at matt.feinstein@jhuapl.edu


Matt Feinstein

--
There is no virtue in believing something that can be proved to be true.
Re: Can a CALL_EXTERNAL .dll create a window? [message #36363 is a reply to message #36303] Wed, 03 September 2003 12:37 Go to previous message
Rick Towler is currently offline  Rick Towler
Messages: 821
Registered: August 1998
Senior Member
Hi Matt,

Would you be willing/able to share some example code? I understand if you
can't, but need to ask. I have wanted to play with this for a while but I
am having a hard time justifying the investment of time. Anything that
could help speed the process would be greatly appreciated.

-Rick

"Matt Feinstein" wrote in message ...
> On Fri, 29 Aug 2003 11:37:00 -0400, Matt Feinstein > wrote:
>
>> Hi all--
>>
>
> ... was trying to create a Win32 window in a CALL_EXTERNAL .dll, but
> seemed to be getting nowhere...
>
>> Matt Feinstein
>
> Since I asked the question, I guess I should now answer it.
>
> Yes, you can create a Win32 window in a CALL_EXTERNAL .dll, complete
> with a window class and a runty WinProc to handle WM_CREATE and
> WM_DESTROY events that are generated when you create and destroy the
> window. In places in the Win32 hocus-pocus where I needed an instance,
> I used GetModuleHandle(NULL). I'd say, FWIW, that it's a testament to
> IDL's stability that one can get away with this sort of thing...
>
> And, the 'crash' that I was getting initially was due to how I was
> treating the WM_DESTROY event-- I called PostQuitMessage(0)-- which,
> correctly, forced IDL to quit.
>
> D'oh.
>
> And, not only that, but the .dll does the desired hardware-accelerated
> off-screen rendering!
>
> Matt Feinstein
>
> --
> There is no virtue in believing something that can be proved to be true.
Re: Can a CALL_EXTERNAL .dll create a window? [message #36365 is a reply to message #36303] Wed, 03 September 2003 11:02 Go to previous message
Matt Feinstein is currently offline  Matt Feinstein
Messages: 33
Registered: July 2002
Member
On Fri, 29 Aug 2003 11:37:00 -0400, Matt Feinstein <nospam@here.com>
wrote:

> Hi all--
>

... was trying to create a Win32 window in a CALL_EXTERNAL .dll, but
seemed to be getting nowhere...

> Matt Feinstein

Since I asked the question, I guess I should now answer it.

Yes, you can create a Win32 window in a CALL_EXTERNAL .dll, complete
with a window class and a runty WinProc to handle WM_CREATE and
WM_DESTROY events that are generated when you create and destroy the
window. In places in the Win32 hocus-pocus where I needed an instance,
I used GetModuleHandle(NULL). I'd say, FWIW, that it's a testament to
IDL's stability that one can get away with this sort of thing...

And, the 'crash' that I was getting initially was due to how I was
treating the WM_DESTROY event-- I called PostQuitMessage(0)-- which,
correctly, forced IDL to quit.

D'oh.

And, not only that, but the .dll does the desired hardware-accelerated
off-screen rendering!

Matt Feinstein

--
There is no virtue in believing something that can be proved to be true.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Unexpected rebin behavior
Next Topic: matchup of Map_set & contour

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 10:09:30 PDT 2025

Total time taken to generate the page: 1.68085 seconds