A class named TwwNavutton already exists
I'm moving my D2009 app to Delphi 10.3. I have several runtime packages that I load dynamically from my main app and now, after recompiling under 10.3, I am getting an error when loading, " A class named TwwNavbutton already exists." To troubleshoot, I found the smallest package and removed all TwwNavigator components and wwNavigator from the uses. I recompiled and still getting the same error message when loading the package. Can you provide assistance?
-
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.
-
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.
-
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?
-
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.
-
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'); -
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.
Please sign in to leave a comment.
Comments
7 comments