473,394 Members | 1,854 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,394 software developers and data experts.

How to call a dll in ASP ?

We have a C++ DLL that we call from VB6 program.
This is how we declare the DLL in VB6:
Declare Function RefSearch Lib "csearch32.dll" (ByVal path As String,
ByVal findword As String, ByVal CaseSensitive As Integer) As Integer

This is how we call the DLL in VB6:
hit = RefSearch(path, SearchStr1, ChkValue)

Can I call this DLL in ASP and how ?
Thank you.

Mar 18 '07 #1
6 5276
<fi**********@gmail.comwrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
We have a C++ DLL that we call from VB6 program.
This is how we declare the DLL in VB6:
Declare Function RefSearch Lib "csearch32.dll" (ByVal path As String,
ByVal findword As String, ByVal CaseSensitive As Integer) As Integer

This is how we call the DLL in VB6:
hit = RefSearch(path, SearchStr1, ChkValue)

Can I call this DLL in ASP and how ?
Is the DLL "apartment threaded"?
Can you recompile it to be?

Creating Visual basic COMponents for ASP
http://www.macronimous.com/resources...asp_vb_dll.asp

Calling a Visual Basic Component Subroutine from ASP
http://www.thescripts.com/forum/thread51438.html
Mar 18 '07 #2
Thanks.

The DLL is a VC++ DLL, not a VB DLL. There is no class that I can call
it like
Set objName = Server.CreateObject("ProjectName.ClassModuleName")
I want to call this VC++ DLL from ASP
On Mar 18, 1:15 pm, "McKirahan" <N...@McKirahan.comwrote:
<fiefie.ni...@gmail.comwrote in message

news:11**********************@y80g2000hsf.googlegr oups.com...
We have a C++ DLL that we call from VB6 program.
This is how we declare the DLL in VB6:
Declare Function RefSearch Lib "csearch32.dll" (ByVal path As String,
ByVal findword As String, ByVal CaseSensitive As Integer) As Integer
This is how we call the DLL in VB6:
hit = RefSearch(path, SearchStr1, ChkValue)
Can I call this DLL in ASP and how ?

Is the DLL "apartment threaded"?
Can you recompile it to be?

Creating Visual basic COMponents for ASPhttp://www.macronimous.com/resources/tutorials/asp_vb_dll.asp

Calling a Visual Basic Component Subroutine from ASPhttp://www.thescripts.com/forum/thread51438.html

Mar 18 '07 #3

<fi**********@gmail.comwrote in message
news:11**********************@y80g2000hsf.googlegr oups.com...
We have a C++ DLL that we call from VB6 program.
This is how we declare the DLL in VB6:
Declare Function RefSearch Lib "csearch32.dll" (ByVal path As String,
ByVal findword As String, ByVal CaseSensitive As Integer) As Integer

This is how we call the DLL in VB6:
hit = RefSearch(path, SearchStr1, ChkValue)

Can I call this DLL in ASP and how ?
Thank you.
Create an VB6 ActiveX DLL. In the project properties it is very important
that both Unattended Execution and Retained In Memory are selected otherwise
your site will crash for almost inexplicable reasons. For performance
reasons apartment threading is strongly recommend. You do not need to
recompile your existing C++ dll.

You VB6 code can look something like this:-

'Project MyAspHelper

'Class CSearch

Private Declare Function RefSearch Lib "csearch32.dll" (ByVal path As
String,
ByVal findword As String, ByVal CaseSensitive As Integer) As Integer

Public Function Search(ByVal Path As String, ByVal FindWord As String, ByVal
CaseSensitive As String) As Integer
Search = RefSearch(Path, FindWord, CaseSensitive)
End Function
Now in ASP you can use:-
Dim oSearch : Set oSearch = CreateObject("MyAspHelper.CSearch")

Dim lRes

lRes = oSearch.Search(FileName, "Hello", False)



Mar 18 '07 #4
fi**********@gmail.com wrote:
Thanks.

The DLL is a VC++ DLL, not a VB DLL. There is no class that I can call
it like
Set objName = Server.CreateObject("ProjectName.ClassModuleName")
I want to call this VC++ DLL from ASP

There has to be. It has to be a COM object in order to call it from any
scripting language that I'm familiar with.
--
Microsoft MVP - ASP/ASP.NET
Please reply to the newsgroup. This email account is my spam trap so I
don't check it very often. If you must reply off-line, then remove the
"NO SPAM"
Mar 18 '07 #5
Great idea, thank you.
I tried it, but the weird thing is when I call that VB6 ActiveX DLL
from VB6, it search fine.
For example: I have a document with the word "FieFie" in it. Calling
the DLL from VB6, I can search for fiefie, or fie, or Fie and it will
find all of them.
Calling the DLL from ASP, when I search for Fie it will find it, but
when I search for fiefie or fie, it does not find it.

On Mar 18, 3:13 pm, "Anthony Jones" <A...@yadayadayada.comwrote:
<fiefie.ni...@gmail.comwrote in message

