|
Click on your form in your resources.then in the property of your form change the font then all your control have the same new font.
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Thanks Mazy.
Marcus
Make no little plans; they have no magic to stir your blood to action. Make big plans, aim high in work and hope
-- Daniel Burnham
|
|
|
|
|
I have a form view and there are some controls,I need something like "Anchor" property.I mean when I change the size of forms my controls always have the same distance from left or right.
How can I gain this?
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
|
Thanks Joaquin
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
|
Thanks,I check it now
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
Anyone have a code snippet that returns a string of the current NT Domain where the user authenticated? I know there's a utility in the NT/Win2K Resource Kit that returns something like:
MYDOMAIN\myuser
in the output...but I'm not sure where they're getting that info from (where "MYDOMAIN" is the name of the domain the user logged-in to, and "myuser" is the username that they used).
Also, if anyone knows how this translates when moving to AD, I'd appreciate any info.
Thanks in advance!
--AJ
|
|
|
|
|
GetUserName() return the user name
Mazy
"So,so you think you can tell,
Heaven from Hell,
Blue skies from pain,...
How I wish,how I wish you were here." Wish You Were Here-Pink Floyd-1975
|
|
|
|
|
That's the easy part. Now how do you determine where the user authenticated? (i.e. local host, NT Domain, etc.)
I need the "context" of the user's authentication.
Thanks for the reply...good quote...
--AJ
PS: I see a "GetUserNameEx" for Win2K and later...it would do what I need (I think), but I need some kind of compat. with NT4 and probably Win98 as well.
|
|
|
|
|
The follwing KB articles may be helpful:
Q111544 HOWTO: Retrieve Current User and Domain Names on Windows NT
Q155698 HOWTO: Retrieve Current User and Domain Names on Windows 95 and Windows 98
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
PERFECT!
Thanks.
--AJ
|
|
|
|
|
How do to move the cursor ("|") into a CEdit?
Thanks
|
|
|
|
|
Assuming you've set focus to the edit control (by calling SetFocus() ), you should be able to select an empty portion of the text (starting at the location of interest) using SetSel() . So, to position the cursor at the 3rd char, try:
CEdit* pEdit = (CEdit *) GetDlgItem (IDC_EDIT);
ASSERT (pEdit != NULL);
pEdit->SetFocus();
pEdit->SetSel (2, 2, TRUE);
/ravi
"There is always one more bug..."
http://www.ravib.com
ravib@ravib.com
|
|
|
|
|
Alright in my MDI ap I have CFormViews. I know how to set the child frame initialy to fit the form. What I would like to do is keep it that way.
So what would be the easiest way to prevent the child frame that wraps the form from being resizeable by the user?
I have seen some solutions that invlove removing the client edge but I want it to stay looking the way it does (like a regular window).
Thx,
Richard
|
|
|
|
|
You can override the function for WM_NCHITTEST. Call the default implementation and then if it returns one of the borders, then return HTBORDER.
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
You can have it the other way around (resize the parent to fit the child view) with CScrollView::ResizeParentToFit . As for having your frame window unresizable, add this PreCreateWindow handler:
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
cs.style&=~WS_SIZEBOX&~WS_MAXIMIZEBOX;
return CFrameWnd::PreCreateWindow(cs);
}
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
That did it! Perfect thanks again!
Thx,
Richard
|
|
|
|
|
Bah, that was TOO easy. Programming shouldn't be that easy!!!!
Tim Smith
I know what you're thinking punk, you're thinking did he spell check this document? Well, to tell you the truth I kinda forgot myself in all this excitement. But being this here's CodeProject, the most powerful forums in the world and would blow your head clean off, you've got to ask yourself one question, Do I feel lucky? Well do ya punk?
|
|
|
|
|
I think fixing the size in the WM_GETMINMAXINFO message handler is the easiest way.
Michael
|
|
|
|
|
How to make spin control work with double or float data types?
|
|
|
|
|
This is fairly easy to do. Do the following steps:
1: Set the range of value: If you want a step of 0.1 and a min equal to 0.0 and a max equal to 10.0, the range of value of your spin control must be 0-100 (100 = 10/0.1)
2: Add a message handler for WM_VSCROLL
void CDialog::OnVScroll ( UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
if (nSBCode == SB_ENDSCROLL)
return ;
if (pScrollBar->GetDlgCtrlID() === IDC_SPIN)
{
CString strValue ;
strValue.Format("%3.1f", (double)(nPos / 10.0)) ;
((CSpinButtonCtrl*)pScrollBar)->GetBuddy()->SetWindowText(strValue) ;
}
}
Roger Allen
Sonork 100.10016
If I'm not breathing, I'm either dead or holding my breath.
A fool jabbers, while a wise man listens. But is he so wise to listen to the fool?
|
|
|
|
|
In my application i have a debug error message that occurs when i want to delete a pointer.
in the code:
int *pTabBinPort=new int[m_dlgAsset];
.
.
.
.
delete []pTabBinPort;
i do that at the end of a function, and when i do debug test when it arrives to this point a message error box arrives and i could read this message:
Debug error!
Program : D:\CalcRiskPort\Debug\CalcRiskPort.exe
DAMAGE : before Normal block(#74) at 0x00301E20
So, is anybody could explain to me what is the problem?
Thanks in advance for your answers
gerald
|
|
|
|
|
The error means memory got corrupted for some reason. First thing I'd check is whether you're not running out of bounds when writing to pTabBinPort .
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
i don't know if it could help you but i post the entire code of my function:
void CCalcRiskPortDlg::OnCalcvar()
{
UpdateData(TRUE);
::CoInitialize(NULL);
//LoadTables Table;
//LoadTables Table2(m_dlgSector);
double *pTabVar=new double[pow(2,m_dlgAsset)];
CString strValue;
int *pTabBinPort=new int[m_dlgAsset];
int *pTabNumPort=new int[m_dlgAsset];
int k,i;
try
{
LoadTables Table(1,m_dlgSector,1,m_dlgSector);
_ConnectionPtr pConnection=NULL;
CString strTemp;
strTemp.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\\CalcRiskPort\\vol_correl1.mdb;");
_bstr_t strCnn(strTemp);
TESTHR(pConnection.CreateInstance(__uuidof(Connection)));
pConnection->Open(strCnn,"","",adConnectUnspecified);
Table.pCorrel=Table.LoadCorrelation(m_dlgSector,Table.pCorrel,"Correlation");
Table.pVol=Table.LoadVolatility(m_dlgSector,Table.pVol,"Volatilité");
i=0;
for(k=0;k<=m_dlgAsset-1;k++)
{
*(pTabBinPort+k)=0;
Table.ConvertBinToNum(k,pTabBinPort,pTabNumPort);
}
*pTabVar=Table.CalcVar(pTabNumPort,m_dlgAsset);
for(i=1;i<=pow(2,m_dlgAsset);i++)
{
k=m_dlgAsset-1;
while(*(pTabBinPort+k)==1)
{
*(pTabBinPort+k)=0;
Table.ConvertBinToNum(k,pTabBinPort,pTabNumPort);
k--;
}
*(pTabBinPort+k)=1;
Table.ConvertBinToNum(k,pTabBinPort,pTabNumPort);
*(pTabVar+i)=Table.CalcVar(pTabNumPort,m_dlgAsset);
}
pConnection->Close();
}
catch(_com_error &e)
{
AfxMessageBox("a pas bon");
}
m_dlgValue=pTabVar[2];
strValue.Format("%.9f",m_dlgValue);
CEdit* PEdit=(CEdit*)GetDlgItem(IDC_VALUE);
PEdit->SetWindowText(strValue);
delete []pTabBinPort;
delete []pTabNumPort;
delete []pTabVar;
::CoUninitialize();
// TODO: Add your control notification handler code here
}
i hope it help you
regards
|
|
|
|