|
Is there anybody having coding realted to enahnced write filter
|
|
|
|
|
|
sorry there was typing mistake
Enhanced Write Filter coding
|
|
|
|
|
sorry there was typing mistake
Enhanced Write Filter coding
|
|
|
|
|
|
Hi
Can anyone tell me how i can set the position of the cursor in an Edit Control
i want to place a space after the user enters a full stop, im using the below, but this just
puts the cursor back to the start, rather than the end
CString csText, csText2;
m_c_sms.GetWindowText( csText );
csText2 = csText.Right(1);
if (csText2 ==".")
{
csText = csText+" ";
m_c_sms.SetWindowTextA(csText);
}
|
|
|
|
|
where you asking this yesterday[^] ??
also :
si_69 wrote: m_c_sms.SetWindowTextA(csText);
don't use SetWindowTextA() but SetWindowText() .
BTW, AFAIK, you can use CEdit::SetSel(end, end);
TOXCCT >>> GEII power
[VisualCalc 3.0 updated ][Flags Beginner's Guide new! ]
|
|
|
|
|
use m_edit.SetSel(pos, pos, TRUE);
Do the chickens have large talons?
|
|
|
|
|
Hai to all,
i am connecting to Access DataBase
In one case i want to delete all rows in my table
so that i have written a code like this
cData1 is a class derived from CRecordSet.
CData1 rs;
rs.Open();
rs.MoveFirst();
while(!rs.IsEOF())
{
rs.Delete();
rs.MoveNext();
rs.Update();
}
rs.Close();
It is giving error like this
Attempt to update or delete failed
can any one help me plsssssssss
thanks in advance
B.LakshmiPathiRao.
VC++ Programer
-- modified at 2:19 Thursday 20th July, 2006
|
|
|
|
|
LakshmiPathiRao wrote: rs.MoveNext();
rs.Update();
I believe these are in the wrong order.
Why not something simple like:
CDatabase db;
db.ExecuteSQL("DELETE FROM table);
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I guess it is to do with Update.
See MSDN help. It say's
Unlike AddNew and Edit, a call to Delete is not followed by a call to Update.
Fortitudine Vincimus!
|
|
|
|
|
How can I call a .exe file in a c/c++(not MFC) project?
thx,
L Zhang
|
|
|
|
|
ShellExecute
system
WinExec
CreateProcess
|
|
|
|
|
mwolf122 wrote: How can I call a .exe file
You mean launching an exe, no ? If yes, see the FAQ[^]
Cédric Moonen
Software developer
Charting control
|
|
|
|
|
|
|
I want to use timers do some actions.
I read about
UINT SetTimer(HWND hWnd, UINT nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc );
versus the
CWnd::SetTimer, UINT nIDEvent, UINT uElapse, TIMERPROC lpTimerFunc );
There is a nice document here explaining some facts. However, I still have some questions about who is handling the timers.
I want to create and handle the timers inside a CScrollView (by mapping and overwriting the inherited CWnd::OnTimer(UINT nIDEvent) and not via a TIMERPROC.
However, I am not sure which timer creation function to use and what value will be good for the nIDEvent on them.
i. How do I guarantee that the CScrollView which created the timer is the one that receives the WM_TIMER message (and subsequently process it). Is it possible that the
WM_TIMER expiration message ends up on another queue (I found that this is possible for mouse messages) or only the creating window can get it?
ii. Is the nIDEvent identifier a system unique one or a view unique one? How do I get a sufficiently unique nIDEvent value to make sure that I am processing the right timer?
iii. Is it possible that my CScrollView will receive time outs (i.e. WM_TIMER messages) by other views or even other threads or applications and under which conditions? If yes what should I do with those timers?
iv. Any idea why SetTimer may fail? Is this due to a system limit on running timers or due to a non unique nIDEvent? How can I know?
Dimitris
|
|
|
|
|
i. If you do "this->SetTimer(100, 2000, NULL)" inside your CScrollView class it will use the handle for your view.
ii. It is unique to your view. How many timers are you planning on using? If just one declare a constant.
iii. Yes if some sends the WM_TIMER message to that view. Really shouldn't happen though.
iv. How do you know it's failing?
|
|
|
|
|
Thanks a lot. It clarifies a lot of things.
Thus, I can be sure that my view and only this will handle the timers. My plans are to use one timer primarely but there are some rare cases that I may have two running similtaneously. However, if their ids are view unique ones I can use constants to guarantee uniquness and I am assuming that noone sends to my view a WM_TIMER message (according to what you said it sounds a reasonable assumption. Note that the thread will have more than one CScroll views of the same or different type).
According to my reading SetTimer indicates failure if it returns zero. Thus, I know that it is failed to create a timer. But it seems to me that this is due to system resources limits thus, nothing that I can do about it.
Well, was quite helpfull clarifying these points, hope now that they will work like these.
Dimitris...
|
|
|
|
|
Hello,
do you have:
ON_WM_TIMER()
in your Messagemap included??
than you have to call the function like this:
<br />
int SomeOtherFunc()<br />
{<br />
nIDEvent = SetTimer(iTimerIdentifier, iIntervalMiliSecond,0);
nIDEvent = SetTimer(2, 1000,0);<br />
}<br />
afx_msg void MyAppDlg::OnTimer(UINT nIDEvent)<br />
{<br />
switch(nIDEvent)<br />
{<br />
case 1:<br />
{<br />
...<br />
break;<br />
}<br />
case 2:<br />
{<br />
<br />
...<br />
break;<br />
}<br />
default:<br />
break;<br />
}<br />
}<br />
<br />
....<br />
give peace of code to see what you coding to set and start timer!
break;
-- modified at 11:13 Wednesday 19th July, 2006
|
|
|
|
|
hi all,
when i switch from one CFormView to Another CFormView, I am observing that my menu items for the second form are Disabled. I cant Understand why this is Happen when i switch from one view to another.
//---------Code -----------------------------------//
void CMainFrame::SwitchView()
{
CView *pOldView;
CView *pNewView;
pOldView = GetActiveView();
if (m_pCFirstView == NULL)
m_pCFirstView = pOldView;
if (m_pCSecondView == NULL)
{
CRuntimeClass *pCR = RUNTIME_CLASS(CSecondView);
m_pCSecondView = static_cast<cview*>(pCR->CreateObject());
m_pCSecondView->Create(NULL,NULL,AFX_WS_DEFAULT_VIEW,rectDefault,this,AFX_IDW_PANE_FIRST+1,NULL);
}
if (m_bFirstViewActive)
pNewView = m_pCSecondView;
else
pNewView = m_pCFirstView;
int nChildId = pNewView->GetDlgCtrlID();
pNewView->SetDlgCtrlID(AFX_IDW_PANE_FIRST);
pOldView->SetDlgCtrlID(nChildId);
CDocument *pDoc = pOldView->GetDocument();
pDoc->AddView(pNewView);
pDoc->RemoveView(pOldView);
SetActiveView(pNewView);
RecalcLayout();
pNewView->ShowWindow(SW_SHOW);
pOldView->ShowWindow(SW_HIDE);
m_bFirstViewActive = !m_bFirstViewActive;
}
//-----------------------------//------------------------------------//
Every thing is Ok but the Menu Items are Enabled when i transform from View to Another View. Please Provide me good Solution.
is there any Custom Command Routing for this.
please help me out.
uday.
-- modified at 7:36 Wednesday 19th July, 2006
|
|
|
|
|
Do you have UI updating defined only in one view, then?
Normally the view will get a crack at updating menu item states. If there's no handler, and no update handler, a menu item will get disabled.
Steve S
Developer for hire
|
|
|
|
|
hi steve,
Should i take Command Handlers in View or CFrameWnd, Shall i take in What order to this Problem.
Please help me out.
uday.
|
|
|
|
|
You can handle commands (and hence UI updating) in any of:
Frame - if you've derived your own frame window
Document - even though it isn't a window!
View - the active one
There is a series of articles in MSJ (now MSDN magazine) which you should still be able to find at the MSDN website, that explain how the routing works in some depth. Essentially, it's up to you as the app designer to determine where the appropriate/correct place for handlers is. For example, handling File/Print would generally be in the document class (since it applies irrespective of the view), whereas edit menu items tend to be managed by the view. If you have multiple views (either SDI switching or MDI) then it is perfectly possible that you have handlers in each view. However, only one of these handlers/UI updates will be called, and it will be the one in the object associated with the active view.
Steve S
Developer for hire
|
|
|
|
|
plz tell me answer for this
i want to know is this code work when i click tab1 on tab control
i try this but not do the work.
void CGouravDlg::OnSelchangeTab1(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
CBrush brush;
CDC *pDC;
if(BN_CLICKED(IDC_TAB1))
{
brush.CreateSolidBrush(RGB(100,0,0));
pDC->SetBkColor(RGB(100,0,0));
// m_tab.SendMessage(WM_PAINT,0L,0L);
}
*pResult = 0;
}
Ashish Dogra
MCA
Noida
-- modified at 7:24 Wednesday 19th July, 2006
|
|
|
|