|
Hi
are HINTERNET handles safe for multithreading ?
can i pass handles returned from InternetConnect or InternetOpen to many threads ? (in the CreateThread API)
what about windows handles in general ?
thank you in advance
|
|
|
|
|
I am parsing a file where each record is separeated by comma.
I am getting a minor problem here.
I am getting one extra empty field.
Here is the code.Pls help
CStdioFile myfile;
CString strRecord;
try
{
myfile.Open("C:\\YKUTANOOR\\VC++\\config.txt", CFile::modeRead );
myfile.SeekToBegin();
while(myfile.ReadString(strRecord)!=NULL)
{
CString resToken;
CString msgPromt;
int curPos= 0;
int countFields =0;
resToken= strRecord.Tokenize(",",curPos);
CString temp = resToken;
AfxMessageBox(resToken);
while (resToken != "")
{
resToken= strRecord.Tokenize(",",curPos);
}
}
}catch()
{
}
|
|
|
|
|
Do an additional test
CStdioFile myfile;
CString strRecord;
try
{
myfile.Open("C:\\YKUTANOOR\\VC++\\config.txt", CFile::modeRead );
myfile.SeekToBegin();
while(myfile.ReadString(strRecord)!=NULL)
{
CString resToken;
CString msgPromt;
int curPos= 0;
int countFields =0;
resToken= strRecord.Tokenize(",",curPos);
if(!resToken.IsEmpty())
{
CString temp = resToken;
AfxMessageBox(resToken);
while (resToken != "")
{
resToken= strRecord.Tokenize(",",curPos);
}
}
}catch()
{
}
}
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Thnx for the modified code.
But if u observe that the last message box(after fields are shown) are coming empty)
I need to stop this.
If u try ...
take a file LIKE this and use the above code.
1000,Y,1
2000,N,1
3000,N,1
4000,N,2
|
|
|
|
|
This works:
CStdioFile myfile;
CString strRecord;
myfile.Open("C:\\config.txt", CFile::modeRead );
myfile.SeekToBegin();
while(myfile.ReadString(strRecord)!=NULL)
{
CString resToken;
CString msgPromt;
int curPos= 0;
int countFields =0;
while((curPos= strRecord.Find(",")) != -1)
{
resToken = strRecord.Left (curPos);
AfxMessageBox(resToken);
strRecord = strRecord.Mid (curPos + 1);
}
AfxMessageBox(strRecord);
Papa
while (TRUE)
Papa.WillLove ( Bebe ) ;
|
|
|
|
|
Retrieve your strings inside the while loop and just before the call to the Tokenize function.
int Position = 0;<br />
CString Token(strRecord.Tokenize(_T(","), Position));<br />
<br />
while (!Token.IsEmpty())<br />
{<br />
TRACE(_T("[%s]\n"), Token);<br />
Token = strRecord.Tokenize(_T(","), Position);<br />
}
With your example file, then I get:
[1000]
[Y]
[1]
[2000]
[N]
[1]
[3000]
[N]
[1]
[4000]
[N]
[2]
|
|
|
|
|
I have used CMapStringToString where I have to map a string to another string.
I want TO KNOW how different CMapStringToString is from Cache Memory.
Because I am reading from the file in read mode and storing all the contents in
CMapStringToString.
Or Do I have to write another program to cache it.
Pls clarify
|
|
|
|
|
Are you referring to the hashing that goes on automatically in the cache?
|
|
|
|
|
Yes,I am referring to the cache.
|
|
|
|
|
Well that clears it up - NOT
|
|
|
|
|
My idea is read from a file and load in to memory as my app prefers frequent searching.
I am doing it by taking CMapStringToString.
What my question "Is cache memory different from storing in a hash table like CMapStringToString ?
|
|
|
|
|
But then the question is, what "cache memory" are you refering to? MFC or C++ in general don't implement a cache. Are you refering to a hardware cache? Internet cache?
--
Joel Lucsy
|
|
|
|
|
hello all,
Is there any Win32 API avaliable to add a new button to IE toolbar. And i had previously checked the Codeprojects' WTL Toolbands and deskbands.
if there is any api plz say. it will be greatfull.
Thank u.
ComputerNewton
|
|
|
|
|
I believe what you are looking for is a BHO, Browser Helper Object. This is implemented using COM. So, no, no direct Win32 API.
--
Joel Lucsy
|
|
|
|
|
hello all,
As i had searched to add a button to IE toolbar i got some manual in MSDN, which has done through registry. I did the same as said. But i didnt get it for my button. What is the probelm there?.
Here is the link...
http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/ext/tutorials/button.asp
Plz check my problem there. or can any one say me the procedure that was given there once plz.
ComputerNewton
|
|
|
|
|
Hello,
I need to replace Windows Desktop folder with my own.
I can change it by writing new values in the
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders
and
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders registry keys.
Then, if I will kill explorer.exe process - the desktop folder will change. But how can I do it without killing explorer.exe?
|
|
|
|
|
I'm not sure if you really can. I suppose explorer.exe will read the path from the registry when you run it and then store it in internals variables, so 2 ways... find and change these variables or restart the explorer.
Don't try it, just do it!
|
|
|
|
|
Hi guys
Taking a look in resource.h I've seen that.
#define IDC_SG_MIN11 1143
#define IDC_P101 1143
This happens in a lot of resources (resources with the same number).
That could be a problem?
It's better to have each resource with his own and unique number?
Best Regards
Doc
|
|
|
|
|
This plagues me as well.
Check out this utility for checking and fixing duplicate resource ids >
ResOrg[^]
I Dream of Absolute Zero
|
|
|
|
|
In my experience this duplication occurs whenever I copy & paste controls.
I've spent many an hour over the years rectifying such duplicates!
Ant.
|
|
|
|
|
Then you recommend me to change it, isn't it?
I haven't problems compiling but somke guys advised me that in W98 a non valid resource or something like this error happened, it's possible due to this?
Thanks
Doc
|
|
|
|
|
Yes I recommend that you change it.
Note: Remember to change the _APS_NEXT_CONTROL_VALUE at the end of the resource.h file also if you do it by hand otherwise subsequent controls will have duplicates.
Ant.
|
|
|
|
|
delete one of the resource and then add it, any problems due to duplication will go away...
but are you sure both where IDC_xxx
it is possible to have
IDC_xx 2233
IDI_xx 2233
and it is ok.
|
|
|
|
|
I need to programatically save some image displayed in WebBrowser control to some file, or get the image's data into memory.
How to do this ? (IHTMLImgElement offers only functions for getting image's size and creation date, but I could not find any function for getting image's data or it's name in temporary internet files)
Any ideas ?
Thank you !
rrrado
|
|
|
|
|
Your question (the same one posted a while ago...) inspired me a little. Using samples from CodeProject,
and MSDN documentation, I've glued together an IE toolbar with "Grab Pictures", and "Grab pointed to
Pictures" functions.
Once you have a IHTMLImgElement , just use its get_src method. Then use URLDownloadToFile , or URLOpenStream
if you are more masochistic...
Iain.
|
|
|
|