Click here to Skip to main content
15,887,746 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I am building an application to read .mdd file using given code

C#
class Program
{
static void Main(string[] args)
{
    MDMLib.Document document = new Document();
    document.Open(@"D:\Sample.mdd", "", MDMLib.openConstants.oREAD);
    foreach (IMDMField field in document.Fields)
    {
        Console.WriteLine(field.Name);
    }
    Console.ReadLine();
}
}

but I am getting given error. In error source file is coming mscorlib

C#
Message :Retrieving the COM class factory for component with CLSID {432E4F73-87A8-4732-A98D-85CE5B500AD7} failed due to the following error: 80040154 Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).
Source :mscorlib
    StackTrace :   at System.RuntimeTypeHandle.CreateInstance(RuntimeType type, 
    Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck) at System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   at System.Activator.CreateInstance(Type type, Boolean nonPublic)
   at System.Activator.CreateInstance(Type type)
   at MDDTesting.Program.Main(String[] args) in D:\RebusCode\MDDTesting\MDDTesting\MDDTesting\Program.cs:line 14


What I have tried:

I have registered MDMLib.dll using regasm command but still getting this error.
Posted
Updated 15-Jun-17 2:54am

1 solution

Two possibilities:

1) You really didn't register MDMLib.dll. REGASM only works on .NET libraries. If this .DLL is not a .NET library, you use REGSVR32 on it instead.

2) One or more .DLL's MDMLib.dll depends on are not present and/or registered where MDMLib expects them.
 
Share this answer
 
Comments
neelamjain2012 16-Jun-17 6:20am    
Yes, you are right. after got to know I am trying to register with regsvr32.exe but I am getting this error "DLL was loaded but the entry point DllRegisterServer was not found"...can you please help me in this?
Dave Kreskowiak 16-Jun-17 10:08am    
That's because you're trying to register a non-COM-based .DLL. RegSvr32 will not work with library or .NET DLL's.

The best people to ask how to use that MDMLib.dll and what it's requirements are would be the people you got it from.

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