C# windows form error: COM class retrieving failed

All topics on coding 4Dscript in Enterprise Dynamics.
Post Reply
LAC-Bursi
Posts: 41
Joined: Friday 09 November, 2012 - 10:37

C# windows form error: COM class retrieving failed

Post by LAC-Bursi »

Hello community,

I'm developing a project in which I have to open Enterprise Dynamics 9 from a windows form written in C# language and developed on Visual Studio 2012 environment.

Should I distribute this project to other PCs in which the ED license is installed, but not Visual Studio 2012.

Have you some suggestions how to solve this issue?

If I try to run the project on a machine without Visual Studio, this error occurs:
"Retrieving the COM Class Factory for Component with CLSID {XXX} failed due to the following error: 80040154."

Best Regards
Thanks
Fabio
User avatar
MatthijsJongboer
Posts: 200
Joined: Thursday 11 November, 2010 - 14:12

Re: C# windows form error: COM class retrieving failed

Post by MatthijsJongboer »

Hello Fabio,
I'm not sure what the cause for this problem is.
First make sure you run Enterprise Dynamics 9 with elevated administrative rights once (per user account) since Enterprise Dynamics 9 is a self registering COM server. This means other applications can locate and start it.
If that is already done, check your dependencies of your C# project. Also make sure your target platform is X86.

Regards, Matthijs
LAC-Bursi
Posts: 41
Joined: Friday 09 November, 2012 - 10:37

Re: C# windows form error: COM class retrieving failed

Post by LAC-Bursi »

Hello Matthijs,

You got it!!!! :D :D :D

The problem was that the target machines don't have the administrative rights on my project and they aren't able to run it.

add in the app.manifest this instruction:

Code: Select all

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />
and now it works well.

Thanks for your support
Fabio
LAC-Bursi
Posts: 41
Joined: Friday 09 November, 2012 - 10:37

Re: C# windows form error: COM class retrieving failed

Post by LAC-Bursi »

Hello Matthijs,

Your solution works well for some target machines, but not for all.

I need to register EDDev.exe (I mean the ActiveX object) on the target machine.

I try to execute regsvr32 EDDev.exe but returns this error:

Code: Select all

The module "EDDev.exe" waas loaded but entry-point DllRefisterServer was not found. Make sure that "EDDev.exe" is a valid DLL or OCX file and then try again
How can I resolve this issue?

Thanks
Fabio
User avatar
MatthijsJongboer
Posts: 200
Joined: Thursday 11 November, 2010 - 14:12

Re: C# windows form error: COM class retrieving failed

Post by MatthijsJongboer »

Hello Fabio,

Unfortunately, it is not possible to use regsvr32 since the executable is not a component that can be registered this way.
Execution once with elevated administrative rights is the only option.

Regards,
Matthijs
Post Reply