|
Typically, your thread will loop continuously, with checks to see if (a) the current read has timed out, in which case you continue, or (b) an event was trggered (See CreateEvent in the API docs), in which case the thread exits. That way, you can trigger the event in your main thread when you want to quit the app, and then wait in the main thread for the comms thread to exit.
You can combine the two by using COMMS events and waiting until either a received character is available or the other event was triggered, and acting accordingly.
P.J.Naughter has written some excellent classes, one of which deals with comms ports, so check that out in the MFC/C++ libraries section here on CP.
Steve S
Developer for hire
|
|
|
|
|
Did you read this article from your last COM-related post? It goes into detail on how threads can be used for reading (and writing). Now your main UI thread can remain responsive.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
hi, does anybody know how 2 add a 3DS object in VC++.
When the goin gets tough then tough gets going
|
|
|
|
|
|
It is not that easy. You have two solutions (that I see): either you go for yourself and write everything yourself. Everything means from loading the file (so, you have to know its format and everything) to displaying it.
This will be really long and difficult (and even more if you don't have experience).
Another option is to use a 3D engine (the ones that are used for free 3D games). But I don't know which ones support 3DS format, you'll have to search on google and compare some of them.
|
|
|
|
|
I might have a copy of the Max SDK lying around and some code that loaded models and processed them, it wasn't that hard. What are you trying to do?
|
|
|
|
|
Hello,
Who can tell me "How to call Microsoft C# module in the COM component (C++)"
Thanks a lot!
|
|
|
|
|
you can make the c# module alos a com component
Sudeesh
|
|
|
|
|
Would you give me a example? thanks a lot!
|
|
|
|
|
|
Hi, Sudeesh
Thank you very much. You are so kind.
Best Regards,
|
|
|
|
|
How Event Logging works? Which component of the Windows continuesly keeps checking whether any Event has occured or not?? Which is that component that does this activity??
|
|
|
|
|
joshiprashant wrote: not?? Which is that component that does this activity?
type eventvwr at your run command
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
Support CRY- Child Relief and You
|
|
|
|
|
Thanks for ur opinion..
But what I want to knkow is "Which Kernel Component is behind the scene for Event Logging process"? I mean how we can come to know that an event has occured without using the Event Viewer or using NotifyChangeEventLog() API?
|
|
|
|
|
Event Logging in Windows is works as a Windows Service. Run Services from Admin tool/control panal; U can see all services currently running in system. U can see a service called "Event Log", which write the events for windows.
See MSDN
BackupEventLog Saves the specified event log to a backup file.
ClearEventLog Clears the specified event log, and optionally saves the current copy of the logfile to a backup file.
CloseEventLog Closes a read handle to the specified event log.
DeregisterEventSource Closes a write handle to the specified event log.
GetEventLogInformation Retrieves information about the specified event log.
GetNumberOfEventLogRecords Retrieves the number of records in the specified event log.
GetOldestEventLogRecord Retrieves the absolute record number of the oldest record in the specified event log.
NotifyChangeEventLog Enables an application to receive notification when an event is written to the specified event logfile.
OpenBackupEventLog Opens a handle to a backup event log.
OpenEventLog Opens a handle to an event log.
ReadEventLog Reads a whole number of entries from the specified event log.
RegisterEventSource Retrieves a registered handle to an event log.
ReportEvent
|
|
|
|
|
Thanks for ur reply..
But I want to know how this mechanism of Event Logging is implemented internally in Windows Kernel? I dont want to use Event Viewer or NotifyChangeEventLog() API which helps me to identify when certain event occurs. Is there any way by which I can come to know about occurance of an Event??
|
|
|
|
|
How to execute a process virtually? That means without running an application i want to notify to OS that certain process is executed?
|
|
|
|
|
How would this help? I don't believe any windows os keeps any tracking info on if a program has ran so what would this add?? Please correct me if I am wrong...
John
|
|
|
|
|
Thanks for reply..
Certain applications & Processes logs events to respective logs like Application, System and Security logs. So is there any way that without executing certain application, we can log the event on behalf of that particular application.
I know there APIs available for this task, but they dont allow to write in SECURITY LOGS, and my task is to write in Security Logs. So how can this be solved??
|
|
|
|
|
Ahh, Now that makes sense to me. Sorry for wasting your time as I don't know the answer to the new question.
|
|
|
|
|
Hi,
Im my dialog i use combobox to list all OPC servers.
Each tiem when i click "ListServer" button in my dialog..it displays all registered servers in combo box.
Iam using OPCEnum to get server list,the function is
int NumberOfOPCServers (BOOL UseOPCENUM, LPCSTR MachineName);
In that list there are also unwanted server list which i dont have any work in that is also displayed.
Is there any option to not display this kind of unwanted servers.
-- modified at 1:33 Wednesday 26th July, 2006
|
|
|
|
|
if you dont need to these items why you add these item to your combobox
|
|
|
|
|
Hi,
In my MFC application i registered my server by using one clsid from GUID.exe as follows
SvrName = "EsimServer";
SvrDescr = "Prosimulator OPC Server";
UpdateRegistry ((BYTE *)&Svr_Clsid, SvrName, SvrDescr, HelpPath);
I gave clsid in top of my coding.
My problem is in same application i want to register different servers.
That is EsimServer1,EsimServer2,EsimServer3...
Can i do this by using the same clsid for all server register.
Anu
|
|
|
|
|
you have to use separate CLSID for each com component.
in this way u can register multiple servers
Sudeesh
|
|
|
|
|
Generally we have seen that when put out mouse over any control it displays some description about that after some time How can we implement that in our VC++ environment Kindly guide me regarding this
Thanx in advance
|
|
|
|