June 3, 2000

Get the Command$ value from inside an ActiveX DLL

At times you may need to access the command line passed to the application from within an ActiveX DLL. Unfortunately, when inside a DLL the Command$ function returns a null string, so you have to resort to some API trickery: Private Declare Function GetCommandLine Lib “kernel32” Alias “GetCommandLineA” _ ()

Use Enums to restrict parameter values in Classes, ActiveX Controls and DLLs

By defining a Public Enum and using it as a parameter type to yourproperty or function, client applications are presented with a drop down list of values to use. Unfortunately, VB doesn’t restrict the client from passing something other than one of your enumerated values, since all Enums are Longs.

Using out-process components under IIS4

By default IIS 4 doesn’t permit to use the Server.CreateObject command with an out-process ActiveX EXE component. To do so, you must manually create the AllowOutOfProcCmpts registry value under the path HKEY_LOCAL_MACHINESYSTEMCurrentControlSetServicesW3SVCASPParameters, and set its value to 1. To restore the default, set the value to 0 or delete the

Testing a key in a PropertyBag without raising an error

When you pass a non-existing key to the WriteProperty method of the PropertyBag object you get an error 327 “Data value named ‘namekey‘ not found”. This is more or less the same error – albeit with a different error code – that you receive when you pass an non-existing key

Determine whether an ActiveX DLL is being used by an interpreted program

While determine whether the current program is running as interpreted or compiled code is relatively easy, determine whether an ActiveX DLL is serving an interpreted or compiled application is a bit more difficult. This information might be useful to disable or enable special features, or just to prevent from other

Avoid OnEndPage in ASP components under IIS 5

As explained elsewhere in this knowledge base, you are suggested not to rely on the OnStartPage method to get a reference to the main ASP objects, if your component is to be run under IIS 5. However, if you do run such a component under IIS 5, at least you

Ensure that server-side debugging is disabled in production sites

Before going to production, you should ensure that the server-side script debugging is off for your ASP application. In fact, not only does server-side debugging slow down your application, it also forces all ASP request to be served by the same thread. In other words, you don’t take advantage of

Determine whether the client program is in break mode

When an interpreted client running in the IDE enters debug (break) mode, all the ActiveX DLL it’s using continue to be in run mode as usual, even though you won’t notice it because the DLL will be inactive until the program invokes one of its methods. There are times, however,