How to make a call from ASP to a .NET DLL?

_RIP_DREAMS
07-19-2002, 07:04 PM
i wanted to a make a DLL who has some functions to my ASP webpage...but i want to make that DLL in VB.NET or maybe C#.NET...how do i call it from my ASP page...? i tryed calling the 'old way' but obviously it doesnt seem to feet all the way because controls are not activex anymore in .NET!

tks in advance

Derek Stone
07-19-2002, 07:15 PM
You have to create a CCW (COM Callable Wrapper) for the .NET DLL.

_RIP_DREAMS
07-19-2002, 09:16 PM
and how do i do that...?

any tuts about that online?

Derek Stone
07-19-2002, 09:39 PM
I'm working on one. However it won't be ready for atleast a week. Try Google.

_RIP_DREAMS
07-19-2002, 09:40 PM
:\

but ok when u ready could u plz put it here so i can use it too? i would be really apreciated =)

Derek Stone
07-19-2002, 10:19 PM
Here's a very quick and abbreviated run down on how to do it:

Create your class as you want it, and then prefix it with the <ComClass()> attribute:


<ComClass( _
myClass.ClassId), _
myClass.InterfaceId), _
myClass.EventsId)> _
Public Class myClass
Public Shared ClassId As String = "{2E53E5B1-0895-4712-AA35-0341D8E903E7}"
Public Shared InterfaceId As String = "{C411082A-D5CD-4eb7-BE20-F57E1144D17E}"
Public Shared EventsId As String = "{1D622516-1113-4b7f-9F08-E61A45A99402}"
End Class 'myClass


You'll need to use the guidgen.exe utility (in the Common7\Tools\ directory under the Visual Studio .NET root directory) to generate 3 unique GUIDs (those long strings you see above).

If you need more help than this I'll see what I can do.

_RIP_DREAMS
07-19-2002, 10:21 PM
ok much tks =)

_RIP_DREAMS
07-20-2002, 01:26 PM
hmm yesterday i was too tired to look at ur code...is that code to put in the DLL or in the ASP webpage...?

and how do i do funcions in the dll? like in vb6?

function Open(filename as string)
bla bla bla
Open=bla bla bla
end function

is like this i make?

_RIP_DREAMS
07-20-2002, 01:27 PM
isnt there a tuturial out there explaining how to do that?

Thinker
07-20-2002, 05:28 PM
That code goes in the DLL to allow it to be seen as an ActiveX
com component. From that point, it will work just like any other
ActiveX DLL from a web page in ASP. Your functions will still need
to be public just like with VB6.

_RIP_DREAMS
07-21-2002, 05:48 AM
ahh tks when i get at home ill do that

_RIP_DREAMS
07-21-2002, 09:35 AM
sorry for being so dumb but..to make a DLL in vb.net, what do i use..?
Class Libraries..?
Web Control Libraries..?

_RIP_DREAMS
07-21-2002, 09:39 AM
tried with ClassLibraries and it gave me an error:

<ComClass(myClass.ClassId, myClass.InterfaceId,myClass.EventsId)> Public Class myClass
Public Shared ClassId As String = "{2E53E5B1-0895-4712-AA35-0341D8E903E7}"
Public Shared InterfaceId As String = "{C411082A-D5CD-4eb7-BE20-F57E1144D17E}"
Public Shared EventsId As String = "{1D622516-1113-4b7f-9F08-E61A45A99402}"
End Class 'myClass

he's underlining myClass

_RIP_DREAMS
07-23-2002, 09:53 AM
so..?

Thinker
07-23-2002, 10:42 AM
You can't use myclass. Let me quote from msdn...

MyClass behaves like an object variable referring to the current instance of a class as originally implemented. MyClass is similar to Me, but all method calls on it are treated as if the method were NotOverridable. Therefore, the method being called is not affected by overriding in a derived class.
Just change it to thisClass, or myClass1, or whatever.

_RIP_DREAMS
07-23-2002, 05:58 PM
ah ok tks =)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum