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?
I have a few suspicions, though no definitive answers. You may want to check the following areas:
- Are all of the components ActiveX DLLs? It sounds like they are from your description, but you should check to insure that.
- 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.
var myObj=new ActiveXObject("myComponent.myInterface");
- If you are using VBScript, the syntax is different:
dim myObjset myObj=CreateObject("myComponent.myInterface")
- 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.