BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

OpenGL in a CGI webserver application

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics
View previous topic :: View next topic  
Author Message
Andi
Guest





PostPosted: Mon Apr 26, 2004 11:47 am    Post subject: OpenGL in a CGI webserver application Reply with quote



Hi,
I am trying to write a webserver CGI app which, as response to a
TWebRequest, produces an OpenGL-based image. When doing so I always get an
error on the webserver (with no error message, just beeping and no image
shown), and the app hangs.

While there is no window I use GetDC(0) to get a device context handle.

Btw: I am quite familiar with HTTP, mime types, TWebRequest and OpenGL. I
succeeded in writing a console app producing a bmp or jpg and saving it to
disc; this app runs on the webserver without any problems, using GetDC(0)
too. I also succeeded in painting to a bmp's canvas (without using OpenGL)
and passing it back to the client as a jpg image.

Maybe its a problem with the anonymous internet user (triggering the app via
his web browser/HTTP request)? I am running W2K, IIS5 and D7E.

Any ideas or experiences? Thx
Andi




Back to top
Dominique Louis
Guest





PostPosted: Mon Apr 26, 2004 1:53 pm    Post subject: Re: OpenGL in a CGI webserver application Reply with quote



sounds to me like some sort of opengl initialisation code is not being
called.

What happens if you just use the working opengl console app as a CGI exe
just for testing purposes? Does that still create the image?


Dominique.

Andi wrote:
Quote:
I am trying to write a webserver CGI app which, as response to a
TWebRequest, produces an OpenGL-based image. When doing so I always get an
error on the webserver (with no error message, just beeping and no image
shown), and the app hangs.

While there is no window I use GetDC(0) to get a device context handle.

Btw: I am quite familiar with HTTP, mime types, TWebRequest and OpenGL. I
succeeded in writing a console app producing a bmp or jpg and saving it to
disc; this app runs on the webserver without any problems, using GetDC(0)
too. I also succeeded in painting to a bmp's canvas (without using OpenGL)
and passing it back to the client as a jpg image.

Maybe its a problem with the anonymous internet user (triggering the app via
his web browser/HTTP request)? I am running W2K, IIS5 and D7E.

Any ideas or experiences? Thx
Andi





Back to top
Andi
Guest





PostPosted: Mon Apr 26, 2004 2:19 pm    Post subject: Re: OpenGL in a CGI webserver application Reply with quote



I tried but it doesn't work either. Seems to depend on who is calling the
app: the normal interactive user or the Web user.


"Dominique Louis" <savage (AT) delphigamer (DOT) com> schrieb im Newsbeitrag
news:408d138b (AT) newsgroups (DOT) borland.com...
Quote:
sounds to me like some sort of opengl initialisation code is not being
called.

What happens if you just use the working opengl console app as a CGI exe
just for testing purposes? Does that still create the image?


Dominique.

Andi wrote:
I am trying to write a webserver CGI app which, as response to a
TWebRequest, produces an OpenGL-based image. When doing so I always get
an
error on the webserver (with no error message, just beeping and no image
shown), and the app hangs.

While there is no window I use GetDC(0) to get a device context handle.

Btw: I am quite familiar with HTTP, mime types, TWebRequest and OpenGL.
I
succeeded in writing a console app producing a bmp or jpg and saving it
to
disc; this app runs on the webserver without any problems, using
GetDC(0)
too. I also succeeded in painting to a bmp's canvas (without using
OpenGL)
and passing it back to the client as a jpg image.

Maybe its a problem with the anonymous internet user (triggering the app
via
his web browser/HTTP request)? I am running W2K, IIS5 and D7E.

Any ideas or experiences? Thx
Andi







Back to top
Yahia El-Qasem
Guest





PostPosted: Mon Apr 26, 2004 5:05 pm    Post subject: Re: OpenGL in a CGI webserver application Reply with quote

I would imagine that OpenGL needs a "desktop" ( see CreateWindowStation /
CreateDesktop in the Win32 online help )...

Yahia


Back to top
Andre Becker
Guest





PostPosted: Mon Apr 26, 2004 9:51 pm    Post subject: Re: OpenGL in a CGI webserver application Reply with quote

Sounds interesting, but I never heard of these functions. Now I found them
in Win32 help, but I still have no idea how to use them.
My (well working) console app doesn't need them.

Have you any hint for me how I can bring my web app to work? Thx

"Yahia El-Qasem" <Yahia.El-Qasem (AT) mgh (DOT) metro-ag.de> schrieb im Newsbeitrag
news:408d4194 (AT) newsgroups (DOT) borland.com...
Quote:
I would imagine that OpenGL needs a "desktop" ( see CreateWindowStation /
CreateDesktop in the Win32 online help )...

Yahia





Back to top
Yahia El-Qasem
Guest





