Error in loading DLL 48 when using CreateInstance 
Author Message
 Error in loading DLL 48 when using CreateInstance

Hello,
    I have a situation that I cannot seem to find any references to on here
or MS.

    I have a system that was written over a year ago. The original objects
were backed up and saved. We are now trying to put this system back online
to review some data. Problem is we continue to get errors when it is run.
Error in loading DLL #48

    This system architecture is ASP front end, with COM+ Middle Tier written
in VB with a SQL Server 2K backend.

    I have the source code, and have setup a test box to see what is going
on.

    What I have found is this,

    I have an object and I dimension it ...

                Dim MyObj as MyApp.MyClass

                Set objdb = CtxCreateObject("MyApp.MyClass")

    Then I try to create an instance of this object. (Actually I call a
function that does this.

Public Function CtxCreateObject(ByVal sProgID As String) As Object
    Dim ctx As ObjectContext
    Set ctx = GetObjectContext

    If Not (ctx Is Nothing) Then
        Set CtxCreateObject = ctx.CreateInstance(sProgID)
        Set ctx = Nothing
    Else
        Set CtxCreateObject = CreateObject(sProgID)
    End If
End Function

    I call the function passing in the object name and class "MyApp.MyClass"

    The CreateInstance seems to work fine, the error occurs at the end
function. It seems that when the function try's to return the object I get
the error.

    Now I can bypass this by dimensioning the object as just an object and
things work fine. Problem is this code is working on several systems right
now, and I cant really change the code for this. They want to be running on
the original code to validate.

    Any idea's what could cause this error?

    This is running on a Windows 2000 Server with SP 3

    Any help is appreciated.

    Thanks
    Robert Barr



Mon, 12 Dec 2005 03:21:07 GMT  
 Error in loading DLL 48 when using CreateInstance
I had a typo below....

Should read

Dim MyObj as MyApp.MyClass

Set MyObj = CtxCreateObject("MyApp.MyClass")


Quote:
> Hello,
>     I have a situation that I cannot seem to find any references to on
here
> or MS.

>     I have a system that was written over a year ago. The original objects
> were backed up and saved. We are now trying to put this system back online
> to review some data. Problem is we continue to get errors when it is run.
> Error in loading DLL #48

>     This system architecture is ASP front end, with COM+ Middle Tier
written
> in VB with a SQL Server 2K backend.

>     I have the source code, and have setup a test box to see what is going
> on.

>     What I have found is this,

>     I have an object and I dimension it ...

>                 Dim MyObj as MyApp.MyClass

>                 Set objdb = CtxCreateObject("MyApp.MyClass")

>     Then I try to create an instance of this object. (Actually I call a
> function that does this.

> Public Function CtxCreateObject(ByVal sProgID As String) As Object
>     Dim ctx As ObjectContext
>     Set ctx = GetObjectContext

>     If Not (ctx Is Nothing) Then
>         Set CtxCreateObject = ctx.CreateInstance(sProgID)
>         Set ctx = Nothing
>     Else
>         Set CtxCreateObject = CreateObject(sProgID)
>     End If
> End Function

>     I call the function passing in the object name and class
"MyApp.MyClass"

>     The CreateInstance seems to work fine, the error occurs at the end
> function. It seems that when the function try's to return the object I get
> the error.

>     Now I can bypass this by dimensioning the object as just an object and
> things work fine. Problem is this code is working on several systems right
> now, and I cant really change the code for this. They want to be running
on
> the original code to validate.

>     Any idea's what could cause this error?

>     This is running on a Windows 2000 Server with SP 3

>     Any help is appreciated.

>     Thanks
>     Robert Barr



Mon, 12 Dec 2005 03:27:11 GMT  
 Error in loading DLL 48 when using CreateInstance
I think its problem with the "Set ctx = Nothing"

I am not sure but Should you destroy the context as you just created an
object within the context and then you destroy the context and continue
using the object?

--
Ashok Gupta - ashi
This posting is provided "AS IS" with no warranties, and confers no rights.

Quote:
> I had a typo below....

> Should read

> Dim MyObj as MyApp.MyClass

> Set MyObj = CtxCreateObject("MyApp.MyClass")



> > Hello,
> >     I have a situation that I cannot seem to find any references to on
> here
> > or MS.

> >     I have a system that was written over a year ago. The original
objects
> > were backed up and saved. We are now trying to put this system back
online
> > to review some data. Problem is we continue to get errors when it is
run.
> > Error in loading DLL #48

> >     This system architecture is ASP front end, with COM+ Middle Tier
> written
> > in VB with a SQL Server 2K backend.

> >     I have the source code, and have setup a test box to see what is
going
> > on.

> >     What I have found is this,

> >     I have an object and I dimension it ...

> >                 Dim MyObj as MyApp.MyClass

> >                 Set objdb = CtxCreateObject("MyApp.MyClass")

> >     Then I try to create an instance of this object. (Actually I call a
> > function that does this.

> > Public Function CtxCreateObject(ByVal sProgID As String) As Object
> >     Dim ctx As ObjectContext
> >     Set ctx = GetObjectContext

> >     If Not (ctx Is Nothing) Then
> >         Set CtxCreateObject = ctx.CreateInstance(sProgID)
> >         Set ctx = Nothing
> >     Else
> >         Set CtxCreateObject = CreateObject(sProgID)
> >     End If
> > End Function

> >     I call the function passing in the object name and class
> "MyApp.MyClass"

> >     The CreateInstance seems to work fine, the error occurs at the end
> > function. It seems that when the function try's to return the object I
get
> > the error.

> >     Now I can bypass this by dimensioning the object as just an object
and
> > things work fine. Problem is this code is working on several systems
right
> > now, and I cant really change the code for this. They want to be running
> on
> > the original code to validate.

> >     Any idea's what could cause this error?

> >     This is running on a Windows 2000 Server with SP 3

> >     Any help is appreciated.

> >     Thanks
> >     Robert Barr



Mon, 12 Dec 2005 16:33:47 GMT  
 Error in loading DLL 48 when using CreateInstance
OK, Found it...

Problem is, there had been a newer set of objects that had been put in com
on this server. Those objects were removed from COM and deleted from the
hard drive, but the registry still had a reference to them.

The issue is, most the code was working fine. It seems the error only
occurred when an object was dimensioned with early binding, then the
createinstance was using late binding. The assignment of that object back to
the early bound object was where the system got confused I think.

Anyway, regclean fixed it.

Thanks.


Quote:
> Hello,
>     I have a situation that I cannot seem to find any references to on
here
> or MS.

>     I have a system that was written over a year ago. The original objects
> were backed up and saved. We are now trying to put this system back online
> to review some data. Problem is we continue to get errors when it is run.
> Error in loading DLL #48

>     This system architecture is ASP front end, with COM+ Middle Tier
written
> in VB with a SQL Server 2K backend.

>     I have the source code, and have setup a test box to see what is going
> on.

>     What I have found is this,

>     I have an object and I dimension it ...

>                 Dim MyObj as MyApp.MyClass

>                 Set objdb = CtxCreateObject("MyApp.MyClass")

>     Then I try to create an instance of this object. (Actually I call a
> function that does this.

> Public Function CtxCreateObject(ByVal sProgID As String) As Object
>     Dim ctx As ObjectContext
>     Set ctx = GetObjectContext

>     If Not (ctx Is Nothing) Then
>         Set CtxCreateObject = ctx.CreateInstance(sProgID)
>         Set ctx = Nothing
>     Else
>         Set CtxCreateObject = CreateObject(sProgID)
>     End If
> End Function

>     I call the function passing in the object name and class
"MyApp.MyClass"

>     The CreateInstance seems to work fine, the error occurs at the end
> function. It seems that when the function try's to return the object I get
> the error.

>     Now I can bypass this by dimensioning the object as just an object and
> things work fine. Problem is this code is working on several systems right
> now, and I cant really change the code for this. They want to be running
on
> the original code to validate.

>     Any idea's what could cause this error?

>     This is running on a Windows 2000 Server with SP 3

>     Any help is appreciated.

>     Thanks
>     Robert Barr



Tue, 13 Dec 2005 02:19:05 GMT  
 
 [ 4 post ] 

 Relevant Pages 

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

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

3. Error in loading DLL (Error 48)

4. Error 48: Error Loading DLL

5. Error 48: Error in Loading DLL

6. Error 48: Error in loading Dll.

7. runtime error 48 error loading DLL

8. Error 48 - Error Load DLL

9. Error 48 - Error Loading DLL

10. Error Loading DLL:Error 48

11. Error 48 - Error Loading DLL

12. error loading dll error 48/protoview datatbl

 

 
Powered by phpBB® Forum Software