comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: Can a CALL_EXTERNAL .dll create a window?
items: Re: Can a CALL_EXTERNAL .dll create a window?

Can a CALL_EXTERNAL .dll create a window?
type: item
description: 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.
creator: Matt Feinstein
date: 2003-08-29T15:37:00-00:00

Re: Can a CALL_EXTERNAL .dll create a window?
type: item
description: 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.
creator: Matt Feinstein
date: 2003-09-03T18:02:20-00:00

Re: Can a CALL_EXTERNAL .dll create a window?
type: item
description: 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.
creator: Rick Towler
date: 2003-09-03T19:37:56-00:00

Re: Can a CALL_EXTERNAL .dll create a window?
type: item
description: 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.
creator: Matt Feinstein
date: 2003-09-04T12:27:29-00:00