news:11**********************@y80g2000hsf.googlegr oups.com...
We have a C++ DLL that we call from VB6 program.
This is how we declare the DLL in VB6:
Declare Function RefSearch Lib "csearch32.dll" (ByVal path As String,
ByVal findword As String, ByVal CaseSensitive As Integer) As Integer
This is how we call the DLL in VB6:
hit = RefSearch(path, SearchStr1, ChkValue)
Can I call this DLL in ASP and how ?
Thank you.

Create an VB6 ActiveX DLL. In the project properties it is very important
that both Unattended Execution and Retained In Memory are selected otherwise
your site will crash for almost inexplicable reasons. For performance
reasons apartment threading is strongly recommend. You do not need to
recompile your existing C++ dll.

You VB6 code can look something like this:-

'Project MyAspHelper

'Class CSearch

Private Declare Function RefSearch Lib "csearch32.dll" (ByVal path As
String,
ByVal findword As String, ByVal CaseSensitive As Integer) As Integer

Public Function Search(ByVal Path As String, ByVal FindWord As String, ByVal
CaseSensitive As String) As Integer
Search = RefSearch(Path, FindWord, CaseSensitive)
End Function

Now in ASP you can use:-

Dim oSearch : Set oSearch = CreateObject("MyAspHelper.CSearch")

Dim lRes

lRes = oSearch.Search(FileName, "Hello", False)

Mar 18 '07 #6

<fi**********@gmail.comwrote in message
news:11**********************@b75g2000hsg.googlegr oups.com...
Great idea, thank you.
I tried it, but the weird thing is when I call that VB6 ActiveX DLL
from VB6, it search fine.
For example: I have a document with the word "FieFie" in it. Calling
the DLL from VB6, I can search for fiefie, or fie, or Fie and it will
find all of them.
Calling the DLL from ASP, when I search for Fie it will find it, but
when I search for fiefie or fie, it does not find it.

One test you might try is the same code in a VBScript file (.vbs).

Does the C++ DLL depend on any values found in the user context such as
current user registry values?
>
On Mar 18, 3:13 pm, "Anthony Jones" <A...@yadayadayada.comwrote:
<fiefie.ni...@gmail.comwrote in message

news:11**********************@y80g2000hsf.googlegr oups.com...
We have a C++ DLL that we call from VB6 program.
This is how we declare the DLL in VB6:
Declare Function RefSearch Lib "csearch32.dll" (ByVal path As String,
ByVal findword As String, ByVal CaseSensitive As Integer) As Integer
This is how we call the DLL in VB6:
hit = RefSearch(path, SearchStr1, ChkValue)
Can I call this DLL in ASP and how ?
Thank you.
Create an VB6 ActiveX DLL. In the project properties it is very
important
that both Unattended Execution and Retained In Memory are selected
otherwise
your site will crash for almost inexplicable reasons. For performance
reasons apartment threading is strongly recommend. You do not need to
recompile your existing C++ dll.

You VB6 code can look something like this:-

'Project MyAspHelper

'Class CSearch

Private Declare Function RefSearch Lib "csearch32.dll" (ByVal path As
String,
ByVal findword As String, ByVal CaseSensitive As Integer) As Integer

Public Function Search(ByVal Path As String, ByVal FindWord As String,
ByVal
CaseSensitive As String) As Integer
Search = RefSearch(Path, FindWord, CaseSensitive)
End Function

Now in ASP you can use:-

Dim oSearch : Set oSearch = CreateObject("MyAspHelper.CSearch")

Dim lRes

lRes = oSearch.Search(FileName, "Hello", False)


Mar 19 '07 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

23
by: Fabian Müller | last post by:
Hi all, my question is as follows: If have a class X and a class Y derived from X. Constructor of X is X(param1, param2) . Constructor of Y is Y(param1, ..., param4) .
35
by: hasho | last post by:
Why is "call by address" faster than "call by value"?
13
by: Bern McCarty | last post by:
I have run an experiment to try to learn some things about floating point performance in managed C++. I am using Visual Studio 2003. I was hoping to get a feel for whether or not it would make...
4
by: John | last post by:
Hi all, This really is quite an urgent matter. I have a page with multiple, dynamically-loaded user controls and when a user clicks on a button, the whole form is submitted. Now at this stage...
5
by: Amaryllis | last post by:
I'm trying to call a CL which is located on our AS400 from a Windows application. I've tried to code it in different ways, but I seem to get the same error every time. Does anyone have any clue...
13
by: mitchellpal | last post by:
i am really having a hard time trying to differentiate the two..........i mean.....anyone got a better idea how each occurs?
13
by: shsingh | last post by:
I have a class A containing some map as data variables. I creat an object of class A on heap by allocatiing memory by using "malloc". This will return me the required memory but the object is not...
3
by: cberthu | last post by:
Hi all, Is it possible to have two connects in the same rexx script to different DB's? I have to get data form on DB (with specifics selects and filter out some values with RExx) and save the...
9
by: CryptiqueGuy | last post by:
Consider the variadic function with the following prototype: int foo(int num,...); Here 'num' specifies the number of arguments, and assume that all the arguments that should be passed to this...
12
by: Rahul | last post by:
Hi Everyone, I have the following code and i'm able to invoke the destructor explicitly but not the constructor. and i get a compile time error when i invoke the constructor, why is this so? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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...

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.