xsharp.eu • Xporting an Internet Server based program: Object reference not set..
Page 1 of 3

Xporting an Internet Server based program: Object reference not set..

Posted: Wed Sep 04, 2019 4:26 pm
by ic2
We are Xporting an Internet Server based program. There is no VO.dll for that SDK so I included a new project where I plan to add any missing code from the SDK source of VO. Not sure if this is the right approach.

Now there's something odd. I called the project SDK and I added Class HTTPCGIContext Inherit HTTPContextAbstract and Class HTTPContextAbstract and within the latter Method GetParamValue(cParam As String, n As Dword, a As Array, lNil As Logic) As String Pascal Class HTTPContextAbstract. When I rebuild that project the SDK.DLL is created successfully.

Now I rebuild the whole project. This gives the error:
Severity Code Description Project File Line Source Suppression State Tool
Error XS0246 The type or namespace name 'HTTPCGIContext' could not be found (are you missing a using directive or an assembly reference?)
Ok, makes sense, the SDK project was not included in one of the projects inheriting from HTTPCGIContext from the SDK project. So I select Add Reference and double click on SDK (from tab Projects).

I then get an error box: Object reference not set to an instance of an object.

How can I solve this?

Dick

Xporting an Internet Server based program: Object reference not set..

Posted: Wed Sep 04, 2019 4:35 pm
by Chris
Hi Dick,

Which build are you using? There was a similar problem some time ago but was fixed in the last couple builds.

Xporting an Internet Server based program: Object reference not set..

Posted: Wed Sep 04, 2019 5:36 pm
by ic2
Hello Chris,


That is the XSharpSetup2RC2Fox to which I reverted today (June 14)

Dick

Xporting an Internet Server based program: Object reference not set..

Posted: Wed Sep 04, 2019 6:23 pm
by Chris
Hi Dick,

I am pretty sure the problem was fixed after that. You will need to use the later builds anwyay at some point, please answer my questions about the issue you have in the latest one, so we can try and track down the problem.

Xporting an Internet Server based program: Object reference not set..

Posted: Fri Sep 06, 2019 8:02 am
by ic2
Helle Chris,

It is fixed indeed in the current run (and I am sure it must have worked in most older versions too because including libs/projects a pretty basic thing :P

Kees tried it on his system with the latest release but until the issue with the ADS dbf write is solved I will have to stick to the RC2 and pause the Xporting work .

Dick

Xporting an Internet Server based program: Object reference not set..

Posted: Fri Sep 06, 2019 8:30 am
by wriedmann
Hi Dick,

do you have tried to xport the Internet Server SDK with the sources you have from VO?
I have tried it now as it should work, but it seems that X# does not accept type pointers to functions like this here:

Code: Select all

member pSetHeader as SetHeader ptr
where

Code: Select all

function SetHeader(pfc as _WINHTTP_FILTER_CONTEXT, lpszName as psz,lpszValue as psz) as logic pascal
	return .T.
But I'm sure Chris or Robert can help here.

Wolfgang

Xporting an Internet Server based program: Object reference not set..

Posted: Fri Sep 06, 2019 9:19 am
by ic2
Hello Wolfgang,

Basically what we want to do is to modernize our CGI .exe Webprogram to eventually a ASPX based X#/C# DLL. First step is to see if the current code can convert. This allows us just to remove whatever is in the Internet SDK. For example: MySQL access relies on ancient ODBC and it has proven to be a problem to get that configured when running the program on another webserver. Then we will also replace other methods like GetParamValue. For all this there are much better .Net alternatives. But we want to make sure that we can compile the rest of the code and for that we add the absolute minimum of Internet SDK code in a separate project . If it compiles to run we will replace every single call and can then remove this SDK methods and classes again.

Dick

Xporting an Internet Server based program: Object reference not set..

Posted: Fri Sep 06, 2019 9:34 am
by wriedmann
Hi Dick,

this was only a thought.
Initially, in my migrations I had planned to change such things, but in the meantime I have changed my plans.
I will try to maintain the VO code whenever possible and rewrite only the parts that I need to change.
Old technolgies will only be replaced my newer ones when the migration is complete and the X# version of my software is running.
Otherwise the migration may be too much work.....
Wolfgang

Xporting an Internet Server based program: Object reference not set..

Posted: Wed Jan 22, 2020 3:44 pm
by Kees Bouw
wriedmann wrote: it seems that X# does not accept type pointers to functions like this here:

Code: Select all

member pSetHeader as SetHeader ptr
where

Code: Select all

function SetHeader(pfc as _WINHTTP_FILTER_CONTEXT, lpszName as psz,lpszValue as psz) as logic pascal
	return .T.
We are having the same problem when using the VO Internet Server API SDK (imported with the VO Xporter). There are 13 "Member line" errors. Is there a solution that we can apply or is it something unfinished in X#?

Kees.

Xporting an Internet Server based program: Object reference not set..

Posted: Wed Jan 22, 2020 7:48 pm
by Chris
Hi Kees,
KeesIC2 wrote:
wriedmann wrote: it seems that X# does not accept type pointers to functions like this here:

Code: Select all

member pSetHeader as SetHeader ptr
where

Code: Select all

function SetHeader(pfc as _WINHTTP_FILTER_CONTEXT, lpszName as psz,lpszValue as psz) as logic pascal
	return .T.
We are having the same problem when using the VO Internet Server API SDK (imported with the VO Xporter). There are 13 "Member line" errors. Is there a solution that we can apply or is it something unfinished in X#?

Kees.
What is the exact error message?

Can you please post (complete) sample code showing this problem?