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

This forum is meant for questions and discussions about the X# language and tools
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

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

Post 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
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

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

Post 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.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

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

Post by ic2 »

Hello Chris,


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

Dick
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

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

Post 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.
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

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

Post 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
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

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

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
ic2
Posts: 1798
Joined: Sun Feb 28, 2016 11:30 pm
Location: Holland

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

Post 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
User avatar
wriedmann
Posts: 3644
Joined: Mon Nov 02, 2015 5:07 pm
Location: Italy

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

Post 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
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
User avatar
Kees Bouw
Posts: 97
Joined: Wed Nov 06, 2019 11:35 am
Location: Netherlands

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

Post 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.
User avatar
Chris
Posts: 4562
Joined: Thu Oct 08, 2015 7:48 am
Location: Greece

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

Post 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?
Chris Pyrgas

XSharp Development Team test
chris(at)xsharp.eu
Post Reply