A class named TwwNavutton already exists

Comments

7 comments

  • Roy Woll

    It sounds like your own package is not using the infopower runtime package ipstudiowin.  If you don’t include this, then you will end up including the infopower units in your own package and then you would have two packages defining the same classes. Check if this is the case.

    -Roy

     

    0
    Comment actions Permalink
  • William Whitaker

    In my main app, I have the three InfoPower design packages flagged under Project, Options, Packages. In the runtime package, I see ipstudiowin under the requires clause. If I remove that, and attempt to recompile, it always requests to add it back in to be compatible and allow the recompile. So to clarify, the main app has the InfoPower packages included and the runtime package that I'm having issues with won't recompile without the ipstudiowin includes in the requires clause.

    0
    Comment actions Permalink
  • Roy Woll

    Sorry, but I don't know the cause without getting more info.  The error does mean that you have two packages defining the same component.  Trying finding out which package is the culprit.  You may need to restart the delphi ide a few times to figure this out.

    Your design time packages should also include ipstudiowin so make sure you don't forget that.

     

    0
    Comment actions Permalink
  • William Whitaker

    Can you give me a little guidance on what to look for? I have a main app that uses IP components (the design packages are InfoPower 4K Midas, InfoPower 4K Rio and InfoPower RichEdit). No problems there. I dynamically load my runtime package (a specific module of my program) which requires ipstudiowin in the requires clause to compile. I removed all TwwNavbutton components from the module to see if that would fix things, yet even though I have no TwwNavButtons in that module, it still gives me the same error. What packages are you referring to when you say I "have two packages defining the same component.  Trying finding out which package is the culprit"? Also, when you say "your design time packages should also include ipstudiowin so make sure you don't forget that", I do have those checked on in my main app. Is that what you are talking about? If so, that isn't an issue. Is there some troubleshooting guidance you can provide? As of now, the only package in question is related to InfoPower. And why it would be giving me that message when there are no wwNavButtons in the module I'm trying to load dynamically? 

    0
    Comment actions Permalink
  • Roy Woll

    I am referring to the requires section of your packages.  I also don't know what you mean by dynamically loading so maybe this is your issue. Does it happen if you just run your program without your special dynamic code?  It sounds like your package that you are loading or one of its referenced packages does not have the ipstudiowin in it's requires section.  Also make sure that your packages are compiled using runtime packages.

    0
    Comment actions Permalink
  • William Whitaker

    Sorry, dynamically linking is what I mean to say. It's a .bpl I created so I don't have a massive .exe file. This .bpl is a module I created with specific functionality that loads from my main app when the user needs to access that module and frees it when the module is closed. The module (.bpl package) doesn't have TwwNavButtons in it at all yet when that .bpl is called by my main app, it still gives that error message. (It does have other IP components on forms in the module) The .bpl package I created has required the following: 

    requires
    rtl,
    vcl,
    dbrtl,
    vcldb,
    vclx,
    dbexpress,
    dsnap,
    dclmid,
    dcldb,
    vcldesigner,
    designide,
    vclactnband,
    dclstd,
    QR506RunDXE10_3,
    OrpheusDR,
    OrpheusDBDR,
    vclwinx,
    ipstudiowin;

    I call it within my main app by using LoadPackage:

    if OKContinue = mrOK then
    begin
    phm:=LoadPackage(ExtractFilePath(ParamStr(0)) + 'MXReliability.bpl');
    screen.cursor := crDefault;
    if phm <> 0 then
    try
    @ExecFunct:=GetProcAddress(phm,'ExecuteMTBUR1');  // specific function in the package
    if Assigned(ExecFunct) then begin
    ExecFunct(g_user, G_SECMX[CMTM], g_bmpdir, g_docbmp, g_company, g_delcode, v_manualid, g_remoteclient);
    end else begin
    ShowMessage ('Module not found!');
    end {if assigned}
    finally
    UnloadPackage(phm);
    end{try/finally}
    else{if hpm<>0}
    ShowMessage ('Package not found');

    0
    Comment actions Permalink
  • Roy Woll

    Sorry, but I don't know where the problem lies.  It does seem strange to me though that your package uses all these design time packages (dclstd, designed, vcldesigner, dcldv, etc.)  Why would your package need to load design time package for a running non IDE executable?  Also you don't have to use a TwwNavButton as if your package is including infopower units statically, then you will have a namespace collision between your package defining the same names as your calling executable.

    I also want to confirm that your package MXReliability.bpl is compiled WITH runtime packages. Check your compiler options.

     

     

    0
    Comment actions Permalink

Please sign in to leave a comment.

Powered by Zendesk