|
What about CWnd::SetCaretPos ?
|
|
|
|
|
That may cause a visual indication, but the underlying edit control will maintain its last insertion point.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Thanks for the sugestion. At least I now know that blinking cursor is called a caret.
|
|
|
|
|
You could do this:
CEdit *pEdit = static_cast<CEdit *>( GetDlgItem( IDC_THE_EDIT_BOX ) );
int iLength = pEdit->GetWindowTextLength();
pEdit->SetSel( iLength, iLength );
|
|
|
|
|
This is indeed a great method! works nice n sweet. Thanks.
|
|
|
|
|
The SetSel(...) solution is the best, IMHO, although I question the habit of casting the return of CWnd::GetDlgItem(...) unless you really know what you are doing...
You should investigate the MA_NOACTIVATE return value from processing the WM_MOUSEACTIVATE message. I believe that is how you can get an on-screen keyboard to not cause kill focus events to be sent to another window when it is is being used. You may have to rely on mouse position as opposed to button click events if you do this.
Peace!
-=- James Please rate this message - let me know if I helped or not!<HR> If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! See DeleteFXPFiles
|
|
|
|
|
Thanks for your input. the SetSel method has worked well for me. Dint investigate the WM_MOUSEACTIVATE method as using mouse position may complicated matters for me. anyway, thanks!;)
|
|
|
|
|
Hi All,
I have a little doubt about templates, and no compiler to test this.
Is it possible to have a template member function in a class that is not template, or even a global template function ??
i'm puzzling as i just thought to this...
thanks for your answers guyz
|
|
|
|
|
yes
never say die
|
|
|
|
|
that's a very pragmatic answer, but thanks ! lol
|
|
|
|
|
toxcct wrote: Don't know where to start ?
Refer the Forums Guidelines and ask a friend
(Couldn't resist...)
The answer to your question is 'yes' and Google-ing for "template function" generated these[^] results where the first result screen contains links for code examples of at least template functions that are not class members.
"It's supposed to be hard, otherwise anybody could do it!" - selfquote
|
|
|
|
|
Roger Stoltz wrote: (Couldn't resist...)
shame on me ! lol
actually, i asked here because i know that Valuable programmers are here, and will be able to explain things easily.
|
|
|
|
|
toxcct wrote: even a global template function
If I got you right you can have global template functions.
|
|
|
|
|
Dear All,
My problem is that I am sending huge bytes (77 KB) to remote host. But my program sends only 74 KB. How do i resolve this?.
Kindly help me.
Thanks.
|
|
|
|
|
Try sending 80KB. Then it should send 77KB
Just kidding.
How do you know how many bytes are being sent?
Mark
|
|
|
|
|
Do not know if this will work, but you could try looping until all bytes have been sent
Something like:
do
{
bytes = send(......);
} while(bytes < NUMBER_OF_BYTES_TO_SEND);
|
|
|
|
|
How can I include version information in the compiled executable file?
|
|
|
|
|
see the Version component in the resource tab
|
|
|
|
|
I am using VS.NET 2005 to build a Windows Form Application (not MFC). I found a ACL editor program from codeproject.com which I want to incorporate in my application. It has two dll files, FilePermsBox.dll and FilePermsBox.Interop.dll
In section "16. FilePermsBox API" of the article http://www.codeproject.com/win32/accessctrl4.asp, it was mention that the author has rewritten wrappers to allow the program to be called using OLE automation.
I have little knowledge on OLE automation and hence I just tried adding FilePermsBox.Interop.dll as references. This allow me to compile the following code.
array<string^>^ fCollection = gcnew array<string^, 1="">{"C:\test.txt"};
ManagedSecurityBoxWrapper::IManagedSecurityBoxWrapper^ sb = gcnew ManagedSecurityBoxWrapper::ManagedSecurityBoxWrapper();
sb->FileNames = fCollection;
sb->COSecurityBox1(false);
However during runtime I will encounter the following error when ManagedSecurityBoxWrapper constructor is invoked.
An unhandled exception of type 'System.TypeInitializationException' occurred in System.Windows.Forms.dll
Additional information: The type initializer for '<module>' threw an exception.
Is there anything else I need to add in project properties to use it or can someone enlighten me on how to use OLE automation to call this API. I will be more than grateful if someone is willing to download the dlls from codeproject.com under the link
http://www.codeproject.com/win32/accessctrl4/filepermsbox111.zip[^]
and try it out, letting me know whether this is even possible. Thanks a million!
|
|
|
|
|
Hi guys, i am totally new to C programming and i just came over a simple problem which i couldn't solve because i'm not have basic in programming but love to learn it.
this is what surrounded me...
1) A sequence of number, e.g 1120060002600000000790123904122006 (34 digits)
2) i need to view just certain slots of digit from 7th-12th as a record
3) Then from 13th-26th as a values. This getting worse when it come miscounted the numbers.
4) do anyone know how to solve this and kindly can come up with simple code which could read the input and just display the outputs in slots of digits.
5) i am sick of this things.
love it but hardly to own it
-- modified at 4:06 Thursday 18th January, 2007
|
|
|
|
|
chks wrote: 1) A sequence of number,
2) i need to view just certain slots of digit from 7th-12th as a record
3) Then from 13th-26th as a values. This getting worse when it come miscounted the numbers
What is a record (in this context)?
What are values (if not numbers)?
How could you possibly find out if the numbers are miscounted?
If you could find out, could you do anything about it other than rejecting the whole string?
Do you really have to use C, or could you use C++? Or a .NET-Language?
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
Thanks jhwurmbach for replying,
1) as an example there is, ABCDEFGHIJKLMNOPQ
then, from this alphabet, i just need to view DEFG only a record
2) The values are actually the numbers in that sequenced directly.
3) Miscounted, maybe, miswatched such as supposed to be DEFG but CDEF.
4) It seems i'm doing it manually now. perhaps, C is better for newbie like me.
|
|
|
|
|
chks wrote: 1) as an example there is, ABCDEFGHIJKLMNOPQ
then, from this alphabet, i just need to view DEFG only a record
2) The values are actually the numbers in that sequenced directly.
3) Miscounted, maybe, miswatched such as supposed to be DEFG but CDEF.
4) It seems i'm doing it manually now. perhaps, C is better for newbie like me.
Re: 4) Do you really think that C as opposed to C++, C# or even VisualBasic is the right language to start? Do you have read any beginners literature about C?
So, you got a string consisting of your digits or letters.
In C, that would be a char* (or a wchar_t* if you have Unicode).
You can now use the C-Runtime (short CRT) string manipulation (as described in every C-beginners guide or even in the MSDN) to extract the parts you want.
Here, you could add 3 to the pointer and then use strncpy (or wcsncpy in unicode) to copy the next 4 characters, giving you "DEFG".
About the miscounting, you need to define the rules on which you can determine if there has miscounting occured.
Something like:
"Too short",
"There MUST be a '-' at position 7",
There can only ever be a '0' at position 3".
These rules you can check.
So, go ahead and try!
If you have produced some source you may come back and present it here.
--fixed typos and formatting
"We trained hard, but it seemed that every time we were beginning to form up into teams we would be reorganised. I was to learn later in life that we tend to meet any new situation by reorganising: and a wonderful method it can be for creating the illusion of progress, while producing confusion, inefficiency and demoralisation."
-- Caius Petronius, Roman Consul, 66 A.D.
|
|
|
|
|
chks wrote: 1) A sequence of number, e.g 1120060002600000000790123904122006 (34 digits)
2) i need to view just certain slots of digit from 7th-12th as a record
char *pSequence = "1120060002600000000790123904122006";
char szRecord[7] = {'\0'};
strncpy(szRecord, &pSequence[6], 6);
chks wrote: 3) Then from 13th-26th as a values.
char szValue[15] = {'\0'};
strncpy(szValue, &pSequence[12], 14);
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
main()
{
char *pSequence = "1120060002600000000790123904122006";
char szRecord[6] = {'\0'};
strncpy(szRecord, &pSequence[6], 6);
/*printf("\n%d\t",szRecord); actually the output should be 000260 but 2293584 */
char szValue[15] = {'\0'};
strncpy(szValue, &pSequence[13], 14);
/*printf("%d\n",szValue); actually the output should be 00000007901239 but 2293568*/
}
sorry, i am very new to C,and trying to learn it
|
|
|
|