|
Hi Alok.
I am writing/reading data according to the following thread code:
thread()<br />
{<br />
char buffer[1024];<br />
<br />
<br />
Read(fileHandle,buffer,&retbytes);<br />
Write(m_ftHandle,buffer,&retbytes);<br />
}
Regards
Sreekanth Muralidharan,
Corporate Systems Consultant [Embedded Systems],
INDIA
|
|
|
|
|
and at a time how many threads are active!
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hi Alok
The thread which plays back the file is the only thread other than the parent process which is the application itself.
Regards
Sreekanth Muralidharan,
Corporate Systems Consultant [Embedded Systems],
INDIA
|
|
|
|
|
Sreekanth Muralidharan wrote:
The thread which plays back the file is the only thread other than the parent process which is the application itself.
Then in that CASE, i believe there is no confliction/ DATA loss as you mentioned in your post!.
AFAIK, No Doubt thats is only method to do PAUSE AND PLAY perfectly!.
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hi Alok
Can the threads running in system currently affect the user thread I am creating? In what way I can avoid this interference if it is affected?
Regards
Sreekanth Muralidharan,
Corporate Systems Consultant [Embedded Systems],
INDIA
|
|
|
|
|
Sreekanth Muralidharan wrote:
Can the threads running in system currently affect the user thread I am creating?
Nope, Worker Thread Run Independently in your process without effecting other THREAD in your process
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
|
|
|
|
|
Hi Alok
[[[[[[[[[[[[[[[[[ HELP ME AGAIN ]]]]]]]]]]]]]]]]]]]]]]
I have a worker thread created using AfxStartThread() function. This thread is reading data from a flat file and writing the data to USB. PLAY, PAUSE, STOP, everything works fine without any negative interference on the thread. But while the thread is running, if I minimize any windows, shut down the system monitor, maximise any minimised applications, the thread is affected. The windows I am tampering with is not the one which created the thread. But still, it is giving this head ache.
Please help me with a solution to avoid this.
Regards
Sreekanth Muralidharan,
Corporate Systems Consultant [Embedded Systems],
INDIA
|
|
|
|
|
If you post the code it will be easier to say where the problem is.
m0n0
|
|
|
|
|
Hi Giorgi
The code is very big and contains confidential data. Even if I sent the code through the net, I don't think you will be able to go through the code in one or two days and give me a result. The project contains more than 150 source files each with around 10K lines of code. I hope you got it.
Regards
Sreekanth Muralidharan,
Corporate Systems Consultant [Embedded Systems],
INDIA
|
|
|
|
|
how can i check through code if my PC has a connection to the internet. I would like to raise an event if my PC is connected (like displaying a message box) and again id like to raise an event when the connection disconnects. How can i do this??
|
|
|
|
|
|
You'd think it'd be really easy but it ain't
Check out this article[^] for more info.
Lets be honest, isn't it amazing how many truly stupid people you meet during the course of the day. Carry around a pad and pencil, you'll have twenty or thirty names by the end of the day - George Carlin
Awasu 2.1.1 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
im new to VC++ and i'd like people to be able to brows for an exe file and select it. Once they have selected it, i would like the icon to be displayed in a icon listbox. How can i do this
|
|
|
|
|
Hello,
I just want to know how can i override functionality of To,Cc & BCc button .i mean to say when a user clik on this functionality my Functionality should be invoke not Outlook default one.i know have to implement event sink for this but how .i don't know.I am able to get Send button but not getting any id for these button please help me and let me know how to perform sinking on this
if anybody know
please mail me on rupechamp@gmail.com
thanx in advance
|
|
|
|
|
Hello,
I just want to know how can i override functionality of To,Cc & BCc button .i mean to say when a user clik on this functionality my Functionality should be invoke not Outlook default one.i know have to implement event sink for this but how .i don't know.I am able to get Send button but not getting any id for these button please help me and let me know how to perform sinking on this
if anybody know
please mail me on rupechamp@gmail.com
thanx in advance
|
|
|
|
|
I have an project. Translate English to Vietnamese. So I must use Vietnamese in Console. But I don't Know how to use Unicode in Console and select a font for my program. Please help me! Thanks!
|
|
|
|
|
Dear all,
I have a question about these functions. According to MSDN, "The WriteFileEx function ignores the OVERLAPPED structure's hEvent member...WriteFileEx signals completion of its writing operation by calling, or queuing a call to, the completion routine pointed to by lpCompletionRoutine, so it does not need an event handle"
To wait for its completion, I use WaitForSingleObjectEx. Because WriteFileEx doesn't need an event handle, what handle should I use to transfer to WaitForSingleObjectEx?
Thanks.
|
|
|
|
|
This doesn't work.
If you use async APIs, then why use WaitForSingleObjectEx to make it sync?
Better use WriteFile without OVERLAPPED structure.
Don't try it, just do it!
|
|
|
|
|
Actually, I called WriteFileEx and do other tasks while IO task is being performed. Before doing new writing task I call WaitForSingleObjectEx to determine if the previous writing task completed. But I'm not sure how to transfer a handle to the first param of WaitForSingleObjectEx.
Thanks.
|
|
|
|
|
WriteFile does exactly that you want to program yourself!
Using asynchron APIs does only make sense if you want the CALLING THREAD to do some other work while the read process is pending!
By the way, there is no reason to call WriteFileEx every time a write operation was completed.
You can also call WriteFileEx many times at the same time, the system queues the data and tells you when the complete process is complete. There is no event handle when you use WriteFileEx.
After a write operation is complete the OS will call the completion routine you set as parameter of WriteFileEx. So the only way to use a wait function is to create an event yourself and set it within the completion routine.
Don't try it, just do it!
|
|
|
|
|
So, I don't need to wait for the previous writing task completes before calling a new WriteFileEx.
Am I misunderstanding you?
Thank you so much for your precious help.
|
|
|
|
|
You can call the ssynchronous WriteFileEx multiple times while IO is pending.
What the documentation is trying to conveysay is that the completion CALLBACK will be activated not the event handle. So you need to decode which IO request(s) completed when our IO completion procedure is called with the information you originally provided as part of the IO completion callback setup prior to making the WriteFileEx call.
|
|
|
|
|
I was wondering how to change the look (or even behaviour) of a windows common control so it will reflect throughout the entire platform. For example I'd like to change the progress control to be a fluent bar instead of the normal block-ish one. I found an article on MSDN about this but it was for Win CE, couldn't find anything for 2K/XP. Does anyone have an idea as where to start?
Kuniva
--------------------------------------------
|
|
|
|
|
System wide hooks???
It's frustrating being a genius and living the life of a moron!!!
|
|
|
|
|
When run I get assertation failure.
What cause it. I remind it is those global variable defining the main thread.
//////////////////////////////
CWinApp::CWinApp(LPCTSTR lpszAppName)
{
if (lpszAppName != NULL)
m_pszAppName = _tcsdup(lpszAppName);
else
m_pszAppName = NULL;
// initialize CWinThread state
AFX_MODULE_STATE* pModuleState = _AFX_CMDTARGET_GETSTATE();
AFX_MODULE_THREAD_STATE* pThreadState = pModuleState->m_thread;
ASSERT(AfxGetThread() == NULL);
ytvsoftware
|
|
|
|