PC Review


Reply
Thread Tools Rating: Thread Rating: 1 votes, 1.00 average.

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

 
 
Peri
Guest
Posts: n/a
 
      19th Jul 2005
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


 
Reply With Quote
 
 
 
 
Phillip Ian
Guest
Posts: n/a
 
      19th Jul 2005
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

 
Reply With Quote
 
Peri
Guest
Posts: n/a
 
      20th Jul 2005
Still it is not working.

"Phillip Ian" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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
>



 
Reply With Quote
 
Sara
Guest
Posts: n/a
 
      20th Jul 2005
where u declare RS?

--
Sent via .NET Newsgroups
http://www.dotnetnewsgroups.com
 
Reply With Quote
 
Sara
Guest
Posts: n/a
 
      20th Jul 2005
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
 
Reply With Quote
 
Peri
Guest
Posts: n/a
 
      20th Jul 2005
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" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Call an ADDIN function from VBA code =?Utf-8?B?TWFydmlu?= Microsoft Excel Programming 11 25th Jun 2007 05:55 PM
call a javascript function within code behind sajithkahawatta Microsoft C# .NET 4 20th Jun 2007 03:04 PM
How to call javascript function from code behind verci Microsoft ASP .NET 4 9th Apr 2007 07:19 AM
how can i call sub or function in vba code xxx Microsoft Excel Misc 3 28th Jun 2006 11:47 AM
Call a DLL LIB function in ASP.NET (Code Behind) or VB.NET (The same code is working fine in VB 6.0) Peri Microsoft ASP .NET 2 20th Jul 2005 04:13 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:59 PM.