|
Daniel Lohmann wrote:
A better solution would be to use non-blocking file io (overlapped IO) and wait for the ReadFile() operation in a loop that calls MsgWaitForSingleObject() so outstanding messages are also processed.
Unfortunately I can't do that, because I can't touch the code that is doing the reading.
I'll use TerminateThread and keep my fingers crossed
-Janetta
|
|
|
|
|
Dont use TerminateThread or something like that...
You must use a semaphore
The semaphore is used to tell the thread that it must exit
the thread must test the state of the semaphore in the ReadFile while
and exit if the semaphore tells it to
Casa.Sapo.pt
|
|
|
|
|
hello,
I want to ask how to display colour fonts on CView?
|
|
|
|
|
|
OIC!!! THX YOU VERY MUCH!!!
|
|
|
|
|
Does anybody have examples on exporting templates from an extension DLL:
For instance, the following code does not work:
template <class T> class AFX_EXT_CLASS CDummyClass
{
...
};
Help !
Jonathan de Halleux, Belgium.
|
|
|
|
|
Since templates are resolved at compile time it is not possible to put template-based classes or functions into a DLL. For example, that's why there is no DLL version of the STL. Usually template classes are implemented in header files. You could implement a generic non-template class in a DLL and use this class to write template-based classes in header files.
Look! They have the Internet on computers now! (Homer J. Simpson)
|
|
|
|
|
thank you for the advice.
Jonathan de Halleux, Belgium.
|
|
|
|
|
Hi,
i am looking for a menu/list control as you know from Outlook.
Outlook has on the left side a dark gray menu control. I tried
to find such a control to download, but wasn't successful.
Do you know where to find such a control?
Thanks,
Dominik
|
|
|
|
|
|
Thank you very much!!!
Exactly what i needed!
I only looked in the controls section of CodeProject, but never looked in the WTL section.
Thanks again!
Dominik
|
|
|
|
|
Having just resolved my plugin problems I now face the challenge of allowing my plugins to manipulate the data in my MFC app's CDocument derived class.
This I have done by passing a pointer to my derived doc class to the dll, and everything works fine. The plugin is able to create data in the doc.
However, when the doc deletes its data (OnNew... etc) I get a fatal exception. The object it is trying to delete is valid and does exist - however I beleive that it has been allocated from a different heap (the dll's) meaning the app/doc cannot unallocate it from it's own.
My dll "creates" data through the document itself..
...
pDoc->CreateVertex() ;
...
so why isn't the construction taking place from the "document" heap? I guess it always takes place in the local heap?
I could resolve this by getting the dll to track every single thing it creates and releasing it all on destruction, but that is far too clumsy.
This must be resolvable - otherwise no-one would have every been able to code plugins with MFC apps...
Any ideas?
|
|
|
|
|
Try using AFX_MANAGE_STATE in every function that uses MFC. Usually just put AFX_MANAGE_STATE(AfxGetStaticModuleState()) as the first line in every function.
Look! They have the Internet on computers now! (Homer J. Simpson)
|
|
|
|
|
Already am - this isn't the problem.
(at least afaik! )
|
|
|
|
|
makom42 wrote:
however I beleive that it has been allocated from a different heap (the dll's) meaning the app/doc cannot unallocate it from it's own.
Exactly. The common cure for this problem is implementing your plugins as 'MFC extension' dlls. They'll be using the same heap and global MFC state.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Any idea how much extra effor this is going to be?
I guess it's not going to be as simple as setup a project as MFC extension DLL, add my plugin files and recompile :S
|
|
|
|
|
When you create new MFC .dll project, the wizard gives you choice of 'mode'. You should use 'MFC Extension' dll. Basically, the extension needs special DllMain (which wizard generates for you) and _AFXEXT symbol in defines.
I'd create new dll and add files. Just ensure that main .exe uses MFC in .dll.
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
As long as every DLL and the EXE links to a shared MFC DLL, then the EXE and DLL's can delete data allocated by eath other without any problems.
Roger Allen
Sonork 100.10016
I think I need a new quote, I am on the prowl, so look out for a soft cute furry looking animal, which is really a Hippo in disguise. Its probably me.
|
|
|
|
|
Both app and .dll's use MFC in a shared DLL... no joy...
|
|
|
|
|
I've contemplated using DB's but have decided not to bother becuz I like a challenge, actually I could prolly do with out that one (I don't know of any *free* db's...even mySQL requires money when used for commercial purposes) but still.
Anyways the question...
When you run a SQL insert on a database with say 100,000 records does the db engine ( at the lowest level) open the file make room in the file insert the item and perform/adjust all previous offsets to their new required values...???
This doesn't make sense...but neither does cacheing 100,000 items [1024 each] in in memory and calculating offsets as you save the file...???
Does a database keep it's records in sequential order for random access or is it more like a linked list so not a heck of alot of possible offset calculations have to be performed...???
Thanx in advance!
Cheers!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
Hockey wrote:
Does a database keep it's records in sequential order for random access or is it more like a linked list so not a heck of alot of possible offset calculations have to be performed...???
Database is free to keep the records in any order. It may add your records at the end of the file, it may use empty spaces from deleted records. I'm pretty sure db engines don't move records, as long as you don't defragment.
If your app requests particular order with 'ORDER BY' clause, database will use index if possible; if there's no index it'll sort records on the fly (which may take long time if there's lot of data - that's why you should use index).
Tomasz Sowinski -- http://www.shooltz.com
"Yields falsehood when preceded by its quotation" yields falsehood when preceded by its quotation.
|
|
|
|
|
Tomasz Sowinski wrote:
Database is free to keep the records in any order. It may add your records at the end of the file, it may use empty spaces from deleted records. I'm pretty sure db engines don't move records, as long as you don't defragment.
Interesting...
Do you know of any resources where I might learn about the whole process...?
Anything but open source like mySQL...i don't wanna read 10000's of lines of code to figure how it all works...
Thanx!
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|
|
|
Whaddya mean no free? Try writing some code using ADO and you'll have a free DB?
|
|
|
|
|
What about distributing DLL's or drivers and such...? Do you need permission from MS or anything first...?
I'm really looking for RDBMS source code you can just compile into your existing source...no need for third party files...
Cheers
"An expert is someone who has made all the mistakes in his or her field" - Niels Bohr
|
|
|
|