|
Hi David, thanks for the quick reply, my application always retruns in the status dword 0 ... even when the printer is offline, or the printer has the top cover open, or a tray open it always returns 0.
|
|
|
|
|
What does your code snippet look like?
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
I've emailed the code snippet
|
|
|
|
|
Hello.
How can I find out what files on my computer are being modified? And not by scanning every file. Something like task manager maybe...
Thanx.
nothing
|
|
|
|
|
See here.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Thanx. But that is an executable. I was searching for some source code, or even some main directions so that I can build my own '.cpp'. I only need the path of the files in the form of a string.
Alin Stoian
|
|
|
|
|
It helps to be as specific as possible. That article goes on to say what is required. Creating device drivers is no trivial task.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
How about using the CDirectoryChangeWatcher class that is on codeproject ?
|
|
|
|
|
|
That would not work unless something about the file was changed.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
|
|
How can i get the mouse position. where ever the mouse be?
|
|
|
|
|
relative to your application or the screen ?
|
|
|
|
|
|
I am writing a MDI database app using a splitter window (upper pane = parent table) (lower pane= child table) and am unsure as to the responsibilities of each class. I have it working but am always trying to better myself.
I have a database object (CDatabase)
I have a recordset object (CRecordset)
I have a document object (CDocument)
I have several views (CFormView)
I have a CSplitterWnd hosting the CFormViews
I realize the document holds the data. So here are my questions
I have seen an example where the document holds a member variable of both the Recordset and the Database and am currently adopting this scenario.
But which class is responsible for actually creating the recordset or does it matter? I currently have the document creating the database and each formview class responsible for creating the recordset of its pane. My document holds a member pointer of the recordsets created in the view
Is it appropriate to use the UpdateAllViews from the CDocument class to invoke the OnUpdate of each view? Then overide the OnUpdate in the view class to run a requery and other housekeeping procedures. Normally I associate the UpdateAllViews with some sort of visual activity in the Views but with a database it's all about requerying and housekeeping.
Thanks
|
|
|
|
|
It depends.
IMHO, it would be much better to hold your CDatabase and CRecordset objects together in the CDocument-derived class of yours because they are essentially serving the same purpose - to link your views to data. However, if recordset objects are subject to heavy dynamic user-invoked changes, I'd normally prefer to associate them with views.
That's what I think, although it's so much more a matter of preference than of being right or wrong...
|
|
|
|
|
Thanks,
Does it matter where those recordset objects get instantiated with the new keyword (CDatabase or CFormView)?
|
|
|
|
|
Yes, it does matter for me. I'd create them immediately where they are used, but also exactly where "main" pointers to them are stored (i.e. those pointers you use to delete recordsets; it's important as this must be done only once and preferably in a function called from the destructor of your CDatabase or CFormView object).
The worst thing to do IMHO is to split the code that works with these recordset objects into several parts based in different classes. Chances are all hell will break loose upon you when:
a) execution flow comes to destruction and oops you overlook a leak or delete objects twice or whatever else...
b) the program swells in size and soon you are no longer able to track down all activities associated with recordsets.
Keep it simple. In the end it's much better to misplace pointers but code consistently keeping in mind this architecture than to make a correct design decision (if there is one) but implement it inconsistently or in a sophisticated manner.
|
|
|
|
|
|
|
what language is that ?
obviously not C++ !!
|
|
|
|
|
Giorgi Moniava wrote: 1) Register an extension for my application on the system where it will be installed.
See here (second response).
Giorgi Moniava wrote: 3) When the user opens the file with the abovementioned extension I want that my program was launched.
This is the same as #1, and should happen automatically.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
In a MFC dialog based programm, I add a button control, and the corresponding message function is:
void CHhhhDlg::OnButton1()
{
// TODO: Add your control notification handler code here
CClientDC clientDC(this);
CDC memDC;
memDC.CreateCompatibleDC(&clientDC);
CRect rcClient;
GetClientRect(&rcClient);
CBitmap membitmap;
membitmap.CreateCompatibleBitmap(&clientDC, rcClient.Width(),
rcClient.Height());
memDC.SelectObject(&membitmap);
for (int x = 0; x < rcClient.right; x ++)
{
for (int y = 0; y < rcClient.bottom; y ++)
{
memDC.SetPixel(x, y, x < y ? RGB(255, 255, 0) : RGB(255, 0, 0));
}
}
clientDC.BitBlt(0, 0, rcClient.Width(), rcClient.Height(), &memDC, 0, 0, SRCCOPY);
}
Now, I want to comments the last statement, and save the memeory bitmap (memDC) to a BMP file.
How can I achieve this objective.
Thanks!
|
|
|
|
|
if you want to save bmp file use CImage::Save
-- modified at 8:40 Wednesday 15th March, 2006
|
|
|
|