Book a Demo

Author Topic: C++ typedef not recognized and deleted attributes  (Read 17100 times)

SMaton

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
C++ typedef not recognized and deleted attributes
« on: February 26, 2008, 08:22:08 am »
Hi,

I'm currently evaluating Enterprise Architect to see if it fits my needs of C++ round-trip UMLing. So far, it's the best software package I've seen. Yet, there are some problems that I have posted to the trial user bug report but I didn't get any feedback. Perhaps you folks in this forum can "help" me or just confirm my observations.

Problem 1:

I have a typedef of this form:

typedef unsigned long long Index;

If I syncronize the model with the code (or import the source from a dir on an initial EA project setup), the typedef will not show up.

If I generate the code, the typedef disappears. The "Index" is still used as a function return value, but any code that uses the "Index" will be deleted.

The initial code:

    inline Index getFloormapIndex(int _x, int _y) {
                return Index( (static_cast<Index>(_x) & 0xffffffff) << 32 | (static_cast<Index>(_y) & 0xffffffff) );
          };

The code after "Generate code":

    inline Index getFloormapIndex(int _x, int _y) {
                return NULL;
          };

Now, some strange stuff: If I readd the "typedef unsigned long long Index;" and I change the "unsigned long long" to "int" ("typedef int Index;"), a "sync model with code" will show the typedef. I rechange the "int" to "unsigned long long", "sync model with code" then "generate code" again, I will have 2 (!) typedefs. One with int and one with unsigned long long. :-?

2nd problem:

I have an attribute "int m_a;", I delete it within the UML then I "generate code": The "int m_a;" changes to "int *m_a;". That pointer is not displayed in the class UML. I do an "sync model with code", the pointer appears. I manually remove the pointer from my header and do a "sync model with code" -> the pointer disappears from the class UML.

Now the strange thing: If I "generate code", the pointer shows up again ?!? :o

Thanks for your help,
Stefan

SMaton

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: C++ typedef not recognized and deleted attribu
« Reply #1 on: February 26, 2008, 08:26:27 am »
A 3rd problem:

I'm also using the EA integration to VS2005. If I open an EA instance from within VS2005 (right mouse click on the diagram -> "Open enterprise architect") and then I select "Add-Ins"->"Visual Studio"->"View Project Connections", I get this error message:

"An error occurred while attempting to communicate with an Addin:

Visual Studio (EAVSBridge.EAVSAddin)

"EA_MenuClick: Component 'MSCOMCTL.OCX' or one of its dependencies not correctly registered: a file is missing or invalid"

Please contact the add-in provide for assistance."

I'm working under Vista, VS2005 and VS2008 on a parallel installation.

Any idea how to fix this?

Thanks,
Stefan

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: C++ typedef not recognized and deleted attribu
« Reply #2 on: February 26, 2008, 08:57:39 am »
Hi Stefan,

Regarding your first two problems, they are out of my field. As to your third, I don't know either.

However, I suspect without proof that this is a Vista configuration issue. Perhaps the control is not present in Vista, or nor registered. Another possibility is that execution control is blocking the control, since it is executable.

My suggestion is that you send a bug report directly to Sparx ASAP. They will really want to deal with this, since the first beta of the MDG link to VS 2008 has just come out.

Follow the Report a Bug link near the bottom of any forum page. If you are a registered user then click the appropriate link near the top of the resulting page (above the form); otherwise fill out the form and send it in.

Thanks for pointing this issue out. I am very soon going to be doing an evaluation on almost exactly the same platform (I might evaluate the 3.5 version of the Integration product instead). You've likely saved me some grief.

David
No, you can't have it!

SMaton

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: C++ typedef not recognized and deleted attribu
« Reply #3 on: February 26, 2008, 09:28:40 am »
Hi,

I've already send these bugs via the trial bug report. Also, I'm using the VS2005 integration (against VS2005 not VS2008 ;) ).

I don't suppose that this is an execution problem. Everything else on my machine runs without problems.

Perhaps something went wrong during installation, although I didn't get any error message. I just searched for 'MSCOMCTL.OCX' on my machine and I have found one... in my XSI 6.01 installation   :-/ So yes... it must be missing in their VS2005 integration...

