How to call a dll in ASP ?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > IIS server support > IIS ASP > How to call a dll in ASP ?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    How to call a dll in ASP ?  
fiefie.niles@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-18-07 06:20 PM

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.






[ Post a follow-up to this message ]



    Re: How to call a dll in ASP ?  
McKirahan


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-18-07 06:20 PM

<fiefie.niles@gmail.com> wrote in message
news:1174237772.659366.257750@y80g2000hsf.googlegroups.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/resource.../asp_vb_dll.asp

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







[ Post a follow-up to this message ]



    Re: How to call a dll in ASP ?  
fiefie.niles@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-19-07 12:16 AM

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.com> wrote:
> <fiefie.ni...@gmail.com> wrote in message
>
> news:1174237772.659366.257750@y80g2000hsf.googlegroups.com...
> 
> 
> 
>
> Is the DLL "apartment threaded"?
> Can you recompile it to be?
>
> Creating Visual basic COMponents for ASPhttp://www.macronimous.com/resourc
es/tutorials/asp_vb_dll.asp
>
> Calling a Visual Basic Component Subroutine from ASPhttp://www.thescripts.com/foru
m/thread51438.html







[ Post a follow-up to this message ]



    Re: How to call a dll in ASP ?  
Anthony Jones


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-19-07 12:16 AM


<fiefie.niles@gmail.com> wrote in message
news:1174237772.659366.257750@y80g2000hsf.googlegroups.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)












[ Post a follow-up to this message ]



    Re: How to call a dll in ASP ?  
Bob Barrows [MVP]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-19-07 12:16 AM

fiefie.niles@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"







[ Post a follow-up to this message ]



    Re: How to call a dll in ASP ?  
fiefie.niles@gmail.com


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-19-07 12:16 AM

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.com> wrote:
> <fiefie.ni...@gmail.com> wrote in message
>
> news:1174237772.659366.257750@y80g2000hsf.googlegroups.com...
> 
> 
> 
>
> Create an VB6 ActiveX DLL.  In the project properties it is very important
> that both Unattended Execution and Retained In Memory are selected otherwi
se
> 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, ByV
al
> 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)







[ Post a follow-up to this message ]



    Re: How to call a dll in ASP ?  
Anthony Jones


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
03-19-07 06:28 PM


<fiefie.niles@gmail.com> wrote in message
news:1174258499.461470.155730@b75g2000hsg.googlegroups.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.com> wrote: 
important[vbcol=seagreen] 
otherwise[vbcol=seagreen] 
ByVal[vbcol=seagreen] 
>
>







[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:36 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register