Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » strange looking window
strange looking window [message #9371] Wed, 02 May 2007 22:58 Go to next message
bitsun is currently offline  bitsun
Messages: 12
Registered: March 2007
Location: Germany
Promising Member
My company has decided to use UPP as the GUI development library. But we still stick to VC2005.

Now I am already able to compile and debug C++ program using UPP in VC2005. The funny thing is that the window I program in VC2005 has a different look than the window created by theIDE.

First I want to confirm one point, the core,ctrlcore,ctrllib,draw,richtext,plugin/bmp,plugin/png,pl ugin/z
are the fundamental libraries, on which all GUI programs are based on, is that right?

I have tried two ways to build upp static libraries.
OK , then I will show how I achieve it.
1, Use the $blitze.obj files created by theIDE, then created win32 project,add all the neccessary object files under the MSC8.Debug_full.Gui directory to the project, then build the project as static library.

2, build the source(i only build the source code in the 7 libraries that i mentioned above) totally with VC2005, without theIDE.
So i have two versions of upp static libraries.
But when I test my first upp program,it compiles and links successfully(with both versions of static libraries), but I got a strange look of the window(in both cases)
index.php?t=getfile&id=535&private=0

It is supposed to look like a window like this :
http://www.ultimatepp.org/L$srcdoc$CtrlLib$Tutorial$en-us.html_7.png

All the upp windows that I create have dark color and the buttons have no borders at all.

However,if I do not use these static libraries ,but add these object files created by theIDE directly to the my project,then everything is fine. The created windows are normal.

Is there any difference between the static libraries and the objects files. Since I use exactly the same object files to build the static libraries(in the first build method I mentioned above), I guess they should be equivalent.
Anyway static library is a better solution,it would be annoying to add these objects files every time when I create a new project.

Thanks in advance.


Bitsun
  • Attachment: strange.JPG
    (Size: 17.87KB, Downloaded 914 times)
Re: strange looking window [message #9373 is a reply to message #9371] Thu, 03 May 2007 00:44 Go to previous messageGo to next message
bitsun is currently offline  bitsun
Messages: 12
Registered: March 2007
Location: Germany
Promising Member
I think I found out the reason, but dont know how to fix it.

When I build the static library with object files ,I got following warnings

CtrlLib.obj : warning LNK4221: no public symbols found; archive member will be inaccessible
CtrlCore.obj : warning LNK4221: no public symbols found; archive member will be inaccessible

The warnings are probably the reason why I got such strange window
Re: strange looking window [message #9379 is a reply to message #9373] Thu, 03 May 2007 17:21 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Once again, this is .icpp issue.

U++ TheIDE handles these files differently - they are always linked as .obj, never as .lib. This is because they usually contain constructors (e.g. registration of Image formats) and no linkage to other .obj files, which would result in eliminating them by linker. If they are brought in as .obj, linker cannot eliminate them and constructor are called.

Search for other thread about VC++ projects (frankly, I am not sure what is the final verdict here...)

Mirek
Re: strange looking window [message #9551 is a reply to message #9371] Wed, 16 May 2007 13:05 Go to previous messageGo to next message
bitsun is currently offline  bitsun
Messages: 12
Registered: March 2007
Location: Germany
Promising Member
there's a linker switch to
disable eliminating unreferenced data.
Maybe this can solve the problem, where can I specify link options for MSVC in theIDE, is it possible? I look into "build method",there are only some switches for vc compiler.
Re: strange looking window [message #9562 is a reply to message #9551] Thu, 17 May 2007 14:38 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Why do you need to specify TheIDE options? I thought you are trying to build it in MSVC?

Re: strange looking window [message #9588 is a reply to message #9371] Fri, 18 May 2007 11:36 Go to previous messageGo to next message
bitsun is currently offline  bitsun
Messages: 12
Registered: March 2007
Location: Germany
Promising Member
yes,I built the library in MSVC. But I also found out that theIDE can create these static libraries itself(just need to switch off blitz).
So now I am using theIDE to generate these static libraries for me. But, the same problem as I stated above, the ctrllib.obj is not linked into the static library. I have tried dumpbin to view the archived obj files within the file ctrlLib.lib.That's why I am asking if there is any options in theIDE to force the obj file to be linked into library, instead of being eliminated.(Maybe there is no such option at all)

Even if the ctrllib.obj is not present,the program can still link,but we get an ugly interface. Now I wondering,Is the binary image using any symbols in ctrllib.obj? If yes ,why does the linker does not report any error,even if ctrllib.obj is not present.
Re: strange looking window [message #9600 is a reply to message #9588] Sat, 19 May 2007 11:19 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Ah, I see.

But that is on purpose! Linking it into .lib file would result in the exact same problem you have encountered - there are no references from the rest of the code to the .obj, therefore linker would omit the object file.

The point is that you have to link that .obj directly! (Not sure it is possible with MSCV, but I think it should be).
Re: strange looking window [message #9652 is a reply to message #9371] Wed, 23 May 2007 21:51 Go to previous messageGo to next message
Novo is currently offline  Novo
Messages: 1358
Registered: December 2006
Ultimate Contributor
The easiest ways to fix your problem is to call CtrlSetDefaultSkin(ChStdSkin, ChHostSkin) from one of the possible places listed below.

1) GUI_APP_MAIN;
2) A constructor of a class inherited from TopWindow;
3) A constructor of a "your_class : public your_layout<TopWindow>";

I think Mirek could put this call somewhere inside of TopWindow. That would solve all these problems with icpp files.

I hope that helps.


Regards,
Novo
Re: strange looking window [message #9676 is a reply to message #9652] Thu, 24 May 2007 23:14 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Novo wrote on Wed, 23 May 2007 15:51

The easiest ways to fix your problem is to call CtrlSetDefaultSkin(ChStdSkin, ChHostSkin) from one of the possible places listed below.

1) GUI_APP_MAIN;
2) A constructor of a class inherited from TopWindow;
3) A constructor of a "your_class : public your_layout<TopWindow>";

I think Mirek could put this call somewhere inside of TopWindow. That would solve all these problems with icpp files.

I hope that helps.



That would solve the problem with CtrlLib.icpp. But there is a lot of other .icpp files.

Obviuously, alternative approach would be to provide some "register" function for each .icpp file, which could be empty and call in in MAIN. But we want to be as "automatic" as possible...
Re: strange looking window [message #22500 is a reply to message #9371] Sun, 19 July 2009 19:45 Go to previous message
Sc0rch is currently offline  Sc0rch
Messages: 99
Registered: February 2008
Location: Russia, Rubtsovsk
Member

I'm trying to create a plugin framework. From plugins I'm getting only the layouts now (for tests). But there is a very strange issue... Just run and press "Test Button" and try to use the layout.

After some days: I found a decision. I'm creating ctrl's by calling functions like that:

CtrlFactory::Execute("AddMTIBar", const Value& v1, ...);
Example: f->Execute("AddMTIBar", "Test Title"); // in plugin

Function must be defined in the host-program. In my decision it creates a callback (using this-pointer in host and using received parameters) and executes it.

Well, maybe it's a little complicated but it works good.

Best regards,
Anton
  • Attachment: MSC9.Gui.rar
    (Size: 979.69KB, Downloaded 302 times)

[Updated on: Thu, 23 July 2009 15:56]

Report message to a moderator

Previous Topic: Problem with ScrollContainer...
Next Topic: Couldn't enable LLOG in X11Wnd.cpp
Goto Forum:
  


Current Time: Thu Mar 28 12:25:16 CET 2024

Total time taken to generate the page: 0.01551 seconds