p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

proasp_howto thread: accessing DLL function written in C++

Message #1 by "John King" <johnking@o...> on Mon, 9 Dec 2002 03:25:06
> So, I know both languages.

ASP can support any language that has the required implementation, eg 
there is a perl installation that lets you use perl and all the features 
of that, eg using sockets without the need to use COM objects

<%@ LANGUAGE =3D PerlScript%>

<% use LWP::UserAgent;
   use HTTP::Request::Common;

   $ipaddr =3D $Request->ServerVariables('REMOTE_ADDR')->{Item};

   $url =3D "http://www.arin.net/cgi-bin/whois.pl?queryinput=3D$ipaddr";
   $ua =3D LWP::UserAgent->new;
   $response =3D $ua->request(GET $url);
   $content =3D $response->content;

This code won't work unless you have installed ActivePERL, but it 
demonstrates the flexibility of ASP as a scripting environment.  As long 
as someone has written the engine, you can use their script language 
from ASP.

> However, support of COM is independent of language

Yes, I know.

> But in general case, if the COM can be created by
> one, it can be created by another.

I know and didn't say otherwise.  The issue is using non-COM DLLs.  Some 
that VBScript can't do, not sure if JScript can (although probably not), 
not sure if Perl can and I can't say for sure that someone out there 
doesn't have a language used via ASP that can access non-COM DLLs.

> Conclusion: If you suspect his problem is caused by VBScript, then
> he could use Server.CreateObject.

CreateObject isn't going to work, period, if it isn't a COM DLL.

> On the other hand, ASP isn't the only place VBScript can
> be used.

I know.  I use it via WSH, DHTML and in Office Macros all the time.

  Return to Index