|
how to disabled (character in grey) a control in MFC? I use a modifystyle and modifystyleEX but it not works when i repaint the control. I search a example.
Thanks
Jérôme
|
|
|
|
|
Check CWnd::EnableWindow()
Regards,
Elias
|
|
|
|
|
Have you try 'EnableWindow'? Every CWnd object has this method, so if you have a button in a dialog attached to a CButton variable...
....................
CButton m_btMyButton;
....................
in the cpp
...
m_btMyButton.EnableWindow(FALSE);
...
|
|
|
|
|
Hello
Ima developing a VC++ applictaion .When i try to build a applicatin that is statically linked to MFC ,it throws me this error
error LNK2005: "private: __thiscall type_info::type_info(class type_info const &)" (??0type_info@@AAE@ABV0@@Z) already defined in libcmt.lib(typinfo.obj)
Can somebody help me how to fix this error ?
Cause is my effort;
Effect is God's effort
|
|
|
|
|
You will probably have to change your link options in the project settings.
I can remember there is a /NODEFAULTLIB keyword that you can set in order to avoid linking with duplicate implementation.
Also, you might search for your error code in the help index which will tell you a lot...
|
|
|
|
|
i think u r using single thread run time library in project settings
|
|
|
|
|
Hi,
Do you know how to obtain a harddisks number; this is a serial (unique for each disk) number, wich I'll use for security etc.
I've have another question about this one; if I've build an app to determine the number, and it's put on a RAID system: which disk number will be returned?
Thanks
|
|
|
|
|
Hello
Check this: http://www.winsim.com/diskid32/diskid32.html
Or GetVolumeInformation() in SDK
|
|
|
|
|
Hi there,
If I build a setup project for an application, I can decide wether I want to place a shortcut to my .exe on the user's desktop. This has to be done before building the installer.
But I want the user to be able to choose wether he wants that, or not! So, I need to have some kind of interaction in my setup projects, for doing this I should inlcude some checkboxes in the dialog: How can I add those, and how can I use them to deternine wether to place those shortcuts?
Thanks
|
|
|
|
|
Hi all I am trying to extend a treectrl to add a preview window and button on the bottom of it. It has been subclassed and I have overridden the onPaint WM_MESSAGE where I have drawn... here is a code snippet that better explains what I have done.
void MyTreeCtrl::OnPaint()
{
CPaintDC dc(this); // device context for painting
CRect rc;
// First let the control do its default drawing.
CWnd::DefWindowProc( WM_PAINT, (WPARAM)dc.m_hDC, 0 );
GetClientRect(&rc);
rc.top = rc.bottom-30;
dc.FrameRect(rc,&CBrush( RGB(0,0,0)));
rc.left = rc.right - ::GetSystemMetrics(SM_CXHSCROLL);
dc.DrawFrameControl(rc, DFC_SCROLL, DFCS_SCROLLRIGHT);
}
This draws the preview window and the button at the bottom but inside the client area and leaves artifacts when items are expanded etc. I am trying to get something similar to this.
_____
| |
| |
-----
| |>|
-----
where the top is the actual treelist and the bottom is a preview window (showing a bitmap) and a button to call another dialog box.
Thanks in advance.
|
|
|
|
|
Sounds like youu need to reduce the size of the client area the control draws into. You can do this by processing the WM_NCCALCSIZE and WM_NCPAINT messages. Once you do that, you can hopefully add the extra buttons you need to the control and not have it overdraw them in its regular OnPaint(), which you should be able to leave unchanged.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Thats what I was looking for )). Thanks for the info. While I was waiting I have found another solution which I believe gives me greater flexibility. I subclassed a Cwnd and created my preview which I then included into my Ctreectrl subclass. I set its parent to the tree controls parent and when the tree control is shown it is also shown (and hidden) at the same time. I might just try including the WM_NCCALCSIZE and WM_NCPAINT as well as I have just come up with a re-paint issue.
|
|
|
|
|
Does anyone know how to write code in vc++ to detect the number of com port in the system?
|
|
|
|
|
Maybe you can try writing a code to access the registry, and try enumerating the COMM ports from there.
go to: \HKEY_LOCAL_MACHINE\HARDWARE\SERIALCOMM
Try enumerating the COMM ports by searching the keys: "\Device\SerialX" (where X is a number from 0 to n).
|
|
|
|
|
Correction! Its \HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\SERIALCOMM
|
|
|
|
|
Hi there
Actually all com ports on your system have aregistry in System registry,by there name like COM1 , COM2 etc ,
so u have to just enumerate the registry using registry realted API's
like RegOpenKey
its entry is in HKEY_LOCAL_MACHINE\HARDWARE\DESCRIPTION\System\MultifunctionAdapter\5\SerialController this key path
what u can do make a string "COM" + integer 1 , 2 , 3
search this string using Registry API 's
when it matches that means that com port is present in ur system
Abhishek Srivastava
Software Engg (VC++)
India ,Noida
Mobile no 9891492921
|
|
|
|
|
I want to skip a column in listview control but I can't. Can you help me.
Regard.
|
|
|
|
|
What do you mean by 'skip a column'?
|
|
|
|
|
I want to hide a column in a listview control.
|
|
|
|
|
Hi!
I have a problem. I'm joining a multicast group and recieves IP-streams in mpeg-2 format.I will save the streams to a buffer and compare the sequence number and see if there are some packets lost. If there is a packet loss I will save the buffer to a file.
I'm not sure, but I think I have to convert(?) mpeg-2 streams so I can watch the packets?
How do I compare sequence number? and if I have to convert, how?
Thanksful for your help,
|
|
|
|
|
Hi all,
Currently i am doing project for desinging graphics application with the help of GDI objects using MFC. In this application i use two tools like Unfilled rectangle and filled rectangle with different line stlyes. While selecting the unfilled rectangle, the rectangle will be drawn with current brush object. But i need to draw the rectangle with transparent brush. How can i do it. I can acheive it through the Draw3dRect function, but it doesn't support the differnt line stlyes. So please help me to solve this problem.
Prakash
|
|
|
|
|
You may be able to use the GetStockObject(HOLLOW_BRUSH) and select that into the DC to give internal transparent drawing.
Roger Allen - Sonork 100.10016
If your dead and reading this, then you have no life!
|
|
|
|
|
Hi,
My urgent requirement is to implement Stacked Dialog using ATL/VC++6.0 windowing classes. The implementation is similar to MFC's whcih is provided in the Codeguru site. Can any body tell me how to implement it? Sample code would be greatly helpful.
Thanks,
Sai.
Help Ever, Hurt Never
|
|
|
|
|
Are you using _beginthreadex to start the threads? Both functions store the last pseudorandom number in a per-thread data structure for all the CRT. If this structure hasn't been allocated, the first call the rand()/srand() allocates it. However, if you didn't use _beginthreadex, this pointer never gets freed.
So, if you ever use the CRT in a thread, use _beginthreadex. (If you ever use MFC in a thread, use AfxBeginThread().)
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Is there any way to change id's in string table?
Thanks in advance.
Shin
|
|
|
|