Click here to Skip to main content
16,005,339 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Early and late binding VC++/C++ Pin
led mike17-May-06 19:20
led mike17-May-06 19:20 
Questionwhile Debugging Pin
Krishnatv17-May-06 19:10
Krishnatv17-May-06 19:10 
AnswerRe: while Debugging Pin
Hamid_RT17-May-06 19:13
Hamid_RT17-May-06 19:13 
AnswerRe: while Debugging Pin
led mike17-May-06 19:16
led mike17-May-06 19:16 
GeneralRe: while Debugging Pin
Krishnatv17-May-06 21:24
Krishnatv17-May-06 21:24 
GeneralRe: while Debugging Pin
led mike18-May-06 6:16
led mike18-May-06 6:16 
AnswerRe: while Debugging Pin
ThatsAlok17-May-06 20:20
ThatsAlok17-May-06 20:20 
Questionrandom shuffle() Pin
makaveli_0717-May-06 19:09
makaveli_0717-May-06 19:09 
can i use random shuffle function in MFC application coding...i tried to use but it is not working...if anyone knows how to apply it please tell me..

<code>// coneverterDlg.cpp : implementation file
//



void CConeverterDlg::OnEnter()
{
// TODO: Add your control notification handler code here

CString str;
// char str[13];
cEdit.GetWindowText (str);
//AfxMessageBox(myStr);



//tmStart = time(0);


CTime time=CTime::GetCurrentTime ();
CString strttime= time.Format ("%Y%m%D%H%M%S");
cEdit2.SetWindowText (strttime+"\n");//;(str)
cEdit2.SetWindowText (strttime+"\n");


string line(str);
//line.c_str (),100);
//fin.open("data.txt");
// cout << str<<endl;



for (int i=0; i<500; ++i)
{
random_shuffle(line.begin(), line.end());
// File << "Randomised: " << line << endl;
// File << " : " << line << endl;
// File << " : " << line << endl;
// File << " : " << line << endl;
// File << " "<< endl;

// File << "Single Row: " << s << " " << s << " " << s <<" " << s << endl;
// File << " "<< endl;
CString cStr(line.c_str ());

cEdit1.SetWindowText ( cStr + "\n");
cEdit1.SetWindowText ("Randomised: "+ cStr + "\n");


//tmEnd = time(0);

}
CTime time1=CTime::GetCurrentTime ();
CString strtti= time1.Format ("%Y%m%D%H%M%S");
cEdit1.SetWindowText (str);
cEdit1.SetWindowText (strtti+"\n");
//cout << tmEnd-tmStart << " seconds " << endl;





}

</code>

-- modified at 2:25 Thursday 18th May, 2006.." menu item to system menu.

// IDM_ABOUTBOX must be in the system command range.
ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
ASSERT(IDM_ABOUTBOX < 0xF000);

CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDS_ABOUTBOX);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
}
}

// Set the icon for this dialog. The framework does this automatically
// when the application's main window is not a dialog
SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

// TODO: Add extra initialization here

return TRUE; // return TRUE unless you set the focus to a control
}

void CConeverterDlg::OnSysCommand(UINT nID, LPARAM lParam)
{
if ((nID & 0xFFF0) == IDM_ABOUTBOX)
{
CAboutDlg dlgAbout;
dlgAbout.DoModal();
}
else
{
CDialog::OnSysCommand(nID, lParam);
}
}

// If you add a minimize button to your dialog, you will need the code below
// to draw the icon. For MFC applications using the document/view model,
// this is automatically done for you by the framework.

void CConeverterDlg::OnPaint()
{
if (IsIconic())
{
CPaintDC dc(this); // device context for painting

SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);

// Center icon in client rectangle
int cxIcon = GetSystemMetrics(SM_CXICON);
int cyIcon = GetSystemMetrics(SM_CYICON);
CRect rect;
GetClientRect(&rect);
int x = (rect.Width() - cxIcon + 1) / 2;
int y = (rect.Height() - cyIcon + 1) / 2;

// Draw the icon
dc.DrawIcon(x, y, m_hIcon);
}
else
{
CDialog::OnPaint();
}
}

