|
You should use the MS Shell Dlg or MS Shell Dlg [^] logical fonts to have the same behavior of MS Windows dialogs. I am pretty sure that the default font size is 8 for most english users but if I remember correctly the default font size can be larger in an international installation.
Also keep in mind that although most users with 20-20 vision have the DPI set at 96, there may be individuals with DPI set at 120. You should test your messagebox dialog to ensure that it can handle all environments.
Best Wishes,
-David Delaune
|
|
|
|
|
guide me load data to combobox for vc++6.0. please. thanks
"
enum { IDD = IDD_SPOOLIMAGE_DS_PP };//gọi form
DDX_Control(pDX, IDC_TEST, value_del);
CComboBox* cb = (CComboBox*)GetDlgItem(IDC_TEST);
cb->Clear();
CString sName = "";
for(int i=0; i<10;i++)
{
cb->SetItemData(i, DWORD(i));
}
"
|
|
|
|
|
And what the problem?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
can you tell specification ? thanks . wish your help
|
|
|
|
|
If you want to add strings to Combobox you can use of:
for (int i = 0; i < m_nItems; i++)
{
m_pComboBox->InsertString(str);
}
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
why don't you use to AddString() to load data into the combo box?
|
|
|
|
|
I was Addstring() but wrong.
|
|
|
|
|
nguyen phan wrote: cb->SetItemData(i, DWORD(i));
SetItemData() is used to Set the 32-bit value associated with the specified item in a combo box. AddString() is used to add a string to the end of the list in the list box of a combo box.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
How to Invoke a Web Service using managed C++ OR VC++ .NET . provide me with some link
|
|
|
|
|
|
Did you see Web Services[^]?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
HI
how can i detect if a new ethernet cable is connected or disconnected dynamically?
can we use redundant ethernet cable so that it can takeover if the first one fails?
can we stop the communication through a port manually? i.e, enabling or disabling of a port?
Regards
pramod
|
|
|
|
|
hi experts plesae let me know how to obtain all DLLS information that depends on particular .exe file in 16 bit programs.Dependency walker is not working for 16-bit programs.iam working on vc++ 1.52...
kir_MFC
modified on Friday, January 9, 2009 1:40 AM
|
|
|
|
|
|
Use the EnumProcessModules API.
Use the GetCurrentProcess API to get the handle to the current process or OpenProcess to open an already running process.
If you want to get the dependent DLLs of an EXE that is not running, you will need to parse the EXEs internal PE structure.
PEDump is one such program.
«_Superman_»
|
|
|
|
|
Hi,
I'm loading resource>toolbar into CImageList
When i draw using imageList.draw, then the transparent is no more work
any idea?
CImageList ImgList;
COLORREF rgbTransparentColor = RGB(73,73,73);//dono what this use..
CBitmap bmp;
int bubu = bmp.LoadBitmapW(IDR_MAINFRAME);//the toolbar to be loaded
ImgList.Create(16.5,14.5,ILC_MASK | ILC_COLOR32,1,1);
ImgList.Add(&bmp, rgbTransparentColor);//put the bitmap into imagelist
CPoint ptImage(rectIcon.left + 1, rectIcon.top + 1);//get the point(position) of the rectangle to be drawn
ImgList.Draw(pDC, nIconPosi, ptImage, ILD_NORMAL);//draw the icon
good
|
|
|
|
|
karhong wrote: RGB(73,73,73);//
Is this the color in the bitmap that you want to make transperent?
|
|
|
|
|
yea.. i hope to make the imgList.Draw icons to have the background color of RGB(73,73,73)
good
|
|
|
|
|
Either I am misunderstanding you, or you are misunderstanding the API.
The transparent colour is the colour in the original bitmap that you want to become transparent.
I normally use a hideous shade of purple, or pink. I'm too manly to use them for actual display. There is nothing stopping you using a certain shade of gray (RGB(73,73,73)), but it will be less obvious when you are editing the original bitmap.
For debugging the sort of problem you have, I strongly recommend the excellent article http://www.codeproject.com/KB/applications/imageviewer.aspx[^] by PJ Arends.
Iain.
Codeproject MVP for C++, I can't believe it's for my lounge posts...
|
|
|
|
|
Hi all,
We have a situation where we need to check that the 'this' pointer is not null in a (non-virtual) member function. The problem is that the class it is in is sometimes involved in a multiple inheritance hierarchy where it is not the first base class and thus the 'this' pointer is adjusted by the compiler before it is given to our function. I've read that "some" compilers will explicitly check for null "this" pointers and not adjust them to prevent this issue; however, it does not seem that MSVC++ 9 behaves this way. Is there by any chance a flag that can be set to enable this behavior?
If there is not, what suggestions do you have on a way of reliably detecting this situation? One thought is to simply compare vs a sufficiently large value such that any offsets would be well within the range - perhaps the system reserved memory range (0 - 0x0000 FFFF). Any others are welcome. Thanks in advance.
|
|
|
|
|
I suspect any this value below the standard start address for an EXE (0x400000, IIRC) is suspect.
BTW - what's the rationale for allowing NULL this pointers in this case? That sounds like something you'd prefer to avoid if at all possible...
|
|
|
|
|
Thanks for the suggestion.
We have a large and complex set of classes which are frequently built using composition and a variety of design patterns. One of the things we're looking for is essentially C#'s is operator only customized to our types. Like the is operator, we'd like to be able to handle NULLs. It's not a hard requirement, but it makes use of the new functionality simpler and more straightforward.
|
|
|
|
|
How about dynamic_cast ?
if (dynamic_cast<basetype*>(SomePointer)) { }
Consider this code:
#include <iostream>
class Base1
{
public:
virtual DoSomething1() const { std::cout << "Base1::DoSomething1 @ " << (int*)(this) << "\n"; }
};
class Base2
{
public:
virtual DoSomething2() const { std::cout << "Base2::DoSomething2 @ " << (int*)(this) << "\n"; }
};
class Base3
{
public:
virtual DoSomething3() const { std::cout << "Base3::DoSomething3 @ " << (int*)(this) << "\n"; }
};
class Derived : public Base1, public Base2
{
public:
virtual DoSomething1() const { std::cout << "Derived::DoSomething1 @ " << (int*)(this) << "\n"; }
virtual DoSomething2() const { std::cout << "Derived::DoSomething2 @ " << (int*)(this) << "\n"; }
};
int main(int, char**)
{
Derived d;
std::cout << "d @ " << (int*)(&d) << std::endl;
std::cout << "dynamic_cast<Base1*>(&d) == " << dynamic_cast<Base1*>(&d) << std::endl;
std::cout << "dynamic_cast<Base2*>(&d) == " << dynamic_cast<Base2*>(&d) << std::endl;
std::cout << "dynamic_cast<Base3*>(&d) == " << dynamic_cast<Base3*>(&d) << std::endl;
std::cout << "dynamic_cast<Base1*>(0) == " << dynamic_cast<Base1*>((Derived*)0) << std::endl;
std::cout << "dynamic_cast<Base2*>(0) == " << dynamic_cast<Base2*>((Derived*)0) << std::endl;
std::cout << "dynamic_cast<Base3*>(0) == " << dynamic_cast<Base3*>((Derived*)0) << std::endl;
return 0;
}
We get this output:
d @ 0012FEDC
dynamic_cast<Base1*>(&d) == 0012FEDC
dynamic_cast<Base2*>(&d) == 0012FEE0
dynamic_cast<Base3*>(&d) == 00000000
dynamic_cast<Base1*>(0) == 00000000
dynamic_cast<Base2*>(0) == 00000000
dynamic_cast<Base3*>(0) == 00000000
So dynamic_cast indicates inheritance relationships with a NULL and will also detect null 'this' pointers properly.
|
|
|
|
|
I am currently writing an application using C++ and MFC. It has three threads. One is for the GUI interface and the other two (worker threads) do the same simulation many times. When one of the worker threads completes a simulation, it sends a message back to GUI thread, via SendMessage.
I am counting the number of messages that I am sending and the number of messages that the GUI thread is sending, and they are not the same. When I put a sleep statement in the worker thread, the problem goes away. I am thinking that I am overflowing the window’s message queue. Is there a way to verify this or to find out how many messages are in the queue at a given time? I am also wondering how big the queue is. I am using this message to return results. I am starting to think this was a bad design decision. Please comment.
Thanks
Bob
|
|
|
|
|
Hi,
IIRC some messages get special treatment; e.g. WM_PAINT messages may get merged if all they do is request a repaint of (parts of) the same Control. Maybe it is also true for setting a text to a label,
etc.
Your app is also likely to get some messages from the outside world (device inserted, task manager checking for "not responding", etc).
if you suspect your queue is "filling up", the design is not OK; what will happen if your system gets another load at the same time? what if your app needs to run on a slower PC?
When you have a progress bar showing a progress say in percent, then it does not really make sense to send it 10,000 progress updates, it probably can only show 100 or so different states anyway; so you should consider a cheaper way of reporting, probably by aggregating a number of progress steps.
Do you really need that much GUI activity; after all it is consuming its share of CPU cycles, and hence slowing down the simulation of which you are eager to know the progress!?!?
One way I often handle these kinds of requirements is by having the background doing its job without reporting anything, and having one more thread which periodically (a few Hz) reports the progress by
looking at the backgrounder state variables (if they are simple enough, that does not require any
synchronization, locking, whatever...)
|
|
|
|