|
Hi All,
My prob is quite simple, I use The MFC under MS 6.0.
I'm Bored about the default layout of The boutton, I wanna change the layout Ok my App's Button(like adding some png Image to a button, or modify the shape to be like an ellipse).
How could I do that?
PS: I tried to crete some images and put them into my form and i used them as buttons by OnImageClick or sth like that.
Thak ya.
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
derive the CButton class and override the OnPaint.
|
|
|
|
|
By default this is my button where i run the APP
[IMG]http://www.monsterup.com/upload/1207737674.jpg[/IMG]
and i wanna change the layout like this one
[IMG]http://www.monsterup.com/upload/1207737712.jpg[/IMG]
|
|
|
|
|
|
thank you that will be helpful.
"The Ultimate Limit Is Only Your Imagination."
|
|
|
|
|
Do you want to customize your control?
|
|
|
|
|
I am using CTreeCtrl ni my project.
I am populating this tree with hard dis folder.
There are some empty folders for which it is showing plus sign
for expanding and nothing is happening when I click on plus sign.
So please help me to hide that plus sign for empty folder in CTreeCtrl.
Thank you.
|
|
|
|
|
TVS_HASBUTTONS
Displays plus (+) and minus (-) buttons next to parent items. The user clicks the buttons to expand or collapse a parent item's list of child items. To include buttons with items at the root of the tree view, TVS_LINESATROOT must also be specified.
I'm pretty sure that the sign is only shown when an item has children. Are you doing stranges things with I_CHILDRENCALLBACK?
Try making a demo project, with a dialog, and just add a few boring items to it, and see if it behaves properly. If so, start looking at the differences.
How are you populating the tree? Are you calling some function you haven't written, or are you using FindFirstFile/FindNextFile to get the file names to populate the tree with?
Iain.
Iain Clarke appears because CPallini still cares.
|
|
|
|
|
Hello everyone,
If we define global variable and static variable of a class, which are implemented in a DLL. My questions are,
1. All instances of class share the single copy of global variable and static variable of class? If yes, I need to have some synchronization approach on them.
2. Is it safe to use global variable and static (public) variable after DLL unloads?
thanks in advance,
George
|
|
|
|
|
George_George wrote: All instances of class share the single copy of global variable and static variable of class? If yes, I need to have some synchronization approach on them.
This is true inside a process. Different processes have their own copies of such variables. synchronization is needed for different thread of the same process (i.e. no special rule for DLL s.
George_George wrote: 2. Is it safe to use global variable and static (public) variable after DLL unloads?
It is a mistake.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks CPallini,
1.
CPallini wrote: This is true inside a process. Different processes have their own copies of such variables. synchronization is needed for different thread of the same process (i.e. no special rule for DLLs.
So, for different processes, if they load the same DLL separately, they have different copy of global and static variable inside a class?
2.
Whether it is possible to load a DLL twice inside a process? If yes, whether in this case, there is multiple copies of global variable and static variable of a class?
regards,
George
|
|
|
|
|
George_George wrote: So, for different processes, if they load the same DLL separately, they have different copy of global and static variable inside a class?
Yes. Unless you use special techniques (see for instance [^]), DLL's aren't a media for interprocess communication (sharing a variable is, basical IPC).
George_George wrote: Whether it is possible to load a DLL twice inside a process? If yes, whether in this case, there is multiple copies of global variable and static variable of a class?
Really I don't know. If it is possible then probably there are multiple copies, since you have multiple handles to loaded DLL s. Anyway it is just a guess.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks CPallini,
If the DLL is a COM in-proc server, I think there should not be any changes to load the DLL multiple times? If we follow the guideline of COM, and just use CoCreateInstance/Addref/QueryInterface/...
If I watched a COM in-proc server DLL is loaded multiple copies inside a process, it should be a bug of the COM in-proc server?
regards,
George
|
|
|
|
|
I don't fully understand what you're asking. Anyway, COM DLL 's never expose variables.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks CPallini,
Here is my scenario. You have a COM component, which contains a class and in the class you wrap static member variable. When you create multiple instance of the COM object, by multiple calls to CoCreateInstance or something, all instances of COM objects will share the single copy of static member variables, and if the COM objects can be executed by multiple threads, we have to do synchronization on them, right?
regards,
George
|
|
|
|
|
Well, I'm not an expert of COM threading. Anyway, I think that if your COM object threading model is STA then you don't need synchronization because COM makes on your behalf. In all other circumstances you need to synchonyze.
But, again, since I'm not an expert about, this is going on my arrogant assumptions...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
|
Yes. It seems I was wrong. Good to know.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I will doubt whether there are multiple copies of data inside DLL (e.g. static member variable of a class) if we call LoadLibrary multiple times inside one process? Any ideas?
regards,
George
|
|
|
|
|
Well, I made a little test, getting the same HINSTANCE value when calling two times LoadLibrary using the same DLL file as argument, hence no multiple copies (at least on empirical grounds...).
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks CPallini!
Seems Windows protects from loading the same DLL twice inside the same process?
regards,
George
|
|
|
|
|
Or maybe it gives out sparingly system resources.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
Thanks CPallini.
regards,
George
|
|
|
|
|
In my programm a barcode is needed. This barcode is scanned with a barcode scanner on a serial COM port (COM1 or COM2).
How do I programm this serial communication?
Please keep in mind that I am less than a juvenile in the C++ programming business and I am learning it the hard way (no training).
|
|
|
|
|
You need to have some documentation about the protocol which is used by the barcode device.
|
|
|
|