Author Topic: How to debug how an add-in DLL is called  (Read 2637 times)

Ian Mitchell

  • EA User
  • **
  • Posts: 506
  • Karma: +22/-4
  • The eaDocX and Model Expert guy
    • View Profile
How to debug how an add-in DLL is called
« on: February 15, 2022, 07:36:39 pm »
So here's a weird thing.
I have a very, very simple test addin, which is just a 'Hello world' screen. (not sure this is going to be a big seller...)

In the Visual Studio designer, it looks fine.
When it's called from a test .EXE file, it looks fine.
But when it's called from EA 15.2, it doesn't. Something to do with the UI themes, but that's buried in the UI framework i'm using. The main thing  is, the DLL behaves diffrently depending on who calls it.
Which shouldn't happen.
So does anyone know how I can look into the depths of Windows and see if there is a diference between how my test .EXE calls the DLL, and how EA does it?
Right now, I've taken everything out of the addin apart from a single menu, and a single menu handeller which puts up the Hello World form. And all this in a brand-new VS project.
Any help gratefull received. This is making me crazy....
Ian Mitchell, Designer, eaDocX


www.eaDocX.com
www.theartfulmodeller.com

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to debug how an add-in DLL is called
« Reply #1 on: February 15, 2022, 08:31:05 pm »
Ian, what do you mean when you say it doesn't look fine?

The difference might be that EA is calling your DLL based on the COM interop entry in the registry, while your text exe is probably calling your DLL directly.

So whatever dependencies to other frameworks (dll's) you are using should be available for EA (or the dll called by EA) as well.

Maybe it can't find those dependencies (make sure the files are in the same folder as your add-in dll used by EA, or even, as a test, try to copy them to the EA program files folder)
Is there maybe a problem with 64/32 bit? (EA 15 being 32 bit)

Geert

Ian Mitchell

  • EA User
  • **
  • Posts: 506
  • Karma: +22/-4
  • The eaDocX and Model Expert guy
    • View Profile
Re: How to debug how an add-in DLL is called
« Reply #2 on: February 15, 2022, 10:13:50 pm »
'not right' just means that the user interface settings (colors, shading etc) which get added by the UI framework are not being applied.  And I can't get a debuggable version of the problem to the supplier, because I can't replicate the probelm, other than by calling the DLL from EA. Which would mean then buying EA, wich they obviously won't do.

I'll try your ideas - I've sugested a 32/64 bit issue to the supplier, in case they have seen something similar.
...and I'll try making sure the dependent DLLs are in the same place as well. Com-Interop vs direct call also looks like a place to explore.

Thanks Geert.
Ian Mitchell, Designer, eaDocX


www.eaDocX.com
www.theartfulmodeller.com

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13404
  • Karma: +567/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to debug how an add-in DLL is called
« Reply #3 on: February 15, 2022, 10:16:57 pm »
Which would mean then buying EA, wich they obviously won't do.
Technically they should be able to reproduce the issue with the trial version as well, but I can imagine they are not really inclined to go that far...

Geert