473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 1904
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Hartmut Schroth | last post by:
Hi, is it possible to call a Windows function from VB code behind an aspx page? Shell seems not to work?? Task: I want to execute an SQL script for SQL Server and want to avoid to be forced to...
3
by: CW | last post by:
I find it necessary to mix code-behind and non-code behind techniques sometimes. I have utility functions defined in a VB module. Is there anyway for me to call functions defined in VB module...
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
2
by: Peri | last post by:
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 =...
7
by: J-T | last post by:
I have a user control called "Test1" with two button on it ,one is input and the other one is a server control as follow: <input type="button"...
5
by: settyv | last post by:
Hi, Below is the Javascript function that am trying to call from asp:Button control. <script language="javascript"> function ValidateDate(fromDate,toDate) { var fromDate=new Date();
0
by: sandeepkavade | last post by:
hi everybody, i want to call a function from c++ dll. previously it was working fine. but now i want to add unicode support to it. it works fine if _UNICODE is not defined in c++ dll. but if i...
4
by: sajithkahawatta | last post by:
i want to call a java script function from code behind. in page1.aspx page i placed script' <script language="javascript"> function SetSelected() { infoTextBox.select(); } </script>
6
by: RandomElle | last post by:
Hi there I'm hoping someone can help me out with the use of the Eval function. I am using Access2003 under WinXP Pro. I can successfully use the Eval function and get it to call any function with...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.