-
Server.CreateObject is unable to instantiate custom ActiveX DLL
I'm a newbie but experienced with VB. I created an ActiveX DLL using MS Foxpro.
The compiler generated 3 files: .dll, .olb, and, .vbr. I registered this
DLL using regsvr32 and it succeeded. At this point I was able to use CreateObject
within the test VB program; note: I did *not* have to add a Project Reference
to the DLL nor to the .old file.
Miscellaneous note: Within VB I could not set a reference to the .dll file
(error " cannot add reference to the specified file" popped up) but I was
able set a reference to the .olb file (Type library) and use the Object Browser.
Why did regsvr32 succeed whereas Vb could not register it?
Anyhow, the DLL works fine within the VB program despite the above misc.
note. My real problem is that I cannot Server.CreateObject to instantiate
my DLL within my ASP web application. Why? I also tried <object> and METADATA
and neither works; <object> triggers the Server.CreateObject method when
I try to call a method so I get the same error as when call Server.CreateObject
explicitly.
Can anyone please help me? Btw, I'm testing my ASP code on Personal Web Server
but will be later transfering to IIS 5. I'm editing using MS Visual Interdev
(Does it have the equivalent of the Vb editor's Project References menu option?)
Here is the log file(.vbr) generated when I compiled the DLL in Foxpro:
HKEY_CLASSES_ROOT\securkeyx.ggls =
HKEY_CLASSES_ROOT\securkeyx.ggls\NotInsertable
HKEY_CLASSES_ROOT\securkeyx.ggls\CLSID = {12411631-6BAC-11D5-801A-0048541E098D}
H4:27 PM 12/7/01KEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}
=
HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\ProgId = securkeyx.ggls
HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\VersionIndependentProgId
= securkeyx.ggls
HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\InProcServer32
= securkeyx.dll
HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\InProcServer32\"ThreadingModel"
= Apartment
HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\TypeLib =
{12411630-6BAC-11D5-801A-0048541E098D}
HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\Version =
1.0
HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D} = ggls
HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\ProxyStubClsid
= {00020424-0000-0000-C000-000000000046}
HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\ProxyStubClsid32
= {00020424-0000-0000-C000-000000000046}
HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\TypeLib
= {12411630-6BAC-11D5-801A-0048541E098D}
HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\TypeLib\"Version"
= 1.0
; TypeLibrary registration
HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}
HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0 = securkeyx
Type Library
HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0\0\win32
= securkeyx.tlb
HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0\FLAGS
= 0
-
Re: Server.CreateObject is unable to instantiate custom ActiveX DLL
Tom,
Regarding your first question (Why did regsvr32 succeed whereas Vb could
not register it?), posting it in the appropriate discussion forum might solicit
response.
With respect to your second question (error while using Server.CreateObject
to instantiate the component) you have not mentioned what error message you're
getting back. I'm assuming that you will be receiving the foll. error message
-
Server object error 'ASP 0177:80040154'
Server.CreateObject Failed
....
....
Server.CreateObject failed
This is one of the most common error that we will get while instantiating
ActiveX Components from ASP. This arises either because the control was not
registered properly or because of the security issues. In any case, please
refer this KB article for more information -
http://support.microsoft.com/support.../Q175/8/04.ASP
HTH,
Harish
"Tom Staresinic" <as488@ncf.ca> wrote:
>
>I'm a newbie but experienced with VB. I created an ActiveX DLL using MS
Foxpro.
>The compiler generated 3 files: .dll, .olb, and, .vbr. I registered this
>DLL using regsvr32 and it succeeded. At this point I was able to use CreateObject
> within the test VB program; note: I did *not* have to add a Project Reference
>to the DLL nor to the .old file.
>
>Miscellaneous note: Within VB I could not set a reference to the .dll file
>(error " cannot add reference to the specified file" popped up) but I was
>able set a reference to the .olb file (Type library) and use the Object
Browser.
>Why did regsvr32 succeed whereas Vb could not register it?
>
>Anyhow, the DLL works fine within the VB program despite the above misc.
>note. My real problem is that I cannot Server.CreateObject to instantiate
>my DLL within my ASP web application. Why? I also tried <object> and METADATA
>and neither works; <object> triggers the Server.CreateObject method when
>I try to call a method so I get the same error as when call Server.CreateObject
> explicitly.
>
>Can anyone please help me? Btw, I'm testing my ASP code on Personal Web
Server
>but will be later transfering to IIS 5. I'm editing using MS Visual Interdev
>(Does it have the equivalent of the Vb editor's Project References menu
option?)
>
>Here is the log file(.vbr) generated when I compiled the DLL in Foxpro:
>
>HKEY_CLASSES_ROOT\securkeyx.ggls =
>HKEY_CLASSES_ROOT\securkeyx.ggls\NotInsertable
>HKEY_CLASSES_ROOT\securkeyx.ggls\CLSID = {12411631-6BAC-11D5-801A-0048541E098D}
>H4:27 PM 12/7/01KEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}
>=
>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\ProgId =
securkeyx.ggls
>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\VersionIndependentProgId
>= securkeyx.ggls
>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\InProcServer32
>= securkeyx.dll
>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\InProcServer32\"ThreadingModel"
>= Apartment
>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\TypeLib =
>{12411630-6BAC-11D5-801A-0048541E098D}
>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\Version =
>1.0
>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D} = ggls
>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\ProxyStubClsid
>= {00020424-0000-0000-C000-000000000046}
>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\ProxyStubClsid32
>= {00020424-0000-0000-C000-000000000046}
>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\TypeLib
>= {12411630-6BAC-11D5-801A-0048541E098D}
>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\TypeLib\"Version"
>= 1.0
>
>
>; TypeLibrary registration
>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}
>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0 = securkeyx
>Type Library
>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0\0\win32
>= securkeyx.tlb
>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0\FLAGS
>= 0
>
>
-
Re: Server.CreateObject is unable to instantiate custom ActiveX DLL
Server.CreateObject works for my Foxpro-compiled DLL! Actually it worked before
*BUT* the real problem was/is that it locks the DLL so if I refresh the page
(i.e. call Server.CreateObject again) it fails! It only releases the DLL
if I reboot the computer. Why does it not release the DLL? When the script
variable which holds the reference to the instantiated DLL looses scope (or
if it is assigned a different value-- for eg: set o = Nothing), shouldn't
the DLL object in memory automatically be released (garbage collected)?
BTW, I compiled the DLL as "multi-threaded COM server (dll)". the pther 2
compile options are "single-threaded COM server (dll)" and "win32 executable
/ COM server(exe)". What's the difference between these?
"Harish Kumar" <Harish@ChildDuniya.Com> wrote:
>
>Tom,
>
>Regarding your first question (Why did regsvr32 succeed whereas Vb could
>not register it?), posting it in the appropriate discussion forum might
solicit
>response.
>
>With respect to your second question (error while using Server.CreateObject
>to instantiate the component) you have not mentioned what error message
you're
>getting back. I'm assuming that you will be receiving the foll. error message
>-
>
>Server object error 'ASP 0177:80040154'
>Server.CreateObject Failed
>....
>....
>Server.CreateObject failed
>
>This is one of the most common error that we will get while instantiating
>ActiveX Components from ASP. This arises either because the control was
not
>registered properly or because of the security issues. In any case, please
>refer this KB article for more information -
>
>http://support.microsoft.com/support.../Q175/8/04.ASP
>
>HTH,
>Harish
>
>"Tom Staresinic" <as488@ncf.ca> wrote:
>>
>>I'm a newbie but experienced with VB. I created an ActiveX DLL using MS
>Foxpro.
>>The compiler generated 3 files: .dll, .olb, and, .vbr. I registered this
>>DLL using regsvr32 and it succeeded. At this point I was able to use CreateObject
>> within the test VB program; note: I did *not* have to add a Project Reference
>>to the DLL nor to the .old file.
>>
>>Miscellaneous note: Within VB I could not set a reference to the .dll file
>>(error " cannot add reference to the specified file" popped up) but I
was
>>able set a reference to the .olb file (Type library) and use the Object
>Browser.
>>Why did regsvr32 succeed whereas Vb could not register it?
>>
>>Anyhow, the DLL works fine within the VB program despite the above misc.
>>note. My real problem is that I cannot Server.CreateObject to instantiate
>>my DLL within my ASP web application. Why? I also tried <object> and METADATA
>>and neither works; <object> triggers the Server.CreateObject method when
>>I try to call a method so I get the same error as when call Server.CreateObject
>> explicitly.
>>
>>Can anyone please help me? Btw, I'm testing my ASP code on Personal Web
>Server
>>but will be later transfering to IIS 5. I'm editing using MS Visual Interdev
>>(Does it have the equivalent of the Vb editor's Project References menu
>option?)
>>
>>Here is the log file(.vbr) generated when I compiled the DLL in Foxpro:
>>
>>HKEY_CLASSES_ROOT\securkeyx.ggls =
>>HKEY_CLASSES_ROOT\securkeyx.ggls\NotInsertable
>>HKEY_CLASSES_ROOT\securkeyx.ggls\CLSID = {12411631-6BAC-11D5-801A-0048541E098D}
>>H4:27 PM 12/7/01KEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}
>>=
>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\ProgId =
>securkeyx.ggls
>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\VersionIndependentProgId
>>= securkeyx.ggls
>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\InProcServer32
>>= securkeyx.dll
>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\InProcServer32\"ThreadingModel"
>>= Apartment
>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\TypeLib
=
>>{12411630-6BAC-11D5-801A-0048541E098D}
>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\Version
=
>>1.0
>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D} = ggls
>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\ProxyStubClsid
>>= {00020424-0000-0000-C000-000000000046}
>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\ProxyStubClsid32
>>= {00020424-0000-0000-C000-000000000046}
>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\TypeLib
>>= {12411630-6BAC-11D5-801A-0048541E098D}
>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\TypeLib\"Version"
>>= 1.0
>>
>>
>>; TypeLibrary registration
>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}
>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0 =
securkeyx
>>Type Library
>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0\0\win32
>>= securkeyx.tlb
>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0\FLAGS
>>= 0
>>
>>
>
-
Re: Server.CreateObject is unable to instantiate custom ActiveX DLL
You had written that Server.CreateObject fails when you refresh the page.
Exactly what error you're getting back?
And if you register the DLL with Microsoft Transaction Server, it will have
the instance of that DLL open. So you need to explicitly stop the MTS and
re-start it again for the instance to get killed completely. However, you
can overcome this if you set up the application in its own memory space.
But I'm not sure as to what exactly you're trying to do here.
Harish
"Tom Staresinic" <as488@ncf.ca> wrote:
>
>Server.CreateObject works for my Foxpro-compiled DLL! Actually it worked
before
>*BUT* the real problem was/is that it locks the DLL so if I refresh the
page
>(i.e. call Server.CreateObject again) it fails! It only releases the DLL
>if I reboot the computer. Why does it not release the DLL? When the script
>variable which holds the reference to the instantiated DLL looses scope
(or
>if it is assigned a different value-- for eg: set o = Nothing), shouldn't
>the DLL object in memory automatically be released (garbage collected)?
>
>BTW, I compiled the DLL as "multi-threaded COM server (dll)". the pther
2
>compile options are "single-threaded COM server (dll)" and "win32 executable
>/ COM server(exe)". What's the difference between these?
>
>"Harish Kumar" <Harish@ChildDuniya.Com> wrote:
>>
>>Tom,
>>
>>Regarding your first question (Why did regsvr32 succeed whereas Vb could
>>not register it?), posting it in the appropriate discussion forum might
>solicit
>>response.
>>
>>With respect to your second question (error while using Server.CreateObject
>>to instantiate the component) you have not mentioned what error message
>you're
>>getting back. I'm assuming that you will be receiving the foll. error message
>>-
>>
>>Server object error 'ASP 0177:80040154'
>>Server.CreateObject Failed
>>....
>>....
>>Server.CreateObject failed
>>
>>This is one of the most common error that we will get while instantiating
>>ActiveX Components from ASP. This arises either because the control was
>not
>>registered properly or because of the security issues. In any case, please
>>refer this KB article for more information -
>>
>>http://support.microsoft.com/support.../Q175/8/04.ASP
>>
>>HTH,
>>Harish
>>
>>"Tom Staresinic" <as488@ncf.ca> wrote:
>>>
>>>I'm a newbie but experienced with VB. I created an ActiveX DLL using MS
>>Foxpro.
>>>The compiler generated 3 files: .dll, .olb, and, .vbr. I registered this
>>>DLL using regsvr32 and it succeeded. At this point I was able to use CreateObject
>>> within the test VB program; note: I did *not* have to add a Project Reference
>>>to the DLL nor to the .old file.
>>>
>>>Miscellaneous note: Within VB I could not set a reference to the .dll
file
>>>(error " cannot add reference to the specified file" popped up) but I
>was
>>>able set a reference to the .olb file (Type library) and use the Object
>>Browser.
>>>Why did regsvr32 succeed whereas Vb could not register it?
>>>
>>>Anyhow, the DLL works fine within the VB program despite the above misc.
>>>note. My real problem is that I cannot Server.CreateObject to instantiate
>>>my DLL within my ASP web application. Why? I also tried <object> and METADATA
>>>and neither works; <object> triggers the Server.CreateObject method when
>>>I try to call a method so I get the same error as when call Server.CreateObject
>>> explicitly.
>>>
>>>Can anyone please help me? Btw, I'm testing my ASP code on Personal Web
>>Server
>>>but will be later transfering to IIS 5. I'm editing using MS Visual Interdev
>>>(Does it have the equivalent of the Vb editor's Project References menu
>>option?)
>>>
>>>Here is the log file(.vbr) generated when I compiled the DLL in Foxpro:
>>>
>>>HKEY_CLASSES_ROOT\securkeyx.ggls =
>>>HKEY_CLASSES_ROOT\securkeyx.ggls\NotInsertable
>>>HKEY_CLASSES_ROOT\securkeyx.ggls\CLSID = {12411631-6BAC-11D5-801A-0048541E098D}
>>>H4:27 PM 12/7/01KEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}
>>>=
>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\ProgId
=
>>securkeyx.ggls
>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\VersionIndependentProgId
>>>= securkeyx.ggls
>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\InProcServer32
>>>= securkeyx.dll
>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\InProcServer32\"ThreadingModel"
>>>= Apartment
>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\TypeLib
>=
>>>{12411630-6BAC-11D5-801A-0048541E098D}
>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\Version
>=
>>>1.0
>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D} = ggls
>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\ProxyStubClsid
>>>= {00020424-0000-0000-C000-000000000046}
>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\ProxyStubClsid32
>>>= {00020424-0000-0000-C000-000000000046}
>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\TypeLib
>>>= {12411630-6BAC-11D5-801A-0048541E098D}
>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\TypeLib\"Version"
>>>= 1.0
>>>
>>>
>>>; TypeLibrary registration
>>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}
>>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0 =
>securkeyx
>>>Type Library
>>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0\0\win32
>>>= securkeyx.tlb
>>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0\FLAGS
>>>= 0
>>>
>>>
>>
>
-
Re: Server.CreateObject is unable to instantiate custom ActiveX DLL
The eror I get is:
myvbdlltest error '80004005'
Automation error
/testdll/TEST/XDLLTEST/TOMTEST3b.ASP, line 4
Actually i can refresh the page when I use a simple DLL. But when the DLL
instantiates a simple object- 1 property and 1 method-- within it (and the
reference to this object is a public property of the internally instantiated
object) is when the above error occurs.
Do I have to use MTS ? How do I do this? Just put in this one line?:
<%@Transaction=Required%>
Dos tis ensure that the DLL is released when the refernece variable loses
focus?
DO i have to use objectcontext.setcomplete and objectcontext.setabort?
"Harish Kumar" <Harish@ChildDuniya.Com> wrote:
>
>You had written that Server.CreateObject fails when you refresh the page.
>Exactly what error you're getting back?
>
>And if you register the DLL with Microsoft Transaction Server, it will have
>the instance of that DLL open. So you need to explicitly stop the MTS and
>re-start it again for the instance to get killed completely. However, you
>can overcome this if you set up the application in its own memory space.
>But I'm not sure as to what exactly you're trying to do here.
>
>Harish
>
>"Tom Staresinic" <as488@ncf.ca> wrote:
>>
>>Server.CreateObject works for my Foxpro-compiled DLL! Actually it worked
>before
>>*BUT* the real problem was/is that it locks the DLL so if I refresh the
>page
>>(i.e. call Server.CreateObject again) it fails! It only releases the DLL
>>if I reboot the computer. Why does it not release the DLL? When the script
>>variable which holds the reference to the instantiated DLL looses scope
>(or
>>if it is assigned a different value-- for eg: set o = Nothing), shouldn't
>>the DLL object in memory automatically be released (garbage collected)?
>>
>>BTW, I compiled the DLL as "multi-threaded COM server (dll)". the pther
>2
>>compile options are "single-threaded COM server (dll)" and "win32 executable
>>/ COM server(exe)". What's the difference between these?
>>
>>"Harish Kumar" <Harish@ChildDuniya.Com> wrote:
>>>
>>>Tom,
>>>
>>>Regarding your first question (Why did regsvr32 succeed whereas Vb could
>>>not register it?), posting it in the appropriate discussion forum might
>>solicit
>>>response.
>>>
>>>With respect to your second question (error while using Server.CreateObject
>>>to instantiate the component) you have not mentioned what error message
>>you're
>>>getting back. I'm assuming that you will be receiving the foll. error
message
>>>-
>>>
>>>Server object error 'ASP 0177:80040154'
>>>Server.CreateObject Failed
>>>....
>>>....
>>>Server.CreateObject failed
>>>
>>>This is one of the most common error that we will get while instantiating
>>>ActiveX Components from ASP. This arises either because the control was
>>not
>>>registered properly or because of the security issues. In any case, please
>>>refer this KB article for more information -
>>>
>>>http://support.microsoft.com/support.../Q175/8/04.ASP
>>>
>>>HTH,
>>>Harish
>>>
>>>"Tom Staresinic" <as488@ncf.ca> wrote:
>>>>
>>>>I'm a newbie but experienced with VB. I created an ActiveX DLL using
MS
>>>Foxpro.
>>>>The compiler generated 3 files: .dll, .olb, and, .vbr. I registered this
>>>>DLL using regsvr32 and it succeeded. At this point I was able to use
CreateObject
>>>> within the test VB program; note: I did *not* have to add a Project
Reference
>>>>to the DLL nor to the .old file.
>>>>
>>>>Miscellaneous note: Within VB I could not set a reference to the .dll
>file
>>>>(error " cannot add reference to the specified file" popped up) but
I
>>was
>>>>able set a reference to the .olb file (Type library) and use the Object
>>>Browser.
>>>>Why did regsvr32 succeed whereas Vb could not register it?
>>>>
>>>>Anyhow, the DLL works fine within the VB program despite the above misc.
>>>>note. My real problem is that I cannot Server.CreateObject to instantiate
>>>>my DLL within my ASP web application. Why? I also tried <object> and
METADATA
>>>>and neither works; <object> triggers the Server.CreateObject method
when
>>>>I try to call a method so I get the same error as when call Server.CreateObject
>>>> explicitly.
>>>>
>>>>Can anyone please help me? Btw, I'm testing my ASP code on Personal Web
>>>Server
>>>>but will be later transfering to IIS 5. I'm editing using MS Visual Interdev
>>>>(Does it have the equivalent of the Vb editor's Project References menu
>>>option?)
>>>>
>>>>Here is the log file(.vbr) generated when I compiled the DLL in Foxpro:
>>>>
>>>>HKEY_CLASSES_ROOT\securkeyx.ggls =
>>>>HKEY_CLASSES_ROOT\securkeyx.ggls\NotInsertable
>>>>HKEY_CLASSES_ROOT\securkeyx.ggls\CLSID = {12411631-6BAC-11D5-801A-0048541E098D}
>>>>H4:27 PM 12/7/01KEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}
>>>>=
>>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\ProgId
>=
>>>securkeyx.ggls
>>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\VersionIndependentProgId
>>>>= securkeyx.ggls
>>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\InProcServer32
>>>>= securkeyx.dll
>>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\InProcServer32\"ThreadingModel"
>>>>= Apartment
>>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\TypeLib
>>=
>>>>{12411630-6BAC-11D5-801A-0048541E098D}
>>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\Version
>>=
>>>>1.0
>>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D} =
ggls
>>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\ProxyStubClsid
>>>>= {00020424-0000-0000-C000-000000000046}
>>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\ProxyStubClsid32
>>>>= {00020424-0000-0000-C000-000000000046}
>>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\TypeLib
>>>>= {12411630-6BAC-11D5-801A-0048541E098D}
>>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\TypeLib\"Version"
>>>>= 1.0
>>>>
>>>>
>>>>; TypeLibrary registration
>>>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}
>>>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0
=
>>securkeyx
>>>>Type Library
>>>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0\0\win32
>>>>= securkeyx.tlb
>>>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0\FLAGS
>>>>= 0
>>>>
>>>>
>>>
>>
>
-
Re: Server.CreateObject is unable to instantiate custom ActiveX DLL
I have found a line of code in my FOxpro DLL which is causing the error. FOr
those who know FOxpro, the command is 'SET CLASSLIB'. In FOxpro you can use
CreateObject() in 2 ways to instantiate FOxpro classes: 1) using the compiled
COM object registered in the WIndows registry (the same syntax as instantiating
a DLL in ASP), or 2) 'opening' a FOxpro class library file and then instantiating
any of the class definitions within that library (analogous to 'New' comand
in Visual BAsic).
In ASP, only the first option above works. But it means that I have to register
every 'nested' object within my Foxpro DLL as a separate COM object.
"Tom Staresinic" <as488@ncf.ca> wrote:
>
>The eror I get is:
>myvbdlltest error '80004005'
>Automation error
>/testdll/TEST/XDLLTEST/TOMTEST3b.ASP, line 4
>
>Actually i can refresh the page when I use a simple DLL. But when the DLL
>instantiates a simple object- 1 property and 1 method-- within it (and the
>reference to this object is a public property of the internally instantiated
>object) is when the above error occurs.
>
>Do I have to use MTS ? How do I do this? Just put in this one line?:
><%@Transaction=Required%>
>Dos tis ensure that the DLL is released when the refernece variable loses
>focus?
>DO i have to use objectcontext.setcomplete and objectcontext.setabort?
>
>
>"Harish Kumar" <Harish@ChildDuniya.Com> wrote:
>>
>>You had written that Server.CreateObject fails when you refresh the page.
>>Exactly what error you're getting back?
>>
>>And if you register the DLL with Microsoft Transaction Server, it will
have
>>the instance of that DLL open. So you need to explicitly stop the MTS and
>>re-start it again for the instance to get killed completely. However, you
>>can overcome this if you set up the application in its own memory space.
>>But I'm not sure as to what exactly you're trying to do here.
>>
>>Harish
>>
>>"Tom Staresinic" <as488@ncf.ca> wrote:
>>>
>>>Server.CreateObject works for my Foxpro-compiled DLL! Actually it worked
>>before
>>>*BUT* the real problem was/is that it locks the DLL so if I refresh the
>>page
>>>(i.e. call Server.CreateObject again) it fails! It only releases the DLL
>>>if I reboot the computer. Why does it not release the DLL? When the script
>>>variable which holds the reference to the instantiated DLL looses scope
>>(or
>>>if it is assigned a different value-- for eg: set o = Nothing), shouldn't
>>>the DLL object in memory automatically be released (garbage collected)?
>>>
>>>BTW, I compiled the DLL as "multi-threaded COM server (dll)". the pther
>>2
>>>compile options are "single-threaded COM server (dll)" and "win32 executable
>>>/ COM server(exe)". What's the difference between these?
>>>
>>>"Harish Kumar" <Harish@ChildDuniya.Com> wrote:
>>>>
>>>>Tom,
>>>>
>>>>Regarding your first question (Why did regsvr32 succeed whereas Vb could
>>>>not register it?), posting it in the appropriate discussion forum might
>>>solicit
>>>>response.
>>>>
>>>>With respect to your second question (error while using Server.CreateObject
>>>>to instantiate the component) you have not mentioned what error message
>>>you're
>>>>getting back. I'm assuming that you will be receiving the foll. error
>message
>>>>-
>>>>
>>>>Server object error 'ASP 0177:80040154'
>>>>Server.CreateObject Failed
>>>>....
>>>>....
>>>>Server.CreateObject failed
>>>>
>>>>This is one of the most common error that we will get while instantiating
>>>>ActiveX Components from ASP. This arises either because the control was
>>>not
>>>>registered properly or because of the security issues. In any case, please
>>>>refer this KB article for more information -
>>>>
>>>>http://support.microsoft.com/support.../Q175/8/04.ASP
>>>>
>>>>HTH,
>>>>Harish
>>>>
>>>>"Tom Staresinic" <as488@ncf.ca> wrote:
>>>>>
>>>>>I'm a newbie but experienced with VB. I created an ActiveX DLL using
>MS
>>>>Foxpro.
>>>>>The compiler generated 3 files: .dll, .olb, and, .vbr. I registered
this
>>>>>DLL using regsvr32 and it succeeded. At this point I was able to use
>CreateObject
>>>>> within the test VB program; note: I did *not* have to add a Project
>Reference
>>>>>to the DLL nor to the .old file.
>>>>>
>>>>>Miscellaneous note: Within VB I could not set a reference to the .dll
>>file
>>>>>(error " cannot add reference to the specified file" popped up) but
>I
>>>was
>>>>>able set a reference to the .olb file (Type library) and use the Object
>>>>Browser.
>>>>>Why did regsvr32 succeed whereas Vb could not register it?
>>>>>
>>>>>Anyhow, the DLL works fine within the VB program despite the above misc.
>>>>>note. My real problem is that I cannot Server.CreateObject to instantiate
>>>>>my DLL within my ASP web application. Why? I also tried <object> and
>METADATA
>>>>>and neither works; <object> triggers the Server.CreateObject method
>when
>>>>>I try to call a method so I get the same error as when call Server.CreateObject
>>>>> explicitly.
>>>>>
>>>>>Can anyone please help me? Btw, I'm testing my ASP code on Personal
Web
>>>>Server
>>>>>but will be later transfering to IIS 5. I'm editing using MS Visual
Interdev
>>>>>(Does it have the equivalent of the Vb editor's Project References menu
>>>>option?)
>>>>>
>>>>>Here is the log file(.vbr) generated when I compiled the DLL in Foxpro:
>>>>>
>>>>>HKEY_CLASSES_ROOT\securkeyx.ggls =
>>>>>HKEY_CLASSES_ROOT\securkeyx.ggls\NotInsertable
>>>>>HKEY_CLASSES_ROOT\securkeyx.ggls\CLSID = {12411631-6BAC-11D5-801A-0048541E098D}
>>>>>H4:27 PM 12/7/01KEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}
>>>>>=
>>>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\ProgId
>>=
>>>>securkeyx.ggls
>>>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\VersionIndependentProgId
>>>>>= securkeyx.ggls
>>>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\InProcServer32
>>>>>= securkeyx.dll
>>>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\InProcServer32\"ThreadingModel"
>>>>>= Apartment
>>>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\TypeLib
>>>=
>>>>>{12411630-6BAC-11D5-801A-0048541E098D}
>>>>>HKEY_CLASSES_ROOT\CLSID\{12411631-6BAC-11D5-801A-0048541E098D}\Version
>>>=
>>>>>1.0
>>>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D} =
>ggls
>>>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\ProxyStubClsid
>>>>>= {00020424-0000-0000-C000-000000000046}
>>>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\ProxyStubClsid32
>>>>>= {00020424-0000-0000-C000-000000000046}
>>>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\TypeLib
>>>>>= {12411630-6BAC-11D5-801A-0048541E098D}
>>>>>HKEY_CLASSES_ROOT\INTERFACE\{12411632-6BAC-11D5-801A-0048541E098D}\TypeLib\"Version"
>>>>>= 1.0
>>>>>
>>>>>
>>>>>; TypeLibrary registration
>>>>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}
>>>>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0
>=
>>>securkeyx
>>>>>Type Library
>>>>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0\0\win32
>>>>>= securkeyx.tlb
>>>>>HKEY_CLASSES_ROOT\TypeLib\{12411630-6BAC-11D5-801A-0048541E098D}\1.0\FLAGS
>>>>>= 0
>>>>>
>>>>>
>>>>
>>>
>>
>
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Development Centers
-- Android Development Center
-- Cloud Development Project Center
-- HTML5 Development Center
-- Windows Mobile Development Center
|