// The system calls this to obtain the cursor to display while the user drags
// the minimized window.
HCURSOR CConeverterDlg::OnQueryDragIcon()
{
return (HCURSOR) m_hIcon;
}



void CConeverterDlg::OnEnter()
{
// TODO: Add your control notification handler code here

CString str;
// char str[13];
cEdit.GetWindowText (str);
//AfxMessageBox(myStr);



//tmStart = time(0);


CTime time=CTime::GetCurrentTime ();
CString strttime= time.Format ("%Y%m%D%H%M%S");
cEdit2.SetWindowText (strttime+"\n");//;(str)
cEdit2.SetWindowText (strttime+"\n");


string line(str);
//line.c_str (),100);
//fin.open("data.txt");
// cout << str<<endl;



for (int i=0; i<500; ++i)
{
random_shuffle(line.begin(), line.end());
// File << "Randomised: " << line << endl;
// File << " : " << line << endl;
// File << " : " << line << endl;
// File << " : " << line << endl;
// File << " "<< endl;

// File << "Single Row: " << s << " " << s << " " << s <<" " << s << endl;
// File << " "<< endl;
CString cStr(line.c_str ());

cEdit1.SetWindowText ( cStr + "\n");
cEdit1.SetWindowText ("Randomised: "+ cStr + "\n");


//tmEnd = time(0);

}
CTime time1=CTime::GetCurrentTime ();
CString strtti= time1.Format ("%Y%m%D%H%M%S");
cEdit1.SetWindowText (str);
cEdit1.SetWindowText (strtti+"\n");
//cout << tmEnd-tmStart << " seconds " << endl;





}

</code>
Questiontype of File Pin
Anilkumar K V17-May-06 18:31
Anilkumar K V17-May-06 18:31 
AnswerRe: type of File Pin
Joe Woodbury17-May-06 18:44
professionalJoe Woodbury17-May-06 18:44 
Questionplacing and fetching windows controls from the dll Pin
raghuji.rao17-May-06 18:26
raghuji.rao17-May-06 18:26 
AnswerRe: placing and fetching windows controls from the dll Pin
_AnsHUMAN_ 17-May-06 19:48
_AnsHUMAN_ 17-May-06 19:48 
QuestionMoving controls center via programming Pin
raghuji.rao17-May-06 18:23
raghuji.rao17-May-06 18:23 
AnswerRe: Moving controls center via programming Pin
Sarath C17-May-06 18:30
Sarath C17-May-06 18:30 
GeneralRe: Moving controls center via programming Pin
raghuji.rao17-May-06 18:37
raghuji.rao17-May-06 18:37 
GeneralRe: Moving controls center via programming Pin
Ryan Binns17-May-06 18:47
Ryan Binns17-May-06 18:47 
AnswerRe: Moving controls center via programming Pin
Stephen Hewitt17-May-06 19:18
Stephen Hewitt17-May-06 19:18 
GeneralRe: Moving controls center via programming Pin
raghuji.rao17-May-06 23:24
raghuji.rao17-May-06 23:24 
QuestionListBox problem Pin
Sarath C17-May-06 18:10
Sarath C17-May-06 18:10 
AnswerRe: ListBox problem Pin
Hamid_RT17-May-06 19:10
Hamid_RT17-May-06 19:10 
AnswerRe: ListBox problem Pin
Steve Echols17-May-06 19:21
Steve Echols17-May-06 19:21 
QuestionHow to check whether a directory is write protected or not? Pin
Cool Ju17-May-06 18:05
Cool Ju17-May-06 18:05 
AnswerRe: How to check whether a directory is write protected or not? Pin
Sarath C17-May-06 18:16
Sarath C17-May-06 18:16 
AnswerRe: How to check whether a directory is write protected or not? Pin
Cool Ju17-May-06 18:28
Cool Ju17-May-06 18:28 
AnswerRe: How to check whether a directory is write protected or not? Pin
led mike17-May-06 19:08
led mike17-May-06 19:08 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.