Thanks for your reply,
Stefan
« Last Edit: February 26, 2008, 09:29:52 am by Metron »

mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: C++ typedef not recognized and deleted attribu
« Reply #4 on: February 26, 2008, 09:46:10 am »
Hi Stefan,

In regards to your third problem, I've been running EA + VS 2005 Integration under Vista without any problems in the office. Are you running a 64-bit version of Vista?

Also is MSCOMCTL.OCX registered? Try copying the file to c:\Windows\System32 and registering the file by typing

c:\Windows\System32> regsvr32 mscomctl.ocx
Best Regards,

Michael

[email protected]
"It is more complicated than you think." - RFC 1925, Section 2.8

SMaton

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: C++ typedef not recognized and deleted attribu
« Reply #5 on: February 26, 2008, 09:55:30 am »
Quote
Hi Stefan,

In regards to your third problem, I've been running EA + VS 2005 Integration under Vista without any problems in the office. Are you running a 64-bit version of Vista?

Also is MSCOMCTL.OCX registered? Try copying the file to c:\Windows\System32 and registering the file by typing

c:\Windows\System32> regsvr32 mscomctl.ocx

Hi,

shame on me I relied on the Vista file search :-[ Obviously it ignores system files under System32... I found a version of that file in my Vista Windows/System32 folder. I also did a refsvr32 on it (just to be sure) but the error still occurs.

I'm running a 32-bit version of Vista...

Perhaps this is due to the fact that I use eval versions and not registered versions?

Thanks for your help,
Stefan

mrf

  • EA User
  • **
  • Posts: 311
  • Karma: +0/-0
    • View Profile
Re: C++ typedef not recognized and deleted attribu
« Reply #6 on: February 26, 2008, 10:03:47 am »
Hi again Stefan,

I don't think that the problem would be related to the eval version of the Integration product as, (as far as I'm aware) there is no difference in functionality between it and the full version.

Do you have User Account Control turned on in Vista? That does some funky things with Registry/File System virtualization which may cause the OCX to be registered in the wrong place.

If it's possible, are you able to:
1. Uninstall VS Integration
2. Turn UAC off
3. Reinstall VS Integration
« Last Edit: February 26, 2008, 10:05:10 am by mfraser »
Best Regards,

Michael

[email protected]
"It is more complicated than you think." - RFC 1925, Section 2.8

SMaton

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: C++ typedef not recognized and deleted attribu
« Reply #7 on: February 27, 2008, 06:12:30 am »
Good evening,

well... UAC was the first thing I turned off once I installed Vista :) I tried to reinstall both EA and the Integration but it did not help.

I have taken a look at the ocx with an dependency walker but all linked DLLs seem to load fine.

Is there some kind of log file in the EA install dir where I can see why this error occurs?

Just as a question: Is there any problem that might occur because this functionionality (Addins->visual studio->view project connections) does not work properly?`

Problem n°2 has been solved by the support team. Thanks... your solution works like a charm!

EDIT: I just browsed through the website and stumbled upon the ;DG Link for Visual Studio Page. The version # stated in there is 2.5 ("Download VSBridge.exe ( 3.5 MB ) (Version: 2.5 ) to experience [...]"). I also took a look at the Add-Ins->Visual Studio->About box and there a version of 2.4.0 is stated...

Thanks for your help,
Stefan
« Last Edit: February 27, 2008, 06:26:44 am by Metron »

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: C++ typedef not recognized and deleted attribu
« Reply #8 on: February 27, 2008, 10:34:17 am »
Problem 1.
The type of unsigned long long is causing EA to not recognise the typedef as one that it can make a class out of.  As a result it is just skipping over it.  We should have this corrected within the next couple of builds, but until then, please note that the error will not cause any loss of data and that this is not responsible for the loss of your function body.  The only reason EA will overwrite a function body when forward engineering is if you overwriting the entire file.

If you want to overwrite files each time, you can tell EA to import the function body into your model.  This can be done by checking Tools | Options | Source Code Engineering | Attribute/Operations | Include method bodies in model when reverse engineering.

Problem 2.
Good to hear its resolved.  For anyone else coming across this problem.  The attribute was being regenerated because of a matching association.  You can remove it, and on the same page of the options referred to above there is an option for deleting associations when reverse engineering.