error in loading DLL (strange problem) 
Author Message
 error in loading DLL (strange problem)

I have ASP-pages calling ActiveX components usually residing in MTS. While
this works perfectly in my real application, I have never found a good way
of debugging the components. It feels like I'm closer than ever now, just
one little problem...

My debugging environment is Windows 2000 professional, and Visual Basic 6
running a project group of 20 or so projects. My problem occurs when a
component function returns a variant containing a UDT to ASP. I know that
the documentation says that this is not supported, but it works perfectly
fine when it runs outside of the VB6 IDE. When the function returns, I get
"error in loading DLL" (see Q224397, "PRB: "Error Loading DLL" When
Returning User Defined Data Type from VB COM Object").

Is there a way to make it work in the VB6 IDE? I need to return the UDT
because it is put into a session object for use in later pages.

Cheers,
/ Morgan



Sun, 24 Oct 2004 21:12:14 GMT  
 error in loading DLL (strange problem)
Based on my first research, i found that the User-defined data types are
not supported in the current version of Active Server Pages (ASP).  Here is
the public article:

PRB: Returning a UDT from a VB COM Object Brings an Error (Q224422)
http://www.*-*-*.com/ ;en-us;Q224422

Then i also tried it with the following code,

VB DLL code:

Public Type TestUDT
   strName As String
   strDept As String
End Type

Public Function TestMethod() As Variant
    Dim udtTestData As TestUDT

    udtTestData.strDept = "TestDept"
    udtTestData.strName = "TestName"

    TestMethod = udtTestData
End Function

ASP code:

<%
   Dim objTest, udtData
   Set objTest = Server.CreateObject("VBUDTPrj.VBUDTObj")
   udtData = objTest.TestMethod()

   Response.Write( "Name = " & udtData.strName & "<BR>" )
   Response.Write( "Dept = " & udtData.strDept & "<BR>" )
%>

When I run the ASP without debugging into the VB Dll, the following error
occurred:

Microsoft VBScript runtime error '800a01a8'
Object required

While with VB DLL de{*filter*} enabled, the same error as you mentioned
occurred:

Microsoft VBScript runtime error '800a0030'
Error Loading DLL: TestMethod

As my suggestion, please follow the workaround mentioned in the article
above to workaround the problem.

Regards,

This posting is provided "AS IS", with no warranties, and confers no
rights. Enjoyed ASP.NET? http://www.*-*-*.com/



Mon, 25 Oct 2004 10:46:31 GMT  
 error in loading DLL (strange problem)
I wasn't too clear about my problem. I never try to access the contents of
the returned variant; only send it to a session variable. The error occurs
directly when the variant is returned into an ASP-variable (actually as a
return value from an ASP-function). This does not expose the udt contents
and should work. It leads me to think that I have problems creating my udt
object from ASP. Note that I have this in global.asa:

<!-- METADATA TYPE="TypeLib" file="c:\mydll.dll" -->

I can't find much information about this construct so I'm going to run a
little more trial-and-sure to error.

/ Morgan


Quote:
> Based on my first research, i found that the User-defined data types are
> not supported in the current version of Active Server Pages (ASP).  Here
is
> the public article:

> PRB: Returning a UDT from a VB COM Object Brings an Error (Q224422)
> http://www.*-*-*.com/ ;en-us;Q224422

> Then i also tried it with the following code,

> VB DLL code:

> Public Type TestUDT
>    strName As String
>    strDept As String
> End Type

> Public Function TestMethod() As Variant
>     Dim udtTestData As TestUDT

>     udtTestData.strDept = "TestDept"
>     udtTestData.strName = "TestName"

>     TestMethod = udtTestData
> End Function

> ASP code:

> <%
>    Dim objTest, udtData
>    Set objTest = Server.CreateObject("VBUDTPrj.VBUDTObj")
>    udtData = objTest.TestMethod()

>    Response.Write( "Name = " & udtData.strName & "<BR>" )
>    Response.Write( "Dept = " & udtData.strDept & "<BR>" )
> %>

> When I run the ASP without debugging into the VB Dll, the following error
> occurred:

> Microsoft VBScript runtime error '800a01a8'
> Object required

> While with VB DLL de{*filter*} enabled, the same error as you mentioned
> occurred:

> Microsoft VBScript runtime error '800a0030'
> Error Loading DLL: TestMethod

> As my suggestion, please follow the workaround mentioned in the article
> above to workaround the problem.

> Regards,

> This posting is provided "AS IS", with no warranties, and confers no
> rights. Enjoyed ASP.NET? http://www.*-*-*.com/



Fri, 29 Oct 2004 18:22:04 GMT  
 error in loading DLL (strange problem)
I've found the cause. It was the dll which was not correctly registered in
the location referenced in the metadata tag. I used a project group and only
had the dll project in there... which of course didn't work. Now, I pulled
it out of the project group since it needn't be in there anyway and it all
worked.
Gary, thanks for your help
/ Morgan


Quote:
> I wasn't too clear about my problem. I never try to access the contents of
> the returned variant; only send it to a session variable. The error occurs
> directly when the variant is returned into an ASP-variable (actually as a
> return value from an ASP-function). This does not expose the udt contents
> and should work. It leads me to think that I have problems creating my udt
> object from ASP. Note that I have this in global.asa:

> <!-- METADATA TYPE="TypeLib" file="c:\mydll.dll" -->

> I can't find much information about this construct so I'm going to run a
> little more trial-and-sure to error.

> / Morgan



> > Based on my first research, i found that the User-defined data types are
> > not supported in the current version of Active Server Pages (ASP).  Here
> is
> > the public article:

> > PRB: Returning a UDT from a VB COM Object Brings an Error (Q224422)
> > http://www.*-*-*.com/ ;en-us;Q224422

> > Then i also tried it with the following code,

> > VB DLL code:

> > Public Type TestUDT
> >    strName As String
> >    strDept As String
> > End Type

> > Public Function TestMethod() As Variant
> >     Dim udtTestData As TestUDT

> >     udtTestData.strDept = "TestDept"
> >     udtTestData.strName = "TestName"

> >     TestMethod = udtTestData
> > End Function

> > ASP code:

> > <%
> >    Dim objTest, udtData
> >    Set objTest = Server.CreateObject("VBUDTPrj.VBUDTObj")
> >    udtData = objTest.TestMethod()

> >    Response.Write( "Name = " & udtData.strName & "<BR>" )
> >    Response.Write( "Dept = " & udtData.strDept & "<BR>" )
> > %>

> > When I run the ASP without debugging into the VB Dll, the following
error
> > occurred:

> > Microsoft VBScript runtime error '800a01a8'
> > Object required

> > While with VB DLL de{*filter*} enabled, the same error as you mentioned
> > occurred:

> > Microsoft VBScript runtime error '800a0030'
> > Error Loading DLL: TestMethod

> > As my suggestion, please follow the workaround mentioned in the article
> > above to workaround the problem.

> > Regards,

> > This posting is provided "AS IS", with no warranties, and confers no
> > rights. Enjoyed ASP.NET? http://www.*-*-*.com/



Fri, 29 Oct 2004 21:48:26 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Problem with Code Profiler: Error loading DLL

2. Error Loading DLL problem

3. Error Loading DLL problem

4. Newbie: Strange Error - Now Can't Load Data Control

5. Newbie: Strange Error - Now Can't Load Data Control

6. Newbie: Strange Error - Now Can't Load Data Control

7. Error 3633: Can't load DLL MSJTER35.DLL

8. "Error in Loading DLL" conflicting DLLs

9. Calling external DLL gets error 48, unable to load DLL

10. Acc97 creating MDE receive Error In Loading DLL error

11. Run-time error 48 Error in loading DLL in XP

12. Error in loading DLL (Error 48)

 

 
Powered by phpBB® Forum Software