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

P

Peri

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
 
P

Phillip Ian

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,816
Latest member
SapanaCarpetStudio

Latest Threads

Top