|
Hello,
how can i show a line separator between dialog objects, like in visual basic?
I like to put some radio boxes on the left side of my dialog, vertical, and i want to make a litle
difference between, not to use "GroupBox", just a simple line like menu separator:
° radio1
° radio2
° radio3
----------------- // <-- my line separator
° radio4
° radio5
° radio_n
is this posible?
thanks in advance
break;
|
|
|
|
|
override the OnPaint() function and add this code :
CRect l_rctClient;<br />
GetClientRect(&l_rctClient);<br />
<br />
CDC * l_pDC = GetDC();<br />
<br />
CPen l_GrayPen(PS_SOLID, 1, RGB(100, 100, 100));<br />
CPen l_WhitePen(PS_SOLID, 1, RGB(255, 255, 255));<br />
<br />
int l_nYLine = l_rctClient.top + l_rctClient.Height()/2;
<br />
CPen * l_pOldPen = l_pDC->SelectObject(&l_GrayPen);<br />
l_pDC->MoveTo(l_rctClient.left+2, l_nYLine);<br />
l_pDC->LineTo(l_rctClient.right-2, l_nYLine);<br />
<br />
l_pDC->SelectObject(&l_WhitePen);<br />
l_pDC->MoveTo(l_rctClient.left+2, l_nYLine+1);<br />
l_pDC->LineTo(l_rctClient.right-2, l_nYLine+1);<br />
<br />
l_pDC->SelectObject(l_pOldPen);<br />
<br />
ReleaseDC(l_pDC);
|
|
|
|
|
Hello,
thaks for answer, yes tis is what i mean, only i recive an error in line:
CRect l_rctItem;
GetDlgItem(IDC_RADIO)->GetClientRect(l_rctItem);
i think that the IDC_RADIO dont exists at this time,
Error is "Access violation 0x00000005". And the compiler show this:
<code>
_AFXWIN_INLINE void CWnd::GetWindowRect(LPRECT lpRect) const
{ ASSERT(::IsWindow(m_hWnd)); ::GetWindowRect(m_hWnd, lpRect); }
</code>
How to solve this
The rest od your sample works fine, the new line goes through the middle of my dialog
regards
break;
-- modified at 9:16 Monday 27th November, 2006
|
|
|
|
|
So you can do that :
CWnd * l_pRadioWnd = GetDlgItem(IDC_RADIO);<br />
if( !l_pRadioWnd )<br />
return;<br />
<br />
CRect l_rctItem;<br />
l_pRadioWnd ->GetClientRect(l_rctItem);<br />
<br />
int l_nYLine = l_rctItem.bottom+10;<br />
<br />
CDC * l_pDC = GetDC();<br />
<br />
CPen l_GrayPen(PS_SOLID, 1, RGB(100, 100, 100));<br />
CPen l_WhitePen(PS_SOLID, 1, RGB(255, 255, 255));<br />
<br />
CPen * l_pOldPen = l_pDC->SelectObject(&l_GrayPen);<br />
l_pDC->MoveTo(l_rctClient.left+2, l_nYLine);<br />
l_pDC->LineTo(l_rctClient.right-2, l_nYLine);<br />
<br />
l_pDC->SelectObject(&l_WhitePen);<br />
l_pDC->MoveTo(l_rctClient.left+2, l_nYLine+1);<br />
l_pDC->LineTo(l_rctClient.right-2, l_nYLine+1);<br />
<br />
l_pDC->SelectObject(l_pOldPen);<br />
<br />
ReleaseDC(l_pDC);
|
|
|
|
|
Hello,
i solve my problem, thank you! I override the wrong OnPaint() function, because i have more childdialogs!!!
regards
break;
|
|
|
|
|
Just insert a static control that is 1 DLU tall, and has the SS_SUNKEN style.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I would like to know how to disable the joystick by programming?
Please help!
|
|
|
|
|
what can i do ? and how ?
warning C4652: compiler option 'Generate Browser Info' inconsistent with precompiled header; current command-line option will override that defined in the precompiled
Bravoone
|
|
|
|
|
The warning has probably nothing to do with the fact that your application failed to start. And, what do you mean by failed to start ? It crashes, nothing appear, it hangs, ... ?
Provide also details about what you did. And also check with your debugger to see what's happening.
|
|
|
|
|
Perhaps you have to choose the Rebuild All command of Visual Studio.
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.
|
|
|
|
|
thanks !
Bravoone
|
|
|
|
|
Hi
All
I am creating application in VC++ 6.0 with unicode support.I saw no of articals in code project but these articals not explains about how to create marathi menu and captions.I don,t want single letter of english in my application window.
M.Atul
|
|
|
|
|
M. Atul wrote: how to create marathi menu and captions
I think This[^] link will help you..
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
Haven't been coding C for awhile --- I want a string tokenizer, any good suggestion? Thanks.
Norman Fung
|
|
|
|
|
Hi,
Try this:
char *strtok(
char *strToken,
const char *strDelimit
);
-----------
Mila
|
|
|
|
|
How to use WM_SYSKEYDOWN for Alt+Selection?
|
|
|
|
|
Hello ,
Choose the "PreTranslateMessage" function of your dialog class from ClassWizard and include the following code in it...
BOOL YourDlgClass::PreTranslateMessage(MSG* pMsg)
{
if (pMsg->message == WM_SYSKEYDOWN) // ALT key combinations
{
switch (pMsg->wParam)
{ // ... case statements for each key being trapped
case 'T' : //for key combination ALT + T
//write your code here
break;
default : // unhandled keystroke
return CDialog::PreTranslateMessage(pMsg);
break;
}
return TRUE; // msg is processed
}
return CDialog::PreTranslateMessage(pMsg);
}
vinsankar
|
|
|
|
|
Hi all,
I have a MySQL server running on a linux that is working properly, and i have errors trying to connect to the server on a windows NT client using ODBC. The error i am getting is Can't connect to MySQL 10060. The driver i am using is ODBC 3.51,(i wish to create a vb app using the driver to access the database) I am quite sure that the parameters that i specified for the host name etc are correct. I even downloaded the MySQL control centre to test the connection to the MySQL linux server, but it still doesnt work. I tried using the same ODBC driver and the same windows client to connect to another dummy MySQL server running on a remote windows PC and it works. Also I have a website coded in PHP that can access the MySQL database on any windows pc, so it couldn't possibly be that the MySQL server blocks out my clients IP address right?
Please help Thanks in advance
andy
-- modified at 1:35 Monday 27th November, 2006
|
|
|
|
|
firebow3007 wrote: i wish to create a vb app using the driver to access the database
Wrong forum.
firebow3007 wrote: I even downloaded the MySQL control centre to test the connection to the MySQL linux server, but it still doesnt work.
Sounds like IPTables or some other firewall (is there even another firewall for *Nix) is blocking access to the *Nix server. Check the firewall settings...
I'd love to help, but unfortunatley I have prior commitments monitoring the length of my grass. :Andrew Bleakley:
|
|
|
|
|
Hi,
I want to know whether it's possible to use a activex control in a dialog that is inside a MFC extension DLL?
I used the crystal reports viewer control in a CDialog and wrote in the InitInstance to open a report file and store the report pointer in a member variable (to get it later). But the problem was, when i debug it seems the controll never goes to InitInstance. Then i overrided the DoModal method and put the same code there; but still the report doesn't seem to open. I have the same code perfectly working in a non DLL project. I thought this is something wrong with the project settings becos the AppWizard never asks whether i want to use Activex controlls.
Any Crystal Reports experts please help.
Any other experts pls answer only to my first question..
|
|
|
|
|
Question 1
In my program (a MFC project), how to obtain the status of system memory, say, available mem space, etc.
Question 2
How to obtain the ProcessID of my program . I would like to use the ProcessID in the program.
|
|
|
|
|
Hello,
you can use the following function to get the process ID.
DWORD GetCurrentProcessId(VOID);
The GetCurrentProcessId function returns the process identifier of the calling process.
Use the following function to get the System Information,
VOID GetSystemInfo(
LPSYSTEM_INFO lpSystemInfo // system information
);
This function returns information about the current system.
Search MSDN , If you want to know more about these functions.
vinsankar
|
|
|
|
|
you can use GlobalMemoryStatus for getting info about available mem space
|
|
|
|
|
Hi
How can i write a mouse driver for PS2 mouse.
This driver should run on any platform.
I it is by using DDK, then please direct me to some link wer from i can get it free.
hope to get some answers soon
bye
pitchu
|
|
|
|
|
Why do you need to write a PS2 mouse driver as that comes with windows. If you need a filter driver you can use src\input\moufiltr example in DDK source. that will help you alot to start with.
Dhirendra
|
|
|
|