Sunday, January 20, 2008

No createable public component detected.ActiveX DLL Project Doubt - VB 6.0

Question:
No createable public component detected.
Press F1 for more information.

Answer:
In VB 6.0, ActiveXDLL Project needs atleast one public class module and its instancing property is set to be " 5 - MultiUse ".
If the property is set as " 1-Private " means you encountered by the above error message.

With regards,
Francis Michael.

Friday, January 11, 2008

How to check the check box "Allow service to interact with desktop" programatically in .Net

Question:
For a Windows Service How to check the check box "Allow service to interact with desktop" programatically using .Net

Solution:
Its little bit tricky to do this. To achieve this you must deal with Windows Registry of the Local machine where exactly the Service is running. Add the following code snippet and call before the service OnStart() Method. Thats all!

Microsoft.Win32.RegistryKey seviceKey = Microsoft.Win32.Registry.LocalMachine.OpenSubKey(@"SYSTEM\CurrentControlSet\Services\YourServiceName", true);
if (seviceKey != null)
{
if (seviceKey.GetValue("Type") != null)
seviceKey.SetValue("Type", ((int)seviceKey.GetValue("Type") | 256));
}


With regards,
Francis Michael.

Wednesday, January 9, 2008

Windows Service Installation Error:

Question:
Exception occurred while initializing the installation:

System.BadImageFormatException: The format of the file 'App_Name.exe' is inval
id..
Solution:

If you try to use the InstallUtil.exe lower than the .NET version you used. At that time you encountered with this Message.