469,898 Members | 1,611 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,898 developers. It's quick & easy.

Call a DLL LIB function in ASP.NET (Code Behind) or VB.NET (The same code is working fine in VB 6.0)

Dear All,

In VB 6.0 declaring this function and calling this functions works smoothly.
But in VB.NET or ASP.NET (Code behind), I am getting an error in the line
"HResult = CreateReportOnRuntimeDS(Rs, svReportFile, svTTXFile, False,
True)" saying that, "Object reference not set to an instance of an object."
Can any one help me out to solve this problem.

Module Report
Declare Function CreateReportOnRuntimeDS Lib "p2smon.dll" (ByVal
lpUnk As Object, ByVal reportFile As String, ByVal fieldDefFile As String,
ByVal bOverWriteFile As Long, ByVal bLaunchDesigner As Long) As Long

---This is how I use this function in the procedure:
Public Sub pblsCreateReport(ByRef Rs As ADODB.Recordset, ByRef
svReportFile As String, ByRef svTTXFile As String)

Dim rsReportSet As New ADODB.Recordset()

rsReportSet = Rs

Dim HResult As Long

' Create the Report
HResult = CreateReportOnRuntimeDS(Rs, svReportFile, svTTXFile,
False, True)

End Sub

End Module

Thanks and Regards,

Peri
Nov 21 '05 #1
5 1766
You might try changing the Long variables to Integer. Not sure if that
will solve your problem, but I know that the definitions changed
between VB6 and VB.NET.

-Phil

Nov 21 '05 #2
Still it is not working.

"Phillip Ian" <ph****@comcast.net> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
You might try changing the Long variables to Integer. Not sure if that
will solve your problem, but I know that the definitions changed
between VB6 and VB.NET.

-Phil

Nov 21 '05 #3
where u declare RS?

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 21 '05 #4
is it recursive function????? because you couldn't call sub routine in
itself.
I couldn't understand your code exactly. please send it clearer. just I
saw that u call a sub routine with itself???!!! . then how do u want ur
subroutine work when it is not complete yet.

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
Nov 21 '05 #5
No. It is not a recursive funtion

1. pblsCreateReport is a procedure which is called from the ASPX page.

2. CreateReportOnRuntimeDS is a function in the p2smon.dll and I am using
this function in the pblsCreateReport procedure

3. rs is a recorset defined in the ASPX page which contains the dataset (A
new instance for this has been created for this already).

Module Report
Declare Function CreateReportOnRuntimeDS Lib "p2smon.dll" (ByVal
lpUnk As Object, ByVal reportFile As String, ByVal fieldDefFile As String,
ByVal bOverWriteFile As Long, ByVal bLaunchDesigner As Long) As Long

---This is how I use this function in the procedure:
Public Sub pblsCreateReport(ByRef Rs As ADODB.Recordset, ByRef
svReportFile As String, ByRef svTTXFile As String)

Dim HResult As Long

' Create the Report
HResult = CreateReportOnRuntimeDS(Rs, svReportFile, svTTXFile,
False, True)

End Sub

End Module

Thanks and Regards,

Peri

"Sara" <sa*********@gmail.com> wrote in message
news:ex**************@tk2msftngp13.phx.gbl...
is it recursive function????? because you couldn't call sub routine in
itself.
I couldn't understand your code exactly. please send it clearer. just I
saw that u call a sub routine with itself???!!! . then how do u want ur
subroutine work when it is not complete yet.

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com

Nov 21 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Hartmut Schroth | last post: by
171 posts views Thread by tshad | last post: by
5 posts views Thread by settyv | last post: by
4 posts views Thread by sajithkahawatta | last post: by
1 post views Thread by Waqarahmed | last post: by
reply views Thread by Salome Sato | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.