|
Another option is to use CRichEditCtrl::SetSel[^] to set the 'carret' position (in fact, the text which is selecetd in the control, if nStartChar is equal to nEndChar, then, you specify a carret position). You can then use CRichEditCtrl::ReplaceSel[^] to replace the text which is selected (ans thus, insert text also).
|
|
|
|
|
yes this is a good approach
actually i am doing multilevel undo/redo for richedit ctrl(CRichEditCtrl)
and when i searched on codeproject i didn't got any undo redo code for CRichEditCtrl.
so currently i am making dynamic stack in which i am storing the caret position and the character.in OnChar handler.
and i am thinking that when user will say undo i will pop one frame and will insert that character in the rich edit control at that position.
Is it a good approach??
and is there no other API that will just take the character and caret position o insert the character??
Thanks and regards
Harshal shete
|
|
|
|
|
CString m_str;
m_richedit.GetWindowText(m_str);
m_str.Insert( Index, "string to be inserted" );
m_richedit.SetWindowText (m_str);
akt
|
|
|
|
|
ooh sorry pls ignore the above reply
thanks
akt
|
|
|
|
|
Hi all,
I want to make a server with the use of turbo c 64 bit. I tried to search turbo c compiler but i did not. If you have any idea about it plz plz plz rply me as soon as possible its urgent.
Thank you in advance.
|
|
|
|
|
|
Hi Friends,
In my application I want to convert BMP image to PNG and JPEG Image format, I never worked on converting one image format to another, can any one guide me how can I achive this.
Or if there is any sample code available for this.
Thanks in advance,
Dinesh
|
|
|
|
|
You can read your pictrue(bmp) with CImage class and use from save
|
|
|
|
|
see :
http://www.codeproject.com/script/comments/forums.asp?msg=1664120&forumid=1647#xx1664120xx
|
|
|
|
|
I have to launch from my code some third party program that may result in system restart. In case that the system restart is not performed immediately (for example with <shutdown t="" 30="" s="">), I need my program to terminate and prevent the user from cotinue running my program in the time remaining till shutdown.
Question: How can I detect that <system shutdown=""> was issued?
(I tried to start some process from my code an get the error code informing that the system shutdown is pending, but this solution is buggy, since I do not know which process can i start on user's machine and in case that there is no system shutdown pending it looks ugly - console opens, etc.)
|
|
|
|
|
All top-level windows receive a WM_QUERYENDSESSION message when a logoff/shutdown/restart is initiated. If no app cancels the action, windows get WM_ENDSESSION to indicate that the system is shutting down.
|
|
|
|
|
Thanks,
but the problem is I can not poll in a loop.
I need to run a single query when I got the control back from the T.P. program I'm running from my code.
Any ideas?
|
|
|
|
|
You don't poll to get those notifications, they arrive in the message queue like any other messages.
|
|
|
|
|
The problem is that I can't listen to the message pipe. I need a single method cal to guery OS "is there a shutdown pending or not". That's the situation. Any ideas?
|
|
|
|
|
Big problem,
Is it possible to upload files to www.something.com if I have the username and password? I need to send files from my program to our web server. Please help me. Thanks!
|
|
|
|
|
|
can any can say the solution for this
Unhandled exception 0xC0000005: Access violation reading location.
|
|
|
|
|
u are allocating undersize memory to buffer
|
|
|
|
|
Not necessarily...
The OP has code which is trying to access memory that isn't allocated at all, or is trying to write to memory that is read-only - note that this is not hardware related, it's a memory management thing.
Things to do:
use the 'debug' command to run the app and find out where the bad code is.
look for pointers that are being used, but not being initialised/set correctly.
For example,
LPTSTR text = NULL;
or just
LPTSTR text;
The compiler won't flag the first case with 'used but not initialised', but it would generate an AV error (deliberately).
Steve S
Developer for hire
|
|
|
|
|
how can i add CStrings in fetch because it supports only long* ?
Bravoone
|
|
|
|
|
Flaviu_2006 wrote: how can i add CStrings in fetch because it supports only long* ?
Can you give some more details on your problem?
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
I dont understand ur question??
akt
|
|
|
|
|
Could you be more specific
|
|
|
|
|
// Field/Param Data
// field data members
long* m_rgID;
LPSTR m_rgName;
// pointers for the lengths
// of the field data
long* m_rgIDLengths;
long* m_rgNameLengths;
// input parameter data member
CString m_strNameParam;
void MultiRowSet::DoBulkFieldExchange( CFieldExchange* pFX )
{
// call the Bulk RFX functions
// for field data members
pFX->SetFieldType( CFieldExchange::outputColumn );
RFX_Long_Bulk( pFX, _T( "[colRecID]" ),
&m_rgID, &m_rgIDLengths );
RFX_Text_Bulk( pFX, _T( "[colName]" ),
&m_rgName, &m_rgNameLengths, 30 );
// call the RFX functions for
// for parameter data members
pFX->SetFieldType( CFieldExchange::inputParam );
RFX_Text( pFX, "NameParam", m_strNameParam );
}
And i want to add CStrings because my field data are :
CString m_listare;
CString m_carte;
how to do this with CStrings ?
RFX_Long_Bulk( pFX, _T( "[colRecID]" ),
&m_rgID, &m_rgIDLengths );
RFX_Text_Bulk( pFX, _T( "[colName]" ),
&m_rgName, &m_rgNameLengths, 30 );
Bravoone
|
|
|
|
|
CString m_listare;
CString m_carte;
CString csTemp = m_listare + m_carte; // Add two CStrings
Akt_4_U
|
|
|
|