Click here to Skip to main content
15,889,335 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi experts,i need yr help guys,
I am converting vb application to vb.net 2005,

It generates lots of error,
i fixed the all error,
but still i am getting the problem,
at the time of form loading it gives the error,

ie
The type initializer for 'TimeandAttendanceSystem.Module1' threw an exception.

when i click on "View Detail"
{"The type initializer for 'TimeandAttendanceSystem.Module1' threw an exception."} - {"The type initializer for 'TimeandAttendanceSystem.Module1' threw an exception."}

Inner exception - {"Retrieving the COM class factory for component with CLSID {C58A8F87-CAA0-11D8-8486-0050BA8CA867} failed due to the following error: 80040154."}
Posted

abhishek1singh@rediffmail.com wrote:
Inner exception - {"Retrieving the COM class factory for component with CLSID {C58A8F87-CAA0-11D8-8486-0050BA8CA867} failed due to the following error: 80040154."}


This means you're using a COM component and it's either not registered, or it's failing to start.
 
Share this answer
 
If you have no idea what COM object to register, one has to wonder how you know what you're doing at all. It's your component, you are using it. You register it with regsvr32 followed by the path to the file, in the console window.

Adding a reference probably requires it to be registered, in which case, what you need is to read the documentation for the object, to see what you are doing wrong. Does this component have any sort of UI ? A clean conversion would have you replace this with your own code, VB6 just used COM objects a lot because it was rubbish.

you may also need to specify the threading model for the app in order to make it all work.
 
Share this answer
 
If you're using a random DLL and have no idea where it came from, then probably your only choice is to just ditch it and rewrite the functionality. It's possible in any case that it's expecting to create VB6 compatible forms and it's not working in a managed environment.
 
Share this answer
 
Thx for yr fast Reply,
Please tell me how can i register a com object,
By adding in reference?
& how i will get that which Com object i have to register
 
Share this answer
 
Thx for reply,
Actually This is not my project,
this was developed by my senior,
he was developed this project in vb 6.0,
my senior is not working with us,

from where i get "documentation for the object"
Please help
i am not understand how to remove all these error
 
Share this answer
 
Yes the components has UI,
i am adding all dll from the project-> Add reference-> then From Browse tab i add the all dll which is present in vb project,
& the 1st form is MDI parent,
When i click on any menu button ,it gives the same error

now tel me what i wil do?
 
Share this answer
 
& when i am trying to register a DLL from regsvr32 command,
Then it gives error msg
ie

"path\AxInterop.MSComCtl2.Dll was loaded,But the DllRegisterserver entry point was not found"

This file can not be registered.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900