Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: DHTML
Expertise: Beginner
Jan 26, 1999

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 myObj
    set 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.
DevX Pro
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date