PostPosted: Mon Apr 26, 2004 10:11 pm    Post subject: Re: OpenGL in a CGI webserver application Reply with quote

never did anything with OpenGL...

In an IIS / ISAPI app there is no desktop available by default. if you have
any graphics intensive APIs sometimes they need for proper initialization a
desktop... one way is to run them as standard application where windows
already has a default "desktop" up and running... with the functions I
mentioned you can create your own desktop from within your web app... which
hopefully enables OpenGL to work properly...

my experience with these functions is photoshop / IIS / ISAPI app related...
you can't get Photoshop ActiveX up and running from within an ISAPI without
a desktop... these functions make it happen in the phohoshop case :-)

sorry...I don't have that code at hands at the moment...

Yahia

"Andre Becker" <andi (AT) hunter (DOT) numerikon.de> schrieb im Newsbeitrag
news:408d845b$1 (AT) newsgroups (DOT) borland.com...
Quote:
Sounds interesting, but I never heard of these functions. Now I found them
in Win32 help, but I still have no idea how to use them.
My (well working) console app doesn't need them.

Have you any hint for me how I can bring my web app to work? Thx

"Yahia El-Qasem" <Yahia.El-Qasem (AT) mgh (DOT) metro-ag.de> schrieb im Newsbeitrag
news:408d4194 (AT) newsgroups (DOT) borland.com...
I would imagine that OpenGL needs a "desktop" ( see CreateWindowStation
/
CreateDesktop in the Win32 online help )...

Yahia







Back to top
Rene Tschaggelar
Guest





PostPosted: Tue Apr 27, 2004 8:17 am    Post subject: Re: OpenGL in a CGI webserver application Reply with quote

Andi wrote:

Quote:
Hi,
I am trying to write a webserver CGI app which, as response to a
TWebRequest, produces an OpenGL-based image. When doing so I always
get an error on the webserver (with no error message, just beeping
and no image shown), and the app hangs.

While there is no window I use GetDC(0) to get a device context
handle.

Btw: I am quite familiar with HTTP, mime types, TWebRequest and
OpenGL. I succeeded in writing a console app producing a bmp or jpg
and saving it to disc; this app runs on the webserver without any
problems, using GetDC(0) too. I also succeeded in painting to a bmp's
canvas (without using OpenGL) and passing it back to the client as a
jpg image.

Maybe its a problem with the anonymous internet user (triggering the
app via his web browser/HTTP request)? I am running W2K, IIS5 and D7E.

Any ideas or experiences?

Unfortunately no experience.
Apparently you next step is to produce a JPG from the OpenGL.
Or perhaps rather a moviestream.

Rene

Back to top
Eric Grange
Guest





PostPosted: Tue Apr 27, 2004 8:55 am    Post subject: Re: OpenGL in a CGI webserver application Reply with quote

Quote:
Any ideas or experiences? Thx

You could try using the MESA DLLs (software OpenGL) instead
of the default windows one, I've had some issues server-side
with MS OpenGL that were solved by using MESA (just drop the
DLLs in your exe's directory). You can find binaries here:

http://sourceforge.net/project/showfiles.php?group_id=29749

However, my server-side use is in a full-blown Delphi HTTP
service application, not something invoked by IIS.

Eric

Back to top
DaveH
Guest





PostPosted: Tue Apr 27, 2004 6:40 pm    Post subject: Re: OpenGL in a CGI webserver application Reply with quote

You need to edit your Web Services setting.

Go into "Services" under an Administrator account. Scroll to the bottom and
look at the propeties for Web Services. Check off the "Interact with the
desktop" option. Now your web app can get valid DC's.

DaveH


"Andi" <andi (AT) hunter (DOT) numerikon.de> wrote

Quote:
Hi,
I am trying to write a webserver CGI app which, as response to a
TWebRequest, produces an OpenGL-based image. When doing so I always get an
error on the webserver (with no error message, just beeping and no image
shown), and the app hangs.

While there is no window I use GetDC(0) to get a device context handle.

Btw: I am quite familiar with HTTP, mime types, TWebRequest and OpenGL. I
succeeded in writing a console app producing a bmp or jpg and saving it to
disc; this app runs on the webserver without any problems, using GetDC(0)
too. I also succeeded in painting to a bmp's canvas (without using OpenGL)
and passing it back to the client as a jpg image.

Maybe its a problem with the anonymous internet user (triggering the app
via
his web browser/HTTP request)? I am running W2K, IIS5 and D7E.

Any ideas or experiences? Thx
Andi







Back to top
Andi
Guest





PostPosted: Wed Apr 28, 2004 8:50 am    Post subject: Re: OpenGL in a CGI webserver application Reply with quote

I looked under "WWW Publishing service", and there the "Interact with the
desktop" option was already checked off.
Am I doing wrong?

"DaveH" <daveh (AT) sympatico (DOT) com> schrieb im Newsbeitrag
news:1083091241.703404 (AT) news (DOT) drenet.dnd.ca...
Quote:
You need to edit your Web Services setting.

Go into "Services" under an Administrator account. Scroll to the bottom
and
look at the propeties for Web Services. Check off the "Interact with the
desktop" option. Now your web app can get valid DC's.

DaveH


"Andi" <andi (AT) hunter (DOT) numerikon.de> wrote in message
news:408cf6d5$1 (AT) newsgroups (DOT) borland.com...
Hi,
I am trying to write a webserver CGI app which, as response to a
TWebRequest, produces an OpenGL-based image. When doing so I always get
an
error on the webserver (with no error message, just beeping and no image
shown), and the app hangs.

While there is no window I use GetDC(0) to get a device context handle.

Btw: I am quite familiar with HTTP, mime types, TWebRequest and OpenGL.
I
succeeded in writing a console app producing a bmp or jpg and saving it
to
disc; this app runs on the webserver without any problems, using
GetDC(0)
too. I also succeeded in painting to a bmp's canvas (without using
OpenGL)
and passing it back to the client as a jpg image.

