Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_components thread: ActiveX


Message #1 by "CADU Boris" <bcadu@f...> on Tue, 18 Jul 2000 18:27:11
Hello,



i have a problem with activex dll. I created one  correctly with the active server book and microsoft site:

But I have an error, althougth I put a code I found on microsoft site ( it

is exactly what I want ). The url is :

http://support.microsoft.com/support/kb/articles/Q193/9/98.ASP



I made a project as the said with VB6: the code is:

Function readBinFile(ByVal bfilename As String)

       Dim fl As Long

       Dim binbyte() As Byte

       Dim binfilestr As String



       On Error GoTo errHandler



       Open bfilename For Binary Access Read As #1



       fl = FileLen(bfilename)

       ReDim binbyte(fl)



       Get #1, , binbyte



       Close #1



       readBinFile = binbyte

       Exit Function



I registre it with regsvr32 and all is all rigth but when I want to use it

in a asp code for example:



  Response.buffer = TRUE

   Response.ContentType = "image/gif"



   Dim vntStream



   Set oMyObject = Server.CreateObject("MyObject.BinRead")

   vntStream = oMyObject.readBinFile("c:\temp\temp.gif")



   Response.BinaryWrite(vntStream)



   Set oMyObject = Nothing



   Response.End



I have :



Erreur d'exécution Microsoft VBScript erreur '800a01ad'   ( execution

error )

Un composant ActiveX ne peut pas créer un objet. ( a composant can't create

an object )

/kissiel/hit/essai.asp, ligne 3

I have the same error with the code you give in the book with the sales and

commission component.



Thanks a lot for helping me.



Wityh regards


  Return to Index