Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - bakawakalaka

Pages: [1]
1
Automation Interface, Add-Ins and Tools / How to sotring attributies
« on: June 10, 2019, 07:54:34 pm »
Hello,
I have object where I create some attributes. At first its look like that(see picture).

All atributes sorted in Class:Features view by Pos colomn in t_attributes(sorting like 1,2... except 0 that always last) and it looks different in treeview(Project Browser).
When I try to move one attribute I see message that notified me that sorting be reseted and I can change it in tools.

Then attributes sort same as in treeview.
Where I can find recod in .eap tables that contains information about attributes sorting in object?

2
Hi, I created Add-in that show form with some data. I want this form shown in the center of EA winodws, but I can't find any information of how to do it. Is there any way to do so?

3
Ah, it's probably the PutDiagramImageToFile(). That one requires EA to open the diagram.
You can avoid that by using an XMI export I believe. Package.exportToXMI() has parameter to include diagrams.
If you set that to true it will export the images of all diagrams in the package to separate image files.

Geert

PS. Why are you using your own connection to query the database? I always just use Repository.SQLQuery()

Am I right that you mean Proect.ExportPackageXMIEx()? I tried it. it's still steals focus but less than before(and works much faster!). Maybe if I'll not found something better(I think about using global hook now) I stay on this solution

I'm using LinqToDB. It's much easer then parsing data from xml.

4
Do you know what exactly you are doing when the focus is stolen?

I'm not saying I never saw this type of behavior, but is has never been an issue for me.
Feels like you must be doing something I'm not.

Geert

Well, this is source code part that I'm using (whatever if I using it in async method in winform or just in main in console). It's a messy but it reproduce problem when I save ~400 images. it have a little hack - I reopen eap file because Interop.EA library can just throw HRESULT: 0x80010105 (RPC_E_SERVERFAULT) error.

Code: [Select]
            List<string> diagrams;
            using (var con = new OleDbConnection(str))
            {
                con.Open();
                var diaobjects = con.Query<t_diagramobjects>(SQLQueries.GetDiagramObject).Select(q => q.Diagram_ID)
                    .Distinct().Except(new int[] { 0 }).ToList();
                diagrams = con.Query<t_diagram>(SQLQueries.GetDiagram)
                   .Where(q => diaobjects.Contains(q.Diagram_ID))
                   .Select(q => q.ea_guid).ToList();
            }

            int i = 0;
            EA.Repository rre;
            EA.Project interf;

            rre = new EA.Repository();
            rre.OpenFile(patch_to_eap_file);
            interf = rre.GetProjectInterface();
            foreach (var dia in diagrams)
            {
                var tmpPath = ($"{imgDirPath}{dia}.png");
                interf.PutDiagramImageToFile(dia, tmpPath, 1);
                Console.WriteLine($"{i}" + tmpPath);

                if (i == 50)
                {
                    rre.CloseFile();
                    rre.Exit();
                    GC.Collect();
                    GC.WaitForPendingFinalizers();
                    i = 0;
                    rre = new EA.Repository();
                    rre.OpenFile(patch_to_eap_file);
                    interf = rre.GetProjectInterface();
                }
                i++;
            }

            rre.CloseFile();
            rre.Exit();
            GC.Collect();
            GC.WaitForPendingFinalizers();

            Console.WriteLine("end");
            Console.Read();

5
Hi, I'm trying to create add-in (using c# with winforms) whith two forms (settings form and progress form) that just Save all daigram images in .eap file to directory. I do it using multithreading.
This is especially annoying when I'm starting an EA, open my Add-in, start save images, switch to do something else (for example write in outlook) and then somehow I lost focus. I'm trying set ShowWithoutActivation field to true, Focused field to false on the forms but its don't work.
It's just when I using EA classes from Interop.dll. I tried example when I'm removed all code that using EA.Interop in my "SaveImagesAsync" method  and added Thread.Sleep() for pretend work in add-in and then focus is not stealing! Then I created ConsoleApplication that just do work of my add-in (save all images from .eap file) and then focus is stealing!

Had anyone this problem? How I can solve this?

6
No idea. Did you look into https://stackoverflow.com/questions/973206/hresult-0x80010105-rpc-e-serverfault-question?

Yes, I did. I even did simular question on stackoverflow but there told me that it can be specific for current library and I need to contact the developers.

7
Sometimes when I using Interop.EA.dll I got this error:

(Exception from HRESULT: 0x80010105 (RPC_E_SERVERFAULT)

after that when I still try to call any methods or object in the Interop.EA.dll library I got another error:

System.Runtime.InteropServices.COMException (0x800706BA): The RPC server is unavailable. (Exception from HRESULT: 0x800706BA)

Has anyone get this problem?
I think it have connection with how often I using COM library

8
Helmut
Well, I already using EA Instalation inspector (and also I see vb code on github of this project) but I only found that prompt regasm command and cmd regasm command work different.

EXploringEA
Can you give a link to github repository?

Anyway, now I just saved repository HKCR keys Before I did using prompt regasm command and After. Then I compared both files. Finaly I get .reg file that contains all keys that need to install. It's work fine at my computer. Tomorow I will check it on other computers.

9
Hi, I try to make add-in that i can install at diferent computers
When I registry my add-in using prompt command "regasm <full dll patch> /codebase" it's work fine.
But if I register using same cmd command then EA just dont see my dll

I know that this problem connected with how regasm registry key of my dll but i cant find diference in use both cmd and prompt

Pages: [1]