Maybe its a problem with the anonymous internet user (triggering the app
via
his web browser/HTTP request)? I am running W2K, IIS5 and D7E.

Any ideas or experiences? Thx
Andi









Back to top
Dominique Louis
Guest





PostPosted: Wed Apr 28, 2004 9:46 am    Post subject: Re: OpenGL in a CGI webserver application Reply with quote

Andi wrote:

Quote:
I looked under "WWW Publishing service", and there the "Interact with the
desktop" option was already checked off.
Am I doing wrong?

Hi Andi,
I think he mean that it has to have the check box ticked. That is the
only way it will be able to generate a DC. If I am wrong I am sure DaveH
will correct me.


Dominique.

Back to top
Andi
Guest





PostPosted: Wed Apr 28, 2004 9:53 am    Post subject: Re: OpenGL in a CGI webserver application Reply with quote

Ok, I tried both: option checked and option unchecked (and restarted the
service). It is both the same: doesn't work.


"Dominique Louis" <savage (AT) delphigamer (DOT) com> schrieb im Newsbeitrag
news:408f7cc9$1 (AT) newsgroups (DOT) borland.com...
Quote:
Andi wrote:

I looked under "WWW Publishing service", and there the "Interact with
the
desktop" option was already checked off.
Am I doing wrong?

Hi Andi,
I think he mean that it has to have the check box ticked. That is the
only way it will be able to generate a DC. If I am wrong I am sure DaveH
will correct me.


Dominique.



Back to top
Andi
Guest





PostPosted: Wed Apr 28, 2004 10:01 am    Post subject: Re: OpenGL in a CGI webserver application Reply with quote

I tried the latest MESA binaries. Behavior is different then: gives me an
error message (Access violation in opengl32.dll...) rather than just beeping
(on the server) and doing/saying nothing. Interesting, but didn't really
help.


"Eric Grange" <egrange (AT) glscene (DOT) org> schrieb im Newsbeitrag
news:408e1f35$1 (AT) newsgroups (DOT) borland.com...
Quote:
Any ideas or experiences? Thx

You could try using the MESA DLLs (software OpenGL) instead
of the default windows one, I've had some issues server-side
with MS OpenGL that were solved by using MESA (just drop the
DLLs in your exe's directory). You can find binaries here:

http://sourceforge.net/project/showfiles.php?group_id=29749

However, my server-side use is in a full-blown Delphi HTTP
service application, not something invoked by IIS.

Eric



Back to top
Dave Hackett
Guest





PostPosted: Thu Apr 29, 2004 3:22 am    Post subject: Re: OpenGL in a CGI webserver application Reply with quote

If you debugged to the code that did the "GetDC", what is the DC handle? Is
it valid (ie non zero)?

Now if you check ON the option "Interact with the desktop" and reboot and
debug to the same place, is the DC valid?

You can't go any further until you have a valid DC.

BTW, Are you executing under IIS? If so, what isolation mode do you use?
Try not isolating it so it executes in the same space as IIS and therefore
has the same security credentials.

DaveH



"Andi" <andi (AT) hunter (DOT) numerikon.de> wrote

Quote:
Ok, I tried both: option checked and option unchecked (and restarted the
service). It is both the same: doesn't work.


"Dominique Louis" <savage (AT) delphigamer (DOT) com> schrieb im Newsbeitrag
news:408f7cc9$1 (AT) newsgroups (DOT) borland.com...
Andi wrote:

I looked under "WWW Publishing service", and there the "Interact with
the
desktop" option was already checked off.
Am I doing wrong?

Hi Andi,
I think he mean that it has to have the check box ticked. That is the
only way it will be able to generate a DC. If I am wrong I am sure DaveH
will correct me.


Dominique.





Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Graphics All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.