|
See if this helps:
http://www.pcausa.com/resources/InetActive.txt
|
|
|
|
|
Hello,
I have a text file with the following layout.
COMMAND1
ITEM1 Value1 Value2 Value3 Valu4
ITEM2 Value1 Value2 Value3 Valu4
ITEM3 Value1 Value2 Value3 Valu4
ITEM4 Value1 Value2 Value3 Valu4
...
ITEM_N
COMMAND2
ITEM1 Value1 Value2 Value3 Valu4
ITEM2 Value1 Value2 Value3 Valu4
ITEM3 Value1 Value2 Value3 Valu4
ITEM4 Value1 Value2 Value3 Valu4
...
ITEM_N
COMMAND3
ITEM1 Value1 Value2 Value3 Valu4
ITEM2 Value1 Value2 Value3 Valu4
ITEM3 Value1 Value2 Value3 Valu4
ITEM4 Value1 Value2 Value3 Valu4
...
ITEM_N
....
COMMAND_N
In this file, I have to insert new items, or change values of items or delete existing items.
For suppose if I want to insert new item under "COMMAND1", what I am doing is, seeking the pointer to the end of "COMMAND1", writing remainig text into a temporary file, inserting my new text, then appending the text which is stored in temporary file. But I guess, it is not a best method. It takes much time every time I insert/edit text.
Is there any other alternative to do this. Can anybody tell what is the best method to do this.
Thanks & regards,
Chito
|
|
|
|
|
Well the assumption is rather correct but there is too many calls to the file. you should read the content of the file to the memory. Then do all the opertions (parsing, reallocation etc) and then the buffer (with the new value) should be written to the file again.
The content fo your file looks like it can be easly stored by xml. And will be easier to parse.
Have a good day
|
|
|
|
|
One solution is file-mapping.
Kuphryn
|
|
|
|
|
i create a regular dll named MyDll using MFC, i want the dll popup a dialg in
the beginning of the function CMyDllApp::InitInstance() ,just as i did in my exe. but here caused serious error in wincore.cpp (line:884)
BOOL CMyDllApp::InitInstance()
{
// TODO: Add your specialized code here and/or call the base class
CDlg dlg;
dlg.DoModal();
return CWinApp::InitInstance();
}
who can tell me what's wrong to my program?
gucy
|
|
|
|
|
gucy wrote:
i create a regular dll named MyDll using MFC...
If by "regular dll" you mean a non-MFC DLL, this is rather contradictory, don't you think?
gucy wrote:
who can tell me what's wrong to my program?
I would guess that it's too early to be calling such functions. The DLL is not fully initialized at this point, and something within CDialog requires the DLL to be up and ready to go.
|
|
|
|
|
http://www.thesoftwareobjects.com
|
|
|
|
|
What does the software object to?
I'm guessing its demanding parity
'--8<------------------------
Ex Datis:
Duncan Jones
Merrion Computing Ltd
|
|
|
|
|
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
One would assume you are connected with this business. You should say so or not, and don't post anonymously.
There is only one C++ product on the site, so I can't see it being very usefull to folks here at CP. The site also seems difficult to use to me at least.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Hi,
I want to implement a function to lookup internet IP address to get its coresponding netblock information in my developing internet app.
Perhaps,my question is how to get WHOIS information in my program. Should my app connect to WHOIS server, such as APNIC WHOIS server?
For example,
if I lookup 202.84.144.73, I want to get its information
inetnum: 202.84.128.0 - 202.84.191.255
netname: HKT,HK
... and so on.
Any ideas? Thanks in advance.
|
|
|
|
|
|
Hi,
did you take a look at this article?
regards
modified 12-Sep-18 21:01pm.
|
|
|
|
|
i have developed a application. in which a child window opens on clicking a button
but if user moves parent window to corner of screen ; child window gets opened on the center of parent window not on screen
i wanted to display it in the center of screen irrespective of position of parent window.
thankong you
chan
|
|
|
|
|
If you're using MFC, use CenterWindow(CWnd::GetDesktopWindow()) in your OnInitDialog() handler.
If you're not using MFC, you'll have to do a MoveWindow() and calculate the position where it should be. Look at the source code for CWnd::CenterWindow() to get an idea on how to do this.
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
Dear ALL,
I am developing an application for Windows NT/2000/XP. I need to know the path of root directory in my application.
Is there any API to know the root directory path (ie. c:\winnt or c:\windows)
Thanks in advance.
Rohit
|
|
|
|
|
Try GetWindowsDirectory()
Ryan
Being little and getting pushed around by big guys all my life I guess I compensate by pushing electrons and holes around. What a bully I am, but I do enjoy making subatomic particles hop at my bidding - Roger Wright (2nd April 2003, The Lounge)
Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late - John Nichol "Point Of Impact"
|
|
|
|
|
|
Hi world,
I want a simple dialog box (like CFileDialog) who let the user choose only a directory (not a file)...
Can somebody give me a simple example which does that?
Thanks in advance...
Hello World!!!
from Raphaël
|
|
|
|
|
|
I would have to look in Code Project first, sorry...
Hello World!!!
from Raphaël
|
|
|
|
|
Don't worry!
|
|
|
|
|
|
The following sample browses for a directory:
void BrowseForDir()<br />
{<br />
char caPathName[MAX_PATH];<br />
<br />
caPathName[0] = 0;<br />
<br />
GetDlgItemText(IDC_MYCTRL_TO_BACKFILL,caPathName,MAX_PATH);<br />
<br />
BROWSEINFO sBI;<br />
memset(&sBI,0,sizeof(BROWSEINFO));<br />
<br />
sBI.hwndOwner = m_hWnd;<br />
sBI.pidlRoot = NULL;<br />
sBI.pszDisplayName = caPathName;<br />
sBI.lpszTitle = "Select the folder that contains the desired files";<br />
sBI.ulFlags = BIF_RETURNONLYFSDIRS;<br />
sBI.lpfn = NULL;<br />
<br />
LPITEMIDLIST pidl = SHBrowseForFolder(&sBI);<br />
if (pidl)<br />
{<br />
SHGetPathFromIDList(pidl,caPathName);<br />
SetDlgItemText(IDC_MYCTRL_TO_BACKFILL,caPathName);<br />
GotoDlgCtrl(GetDlgItem(IDC_MYCTRL_TO_BACKFILL));<br />
}<br />
}
onwards and upwards...
|
|
|
|
|
My application uses a Flexgrid. Iam using the first row as the header. I need to insert new rows (data rows) after the first row (as the second row). Every new row inserted must become the second row and the remaining rows should get pushed down. Resetting the number of rows works but it appends a row at the end of the grid. Is there any way to achieve this? Where can I get the complete documentation on Flexgrid?
thanks.
|
|
|
|