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

Discussion in 'ASP .Net' started by Peri, Jul 19, 2005.

  1. Peri

    Peri Guest

    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
     
    Peri, Jul 19, 2005
    #1
    1. Advertising

  2. Peri

    Phillip Ian Guest

    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
     
    Phillip Ian, Jul 19, 2005
    #2
    1. Advertising

  3. Peri

    Peri Guest

    Still it is not working.

    "Phillip Ian" <> wrote in message
    news:...
    > 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
    >
     
    Peri, Jul 20, 2005
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ben Miller [msft]

    Re: Code Behind vs. no code behind: error

    Ben Miller [msft], Jun 27, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    607
    Alphonse Giambrone
    Jun 28, 2003
  2. NGM
    Replies:
    0
    Views:
    2,324
  3. John

    Non-code behind to code behind

    John, Feb 19, 2007, in forum: ASP .Net
    Replies:
    2
    Views:
    499
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Feb 19, 2007
  4. ashjas
    Replies:
    7
    Views:
    346
    ashjas
    Dec 10, 2007
  5. est
    Replies:
    1
    Views:
    625
    Diez B. Roggisch
    Feb 16, 2008
Loading...

Share This Page