473,659 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5294
<fi**********@g mail.comwrote in message
news:11******** **************@ y80g2000hsf.goo glegroups.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.CreateOb ject("ProjectNa me.ClassModuleN ame")
I want to call this VC++ DLL from ASP
On Mar 18, 1:15 pm, "McKirahan" <N...@McKirahan .comwrote:
<fiefie.ni...@g mail.comwrote in message

news:11******** **************@ y80g2000hsf.goo glegroups.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.htm l

Mar 18 '07 #3

<fi**********@g mail.comwrote in message
news:11******** **************@ y80g2000hsf.goo glegroups.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("M yAspHelper.CSea rch")

Dim lRes

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



Mar 18 '07 #4
fi**********@gm ail.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.CreateOb ject("ProjectNa me.ClassModuleN ame")
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...@yadayaday ada.comwrote:
<fiefie.ni...@g mail.comwrote in message

news:11******** **************@ y80g2000hsf.goo glegroups.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("M yAspHelper.CSea rch")

Dim lRes

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

Mar 18 '07 #6

<fi**********@g mail.comwrote in message
news:11******** **************@ b75g2000hsg.goo glegroups.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...@yadayaday ada.comwrote:
<fiefie.ni...@g mail.comwrote in message

news:11******** **************@ y80g2000hsf.goo glegroups.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("M yAspHelper.CSea rch")

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
5172
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
10771
by: hasho | last post by:
Why is "call by address" faster than "call by value"?
13
4124
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 sense to punch out from managed code to native code (I was using IJW) in order to do some amount of floating point work and, if so, what that certain amount of floating point work was approximately. To attempt to do this I made a program that...
4
4279
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 I know I need to call a function that will save data but I'm not sure exactly when to call this function. I've tried two ways and both seem to have 'gotcha's':
5
3773
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 as to what this means? I am not trying to alter a table. This particular CL merely generates the next voucher number in a sequence. "SQL0204: HRCU030P in HRZNCUSOBJ type *N not found. Cause . . . . . : HRCU030P in HRZNCUSOBJ type *N was...
13
26591
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
9705
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 initialized properly as constructor same is not get called ( as per the behavior). How to call a constructor explicitly if we want to allocate memory using malloc ?
3
4778
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 results into another DB? I know from Wscripts and MS-Sql that you can build just two objects but I did not see something like that in REXX. Thanks in advance for your help
9
3267
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 function are of type int. (My question has nothing to do with the definition of the function foo, so don't bother about it.) If I call the function as: foo(2,3,4,5,6,7,8);/*More arguments than expected*/
12
7192
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? class Trial { public: Trial() {
0
8427
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8332
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8851
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8525
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2750
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1737
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.