error XS0246: The type or namespace name 'GetHeader' could not be found (are you missing a using directive or an assembly reference?) 261,23 ISAPIDefine.prg VOInternetServer
Yeah, normally you'd need to use delegates and then pointers derived from them,but this structure is being filled by windows, not by the user, isn't that right? So you do not have control on how you create it.
I think it should be still possible to use the pointers returned and even call the functions contained in them through the pcall/ccall mechanism and actually typed function pointers are already supported in LOCALs (with the /vo6 compiler option enabled), so probably they can be supported in VOSTRUCTs as well, but I think all this will become a big mess, isn't it much better just using the standard .Net internet classes instead, even for ported apps?
But for a quick answer if you really want to compile this library, if you are not actually using the function pointers, you can simply change them to simple AS PTR. Do you have some small code actually using those structures?
Hi Chris,
this library is a part of the VO SDK, and even if I don't use this, there are several people that used it and have asked also in the past to move it to X#.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
We'll have a look at the library.
But it will not be easy.
What are you using this for?
- CGI apps
- ISAPI Extension DLL
- ISAPI Filter DLL
- ASP Component DLL
Robert
XSharp Development Team
The Netherlands
robert@xsharp.eu
Hi Robert,
personally I don't use that. But I know several people that uses CGI apps, and I think Dick is using the same.
So this would be the most important.
If others are used, people will ask here, I hope.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Thank you for the replies. Yes, we have several CGI applications that we would like to transfer to X#. I would be more than happy to use standard .NET internet classes, but some explanation or help would be very welcome. From the VO class we only use this:
CLASS HTTPCGIContext, methods:
GetParamValue
GetParams
Write
HttpHeader
Close
ReadCookies
GetCookieValue
SetCookie
and CLASS HttpCookie
If there are corresponding .NET calls then maybe it will not be too difficult to use those?
With help from Robert I managed to Xport our CGI application and successfully build it in X# without any errors or even warnings. Now I have the situation that the application built in VO does work (and has worked for many years already), but if I copy all files in the X# release folder including the new executable to the website, the web server does not even try to execute it but immediately displays a download window. The X# exe has the same name as the VO exe so executable rights etc. have all been set. What puzzles me is why the web server does not even try to execute it. I should think that once the web server is set up correctly, which it is otherwise the VO version would not work, it will execute anything with the correct name. Many things can go wrong after execution starts of course, but we don't even get to that point. Any ideas on how to explain this (or even better: fix it) are very welcome!
here is a Test class for testing CGI processes. I use this to test php implementation via CGI/FastCGI in my WebServer. Just replace Filename with your exe file and add your required EnvironmentVariables.
Than console output should help.
FUNCTION Start( ) AS VOID
System.Console.WriteLine("Hello x#!")
VAR test := CgiTest{}
test:CallCgi()
RETURN
CLASS CgiTest
PRIVATE _phpOutput AS STRING
METHOD CallCgi() AS VOID
TRY
VAR p := System.Diagnostics.Process{}
p:StartInfo:FileName := "f:Tempphp-7.4php-cgi.exe" //Replace with your file
p:StartInfo:CreateNoWindow := TRUE
p:StartInfo:UseShellExecute := FALSE
p:StartInfo:RedirectStandardInput := TRUE
p:StartInfo:RedirectStandardOutput := TRUE
p:StartInfo:RedirectStandardError := TRUE
p:StartInfo:StandardOutputEncoding := System.Text.Encoding.UTF8
VAR evList := Dictionary<STRING, STRING>{}
p:StartInfo:EnvironmentVariables:Add("SCRIPT_FILENAME", "f:Tempphp-7.4WikiDoku.php") //Change an add you variables
p:OutputDataReceived += phpOutputReceived
p:Start()
p:BeginOutputReadLine()
IF (!p:WaitForExit(10000))
p:Kill()
ENDIF
VAR err := p:StandardError:ReadToEnd()
Console.WriteLine("received: "+SELF:_phpOutput)
Console.WriteLine("error: "+err)
CATCH ex AS Exception
Console.WriteLine(ex:ToString())
END TRY
RETURN
METHOD phpOutputReceived(sender AS OBJECT , e AS System.Diagnostics.DataReceivedEventArgs) AS VOID
SELF:_phpOutput += e:Data+e"rn"
RETURN
END CLASS