devxlogo

Component Fails When Used Within ASP

Component Fails When Used Within ASP

Question:
I am working on system that is built from many pieces, but they all use certain common settings. I developed a simple ActiveX DLL that reads those settings from the registry. The system works nicely in Windows 95. It also works fine in Windows NT 4 when I use this DLL within some executable, but it fails in NT when I use this DLL within Active Server Pages, which are also part of my project. The object is initialized correctly, but as soon as I invoke a method that reads registry settings it fails. Why does this component behave differently within standard EXE and ASP?

Answer:
I have a few suspicions, though no definitive answers. You may want to check the following areas:

  1. Are all of the components ActiveX DLLs? It sounds like they are from your description, but you should check to insure that.
  2. How are you invoking the components? You should insure that you have both a program/project and a class ID (myComponent.myInterface) for your class.
  3. What are you using as your deployment language for ASP? Note that JavaScript does not have a CreateObject() function?it has an ActiveXObject() function instead, and must be preceded with a New keyword:
    var myObj=new ActiveXObject("myComponent.myInterface");
  4. If you are using VBScript, the syntax is different:
    dim myObjset myObj=CreateObject("myComponent.myInterface")
  5. The fact that your object is initializing correctly (although you should test that assertion thoroughly) makes me more inclined to suspect that the area may lie within the DLL you’re creating. Did you use Visual Basic for the control, or VC++ ATL? If the latter, you may want to check to make sure that you’re exposing the proper automation interfaces. Also, you may want to look carefully at which platforms you’re working on?especially with regard to the registry, Windows 9x and Windows NT have different API calls. This problem is made worse by a difference in calls between Windows NT3, NT4, and the beta on NT5.

Without knowing more particulars, I’d check those areas first.

See also  Professionalism Starts in Your Inbox: Keys to Presenting Your Best Self in Email
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist