|
firstly, here is the Link to your message[^]
secondly, fix it very soon or you gonna be declared abusive...
|
|
|
|
|
actually i wanted to send a message n i was just writing it
but due to some reasons i discarded it
now i don knw how this msg appeared on board
i'll check it out
|
|
|
|
|
How can we find a text in RichEditCtrl . i am using CRichEditCtrl and FindText()
is returning only 1st Occurance of that Text .
|
|
|
|
|
Use CHARRANGE , which is member if FINDTEXTEX .
In following example control will be looked for whole range
FINDTEXTEX ft;
ft.chrg.cpMin = 0;
ft.chrg.cpMax = -1;
ft.lpstrText = (LPSTR) lpszmyString;
long n = pmyRichEditCtrl->FindText(FR_MATCHCASE|FR_WHOLEWORD, &ft);
Now if you want to find string betn range 4th char to 7th char yoiu need to mention it like,
FINDTEXTEX ft;
ft.chrg.cpMin = 3;
ft.chrg.cpMax = 7;
ft.lpstrText = (LPSTR) lpszmyString;
long n = pmyRichEditCtrl->FindText(FR_MATCHCASE|FR_WHOLEWORD, &ft);
|
|
|
|
|
Hello All,
I am trying to read a text file & add the words and offset in to map table.
Can anyone please tell me how to calculate the offset of the words in the file ??
<code>
#include<iostream>
#include<map>
#include<string>
#include<fstream>
using namespace std;
typedef map<string,int> FileMap;
#define SIZE 255
char sBuffer[SIZE];
int main()
{
string word;
int offset;
FileMap FMap;
ifstream fin;
fin.open("D:\\Demo.txt",ios::in);
while(!fin.eof())
{
fin >> sBuffer;
// FMap[sBuffer]=offset;
}
fin.close();
cout << "\n Enter Word:";
cin >> word;
offset=FMap[word];
cout << "\n Word Offset is :" << offset;
return 0;
}
</code>
Thanking you,
Suresh HC.
|
|
|
|
|
What do you mean by offset exactly ? The index (in the file) of the first character of the word ? If yes, in your loop you can simply increment the offset counter by the size of the last word read:
while(!fin.eof())<br />
{<br />
fin >> sBuffer; <br />
offset += strlen(sBuffer) + 1;
FMap[sBuffer]=offset;<br />
}<br />
There is also a flaw in your design: if the user enters a word that was not stored in the map, then you'll get a crash. It is better to check if the key exist in the map (using the find function).
|
|
|
|
|
Thanks Cedric Moonen i will check it.
|
|
|
|
|
Hi All,
Is there any data types to specify unsigned __int64??
VikramS
|
|
|
|
|
vikrams wrote: data types to specify unsigned __int64
ULONGLONG , ULONG64
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
vikrams wrote: Is there any data types to specify unsigned __int64??
There is already one
unsigned __int64
|
|
|
|
|
yes..Sorry for trouble to everybody.
|
|
|
|
|
What are the steps to remember the last entered username and should be able to save the password for a faster login.
I am using win32 in .Net environment.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
amitmistry_petlad wrote: What are the steps to remember the last entered username...
Check out the HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\policies\system\dontdisplaylastusername registry value.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thank you very much for your guidline,
but should I have to make this for my own application? I mean I have make my own registery value or I have to use this value diretly? can you please elborate this?
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
I'm not sure what you are asking. See here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
well, I am asking you how can I use in my application its system's own.Will I have to develop my own registry folder? if yes then how can I set the username and password because we can put it open in registery.
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
Did you read the link I provided? That particular registry key has nothing to do with other applications. It's for the OS.
For your application, you can do it however you see fit. For example, when the application first starts, read the values from the registry (e.g., HKCU\Software\Local AppWizard-Generated Applications\AmitsApp) and pre-populate your login dialog box.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
ok thank you sir
"Success lies not in the result , But in the efforts !!!!!"
Amit Mistry - petlad -Gujarat-India
|
|
|
|
|
I have two edit controls in a dialog - the 1st is CEdit and the 2nd is a custom class derived from CEdit which supposedly accepts file and sets the edit box.
Now my problem is upon dropping a file to the 2nd edit box, I want just the filename to go to the 1st edit box.
Any thoughts on how I should go about this?
Thanks!
|
|
|
|
|
ghunzel06 wrote: upon dropping a file to the 2nd edit box, I want just the filename to go to the 1st edit box
Is your problem is with dropping the file or setting text?
SetWindowText(..), SetDlgItemText(..)
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
My problem is with setting the text in the 1st edit box which I will get from the
2nd one upon dropping the file.
The handler to the drop event is in the class of the 2nd edit box. Am I on the right
path on this? Please help.
|
|
|
|
|
ghunzel06 wrote: handler to the drop event is in the class of the 2nd edit box
Send a custom message to your parent window to set the text in 1st Edit box.
NoteIf you use local variable, to pass the string in WPARAM or LPARAM then make sure you are sending message using SendMessage API..
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
I have to send a custom message to the parent window in the handler of the 2nd edit box?
Did I get it right?
|
|
|
|
|
ghunzel06 wrote: Did I get it right?
Yes.
Do your Duty and Don't expect the Result Rate this Post, if I helped You
|
|
|
|
|
try as follows from the edit2
GetParent()->SetDlgItemText( IDC_EDIT1, csFileName );
where IDC_EDIT1 is the id of the edit 1.
nave
|
|
|
|