Hello everyone, I've searched for an answer for this bug for a long time and finally decided to ask for help because none of the fixes people have suggested have worked so far. I'm getting the "Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))" error when trying to compile/run my program. This has recently happened because I bought a new computer which is 64 bit as opposed to my 32 bit computer where the project was originally created. I've seen a lot of people say to fix the error I must change my target CPU to x86, but I've already done that and I still receive the error. I have no idea what else to do, so any help is appreciated.
Just some background on the program, it references a Visual Basic 6 ocx file that was also compiled on a 32 bit computer, but I've recompiled it on this computer after fiddling around with some missing files that I had to install in the SysWOW64 folder. I remember the project on my old computer containing two references to this ocx:
AxTIHSocketLib
TIHSocketLib
Both these references gave me errors the first time I opened the project on this computer, and I have since then fixed the second one by changing the reference path. The first one however, was changed to "AxInterop.TIHSocketLib." I'm not sure why this happened, but the program seems fine with it being referenced that way to the point where I don't get a compile error. I'm not sure if this could be the cause of the error I'm asking about, so that's why I'm writing about it. I don't know how to change the name back to AxTIHSocketLib, or how I was able to reference it as that on my original computer.
COM Error on New Computer
Page 1 of 17 Replies - 1234 Views - Last Post: 08 July 2012 - 04:35 AM
Replies To: COM Error on New Computer
#2
Re: COM Error on New Computer
Posted 06 July 2012 - 07:29 PM
Did you run 'regsvr32 /i' or your Visual Basic 6 .OCX file? How about the other two referenced .OCX files: AxTIHSocketLib and TIBSocketLib?
#3
Re: COM Error on New Computer
Posted 07 July 2012 - 10:45 AM
I have registered the Visual Basic 6 file with regsvr32, but without the /i. Would the /i make a difference? And the other two files aren't ocx's, theyre .dll's Visual Studio created when I added the reference to the first ocx (named TIHSocketLib.ocx)
#4
Re: COM Error on New Computer
Posted 07 July 2012 - 11:00 AM
The "/i" is optional. I usually throw it in out of habit.
Sorry, I was under the impression that those two files were the missing files you had to install in the SysWOW64 directory. Did you regsvr32 the missing files that you had to install in the SysWOW64 directory?
When you try to run your program, and you get the exception, can you post the line of code that the exception is happening on?
Sorry, I was under the impression that those two files were the missing files you had to install in the SysWOW64 directory. Did you regsvr32 the missing files that you had to install in the SysWOW64 directory?
When you try to run your program, and you get the exception, can you post the line of code that the exception is happening on?
#5
Re: COM Error on New Computer
Posted 07 July 2012 - 12:50 PM
Yes I registered all the files that were missing. I'm not sure if I have to register them, but I didn't have to on my old computer. The error is happening when I try to create an instance of the socket, here:
Originally, I didn't need this line at all, but I thought it would help solve some of the problems. If I comment this out, the program will run until I try to manipulate the socket with the following error: Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown.
m_TIHCCOM is defined here:
I should also mention it is part of a form, and when trying to view the form through the IDE it gives me the same class not registered error from my original post.
m_TIHCCOM.CreateControl();
Originally, I didn't need this line at all, but I thought it would help solve some of the problems. If I comment this out, the program will run until I try to manipulate the socket with the following error: Exception of type 'System.Windows.Forms.AxHost+InvalidActiveXStateException' was thrown.
m_TIHCCOM is defined here:
public AxTIHSocketLib.AxTIHSocket m_TIHCCOM;
I should also mention it is part of a form, and when trying to view the form through the IDE it gives me the same class not registered error from my original post.
#6
Re: COM Error on New Computer
Posted 07 July 2012 - 02:51 PM
Just to double check, you said that you changed your target CPU to x86. Can you post your .csproj file?
#7
Re: COM Error on New Computer
Posted 07 July 2012 - 09:41 PM
Yeah sure.
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>9.0.30729</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{31898633-8AFA-4D59-AC51-6D5A73FAFE18}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Lighthouse</RootNamespace>
<AssemblyName>Lighthouse</AssemblyName>
<FileUpgradeFlags>
</FileUpgradeFlags>
<UpgradeBackupLocation>
</UpgradeBackupLocation>
<OldToolsVersion>3.5</OldToolsVersion>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<ManifestCertificateThumbprint>D939B0360DEFE480860F96D167BDFD3C7B10804D</ManifestCertificateThumbprint>
<ManifestKeyFile>Lighthouse_TemporaryKey.pfx</ManifestKeyFile>
<GenerateManifests>false</GenerateManifests>
<SignManifests>false</SignManifests>
<IsWebBootstrapper>false</IsWebBootstrapper>
<PublishUrl>C:\Documents and Settings\Kevin\Desktop\LH93233\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>2</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Current Build\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\Current Build\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet>
</PropertyGroup>
<PropertyGroup />
<PropertyGroup>
<TargetZone>LocalIntranet</TargetZone>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>
</ApplicationIcon>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Messaging" />
<Reference Include="System.Windows.Forms" />
</ItemGroup>
<ItemGroup>
<Compile Include="CallbackContainer.cs" />
<Compile Include="CCOMs.cs" />
<Compile Include="Forms\PanelIMOps.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\PanelIMOps.Designer.cs">
<DependentUpon>PanelIMOps.cs</DependentUpon>
</Compile>
<Compile Include="Forms\FormCCOMProperties.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\FormCCOMProperties.designer.cs">
<DependentUpon>FormCCOMProperties.cs</DependentUpon>
</Compile>
<Compile Include="IMCOMs.cs" />
<Compile Include="Oscar5\BanInfo.cs" />
<Compile Include="Oscar5\ChatInfo.cs" />
<Compile Include="Oscar5\FLAPSocket.cs" />
<Compile Include="Oscar5\FormProperties.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Oscar5\FormProperties.Designer.cs">
<DependentUpon>FormProperties.cs</DependentUpon>
</Compile>
<Compile Include="Oscar5\Oscar5.cs" />
<Compile Include="Oscar5\PacketBuilder.cs" />
<Compile Include="Oscar5\RateClass.cs" />
<Compile Include="Oscar5\RateCode.cs" />
<Compile Include="Oscar5\RateManager.cs" />
<Compile Include="Oscar5\RateState.cs" />
<Compile Include="Oscar5\SNACFlags.cs" />
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<Compile Include="Tools.cs" />
<Compile Include="Forms\PanelCCOMs.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\PanelCCOMs.Designer.cs">
<DependentUpon>PanelCCOMs.cs</DependentUpon>
</Compile>
<Compile Include="Forms\PanelConsole.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\PanelConsole.Designer.cs">
<DependentUpon>PanelConsole.cs</DependentUpon>
</Compile>
<Compile Include="Shared.cs" />
<Compile Include="Forms\LHPanel.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\LHPanel.Designer.cs">
<DependentUpon>LHPanel.cs</DependentUpon>
</Compile>
<Compile Include="CommandInfo.cs" />
<Compile Include="Forms\FormDefaultPerms.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\FormDefaultPerms.Designer.cs">
<DependentUpon>FormDefaultPerms.cs</DependentUpon>
</Compile>
<Compile Include="FormMain.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="FormMain.Designer.cs">
<DependentUpon>FormMain.cs</DependentUpon>
</Compile>
<Compile Include="MessageItem.cs" />
<Compile Include="Forms\PanelAutoban.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\PanelAutoban.Designer.cs">
<DependentUpon>PanelAutoban.cs</DependentUpon>
</Compile>
<Compile Include="Forms\PanelBansMisc.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\PanelBansMisc.Designer.cs">
<DependentUpon>PanelBansMisc.cs</DependentUpon>
</Compile>
<Compile Include="Forms\PanelImmunes.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\PanelImmunes.Designer.cs">
<DependentUpon>PanelImmunes.cs</DependentUpon>
</Compile>
<Compile Include="Forms\PanelOps.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\PanelOps.Designer.cs">
<DependentUpon>PanelOps.cs</DependentUpon>
</Compile>
<Compile Include="Forms\PanelExtra.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Forms\PanelExtra.Designer.cs">
<DependentUpon>PanelExtra.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<EmbeddedResource Include="Forms\PanelIMOps.resx">
<DependentUpon>PanelIMOps.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\FormCCOMProperties.resx">
<DependentUpon>FormCCOMProperties.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\FormDefaultPerms.resx">
<DependentUpon>FormDefaultPerms.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="FormMain.resx">
<SubType>Designer</SubType>
<DependentUpon>FormMain.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\LHPanel.resx">
<DependentUpon>LHPanel.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Oscar5\FormProperties.resx">
<DependentUpon>FormProperties.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\PanelAutoban.resx">
<DependentUpon>PanelAutoban.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\PanelBansMisc.resx">
<DependentUpon>PanelBansMisc.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\PanelCCOMs.resx">
<DependentUpon>PanelCCOMs.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\PanelConsole.resx">
<DependentUpon>PanelConsole.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\PanelImmunes.resx">
<DependentUpon>PanelImmunes.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\PanelOps.resx">
<DependentUpon>PanelOps.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Forms\PanelExtra.resx">
<DependentUpon>PanelExtra.cs</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<Compile Include="UserInfo.cs" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.2.0">
<Visible>False</Visible>
<ProductName>.NET Framework 2.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.0">
<Visible>False</Visible>
<ProductName>.NET Framework 3.0 %28x86%29</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.VisualBasic.PowerPacks.10.0">
<Visible>False</Visible>
<ProductName>Microsoft Visual Basic PowerPacks 10.0</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<ItemGroup>
<Content Include="Forms\lighthouse.ico" />
</ItemGroup>
<ItemGroup>
<COMReference Include="AxTIHSocketLib">
<Guid>{FBB93B4D-DB87-41A6-9B4E-5C056BD5EA28}</Guid>
<VersionMajor>8</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>aximp</WrapperTool>
<Isolated>False</Isolated>
</COMReference>
<COMReference Include="MSWinsockLib">
<Guid>{248DD890-BB45-11CF-9ABC-0080C7E7B78D}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
<COMReference Include="TIHSocketLib">
<Guid>{FBB93B4D-DB87-41A6-9B4E-5C056BD5EA28}</Guid>
<VersionMajor>8</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
<EmbedInteropTypes>True</EmbedInteropTypes>
</COMReference>
</ItemGroup>
<ItemGroup>
<WCFMetadata Include="Service References\" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
#8
Re: COM Error on New Computer
Posted 08 July 2012 - 04:35 AM
This error is a sign that the application cannot find a reference in registry database to the ocx file. When you registered the file, have you used Regsvr32 from SysWOW64 folder or the one from system32? (registering through Run command or cmd will use by default the one from System32. Write the entire path to Regsvr32 and use the one from SysWow64).
Also, you may want to check to see what registry wants your application to use for initialization of the class. The registry path could be wrong. To check this, use Procmon.exe , the tool from SysInternals. Download Process Monitor
Also, you may want to check to see what registry wants your application to use for initialization of the class. The registry path could be wrong. To check this, use Procmon.exe , the tool from SysInternals. Download Process Monitor
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote




|