|
Hi,
I am working with File reading in VC++. I am reading a log file which has around 1 lakh records. I have to read each record and filter them based on some options and display them on the UI.
The problem that I am facing is that it takes enormous amount of time to read so many records. I am using CStdIOFile for reading. Can any one please help me with some optimization techniques that will speed up my reading process.
Thanks
Madhavi.
|
|
|
|
|
ledallam wrote: which has around 1 lakh records
It is better you should implement a worker thread for readng and displaying in the UI.
- NS -
|
|
|
|
|
Hi, I think you should put each line of the log file in the CStringArray and lunch a worker thread to parse each item of that array. Good luck!
p.s. it would be nice to have a progress window
|
|
|
|
|
You could try overlapped file I/O, with a number of pending file reads simultaineously.
|
|
|
|
|
|
Hi,
In the dialog editor (I use VC 6), the size and positions are shown in DLU. Can I change it to screen pixel uints?
Thank you.
- NS -
|
|
|
|
|
NS17 wrote: Can I change it to screen pixel uints?
Did you try changing it?
Nibu thomas
Software Developer
|
|
|
|
|
?
What did you mean?
- NS -
|
|
|
|
|
Nibu thomas wrote: Did you try changing it?
yeah right
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
It was not to get the values in run time. I meant to view the values in status bar of the dialog editor.
- NS -
|
|
|
|
|
Yes you can chage the size and position
First of all you have to take the thatspecific window rect.
Use SetWindowPos() function to do this..
Bankey Khandelwal
Software Engineer
|
|
|
|
|
I am afraid you have mistaken.
We can see the size and position of selected control in the status bar, when we are in dialog editor. These are in DLU. I need to view them in real pixel scale. I think you got what I meant.
Thank you.
- NS -
|
|
|
|
|
|
i want in UNICODE exe Hook MessageBoxA and add some String, like:
MessageBoxA(NULL, "Hello", "Caption", 0); -> MessageBox(NULL, "Hello-Add", "Caption-Add", 0);
int WINAPI MyMessageBoxA(..lpszText, lpszCaption...)
{
...
strcat(lpszText, "-Add"); // <--- 1.
strcat(lpszCaption, "-Add"); // <--- 1.
MessageBoxA(...);
}
1.strcat and _mbscat, which function i need use?
|
|
|
|
|
well if you are hooking MessageBoxA in a UNICODE exe then it won't be called unless you specify MessageBoxA instead of MessageBox.
Anyways i think you can use strcat in MyMessageBoxA if it hooks the non unicode version of MessageBox AKA MessageBoxA
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
|
What is the need to hook MessageBoxA here? Simply calling it should do.
_tcscat should do it.
Nibu thomas
Software Developer
-- modified at 1:18 Friday 24th March, 2006
|
|
|
|
|
Did you read the post?
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
hi All
i am unable to find erase background event in Dialog
based application, ihave read somewhere that it's np
longer supported in vc 6++. Is there any alternative
as i have to make my dialog flicker free
|
|
|
|
|
what do you mean you can't find, its right there.
BEGIN_MESSAGE_MAP(CMydialog, CDialog)
....
ON_WM_ERASEBKGND()
END_MESSAGE_MAP()
then add function to mydialog.h file
BOOL OnEraseBkgnd(CDC* pDC);
and add the body to mydialog.cpp file
BOOL CMydialog::OnEraseBkgnd(CDC* pDC)
{
return TRUE;
}
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Hello All,
I've a MFC application from which I've to call a routine from a DLL.
EARLIER, This DLL was getting used by a JAVA application.
But now there is a MFC application instead.
We dont' have to change the DLL code for this in any case.
The export routines have following declaration:
JNIEXPORT void JNICALL Java_gui_config_setManufacturer(JNIEnv *env, jobject obj);
Please let me know how this routine can be called from MFC application.
Thanks in advance!
Regards!
|
|
|
|
|
a1prashant@yahoo.com wrote: JNIEXPORT void JNICALL Java_gui_config_setManufacturer(JNIEnv *env, jobject obj);
Please let me know how this routine can be called from MFC application.
Did you try calling it?
Nibu thomas
Software Developer
|
|
|
|
|
Thank you for replying.
Issue1: (Is passing NULL, NULL correct??)
typedef void * (__stdcall *DLLPROC)(VOID *, VOID *);<br />
...<br />
DLLPROC pfnProc = (DLLPROC)GetProcAddress(hInst, "Java_gui_Win_getCurrFirmware");<br />
if( pfnProc )<br />
{<br />
AfxMessageBox("Got Java_gui_Win_getCurrFirmware");<br />
VOID * jstr = (pfnProc)(NULL, NULL);
AfxMessageBox("Called!");<br />
}
While calling the procedure, it is expected to send (JNIEnv *env AND jobject *obj)
But currently I am passing NULL, NULL.
Is this correct?
The code runs w/o problem and I able to see the message box "Called".
Issue2: (How do I get c_str from "jstring")The DLL procedure is supposed to return "jstring"
But I need c_str out of it. How do I do the conversion?
I want conversions for atleast
jboolean -> boolean
jstring -> char *
jint -> int
Please help.
-- modified at 1:29 Friday 24th March, 2006
|
|
|
|
|
a1prashant@yahoo.com wrote: While calling the procedure, it is expected to send (JNIEnv *env AND jobject *obj)
JNIEnv and jobject are structures or classes that are declared in "java.h" or "jni.h" . Maybe copying them and passing the values as required should help.
Note: I am a bit tentative about this. I remember there is a file called java.h which contains declarations. Please check the file names. Maybe doing a string search inside java directory should help you. Strings like jobject , JNIEnv . This will take you to the exact file where they are declared.
a1prashant@yahoo.com wrote: But currently I am passing NULL, NULL.
Why?
a1prashant@yahoo.com wrote: Is this correct?
This is wrong. They are expecting something but you are giving nothing!
a1prashant@yahoo.com wrote: (How do I get c_str from "jstring")The DLL procedure is supposed to return "jstring"
Take a look at what jstring is. What kind of datatype is it. Normally these are typedefs or structs . So it must be easy for you once you find them to use them and pass them to funtions.
a1prashant@yahoo.com wrote: I want conversions for atleast
jboolean -> boolean
jstring -> char *
jint -> int
Again I repeat what I said. These are either typedefs or structs . You can copy their declarations.
Nibu thomas
Software Developer
|
|
|
|
|
Thanks a lot for the help.
|
|
|
|