Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
As already stated, it's not an error but a warning. Compiler is simply making sure you're doing it on purpose and not by mistake, remember that casting may lead to digits being dropped and rounding (hence the warning). Cast the data to the appropriate type and the compiler won't warn you about it anymore.
I want to provide undo/redo drawing feature in MFC dialog based application. I am saving the images dynamically in a vector in OnMouseMove handler code. But when I am going to load the previous image on clicking Undo button, its getting distorted. the last image saved still remains there on the canvas. Can anybody tell me whats the issue with OnMouseMove handler. How the compiler will know when to end saving the image.?
My application is in C++/ATL/COM and uses the Access database for storing configurations. Various DLLs and EXEs (and threads) that are part of my application query the database when needed.
When doing so, I am getting the database locked message ('[Microsoft][ODBC Microsoft Access Driver] The database has been placed in a state by an unknown user that prevents it from being opened or locked' in the log) randomly and the application fails to continue.
I am assuming that this problem happens due to the shared access of the database.
My question is:
Can i get the complete database in memory (in form of recordsets for every table) during the launch and query the recordsets directly instead of querying the database? I believe this might solve the database locking problem.
If you have it in memory, you won't get changings. And if you add code to support changings during runtime, you may not need a database.
Assuming that all modules must then use only one function to access the memory db, why not implement the only function using direct db access?
In both cases, that function must be thread safe using locking. I think that's your problem: You access the db from different threads which may fail when the db is locked by another thread. You will have similar problems when using a memory image that is modified when not using locking (but without getting an error message).
Or you can create an upperfilter driver for serial.sys and pump the data back up to your app.
Of course this is extremely difficult for most people to do but should you feel up to a mammoth challenge, it is an interesting way to do it.
The other way you can do it is to create a dll that manages serial.sys, ie, implements all the Win32 serial functionality and get the other app to talk to your dll instead of the stock system one. But this has its own problems in terms of replacing the system dll with yours.
Last Visit: 31-Dec-99 18:00 Last Update: 28-Sep-22 6:41