|
what about with...
rectlist::iterator i;
for (i = rects.begin(); i != rects.end(); i++)
{
CaptureScreen(&i, m_mainbuff);
}
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Yes, i also think this is true ans..
hiru
|
|
|
|
|
I have little much found that I am not getting perfect list which I have stored.
here I am fetch the rectangles list from below....
<br />
rectlist rectsToScan;<br />
m_region.Rectangles(rectsToScan);<br />
<br />
m_region is the object of the RTMPRegion class in which i storing rectangles in to the list.
But when I fetch by above then I Test like below.....
<br />
<br />
rectlist ::iterator i;<br />
for(i = rectsToScan.begin();i==rectsToScan.end();i++)<br />
CaptureScreen(*i, m_mainbuff);<br />
Then in the value of i any junk value comes.Here i is RECT ,so in left,right,top,bottom values are junk values.
|
|
|
|
|
It gives me the error using ....
CaptureScreen(&i, m_mainbuff);
Error like...
error C2664: 'RTMPDesk::CaptureScreen' : cannot convert parameter 1 from 'std::list<_Ty>::_Iterator<_Secure_validation> *__w64 ' to 'RECT &'
My Function deff...
void CaptureScreen(RECT &UpdateArea, BYTE *scrBuff);
thanks.
|
|
|
|
|
Try this
CaptureScreen( i ,m_mainbuff );
|
|
|
|
|
Thanks Hiru,,
Just before your message comes I found little solution and that is like that I did not get exect values from the list thats why it gave me error.At right now I am not getting error.
I am using same as
CaptureScreen(*i,m_Mainbuff);
If there will be some problem then i will contact U.
Thanks for your valuable time.Thank u v much.
Ashu
|
|
|
|
|
Since i is an iterator, you must use the dereference operator.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Nelek wrote: CaptureScreen(&i, m_mainbuff);
Since i is an iterator, you must use the dereference operator.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi,
I attach one static library project(project2) to my main project. My main exe is console application which i'm buiding in .net 2003.
When i call a function of sttic library project(project2) i got following error
error C3861: 'FunctionName': identifier not found, even with argument-dependent lookup
To solve this i have tried to include stdio.h in static library project(project2).
My main project is using one more function of another static library project (project1)and there is no error in calling that function.
If i dont call the function of sttic library project(project2) then there is no error.
please suggest how to solve it
Manoj Kumar Chauhan
|
|
|
|
|
Hi all!
With your help, I would like to write a program that monitors which ever files system opens, creates, writes to, reads from .... and finaly updates those neatly in it's log - same as any antivirus monitor but without virus-checking. I've written a code that uses ReadDirectoryChangesW, but it only triggers when file is launched or date/time modified. Which function should I use? It's important that my program should 'be aware' when any other program reads from certain file (ie. catch the name of INI file being read from). I hope that I was clear. I've downloaded some projects, but they didn't do. I'm using Borland C++ 5.0.
Thanx
dArK cHAriSmA
|
|
|
|
|
There are two options I can think of:
* Write a file system driver
* Poll the file system at regular intervals (probably about 100 ms) - attempt to open the file
with exclusive access. If it fails, then someone else is using it. If it succeeds, close it
because it's not in use. This option is a lot easier to code, but uses more CPU.
-- modified at 0:06 Tuesday 16th October, 2007
|
|
|
|
|
|
I have a Dialog box (and associated .cpp and .h files) developed in VS6.0 MFC that is called as a modeless dialog from its parent dialog based application. I wish to reuse this in other projects and share with coworkers.
Is there a way to do so, say as a Static Library or DLL perhaps?
I can create the static library using the code, but do not know how to add in the dialog that is related to it.
Are there any examples available I could learn from?
Any help would be greatly appreciated. Thanks.
Ralph_L
|
|
|
|
|
You can use either a static library or a dll, whatever is more appropriate.
If you use a DLL, the DLL needs to be an MFC extension DLL.
Create the appropriate project type and add the cpp and h files, and copy the dialog
resource into the project.
For the DLL, you'll need to change the class declaration:
class AFX_EXT_CLASS CMyDialog : public CDialog
...
For a static library you need to make sure you have a scheme in place so resource IDs
won't clash with the module it's linked with.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Of course, that means that any program that uses the DLL must itself be an MFC app.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
I guess I just assumed it was MFC code since the op stated
"developed in VS6.0 MFC".
Stupid me.
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I was merely posting a gentle reminder because the OP didn't say that the "other programmers" were writing in C++/MFC.
"Why don't you tie a kerosene-soaked rag around your ankles so the ants won't climb up and eat your candy ass..." - Dale Earnhardt, 1997 ----- "...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
|
|
|
|
|
Thanks. I was merely making sure the other programmers had no choice
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: I was merely making sure the other programmers had no choice
Real men drive manual transmission.
|
|
|
|
|
Hi everybody,
What is the best way in Visual C++(6.0) to make a program wait till a folder is completely copied. I have a program that would constantly watch an Input folder, Job folders are being copied to the Input folder, which I want to move to the InProgress folder for processing, once they are fully copied.
Thank you in advance,
Indu
|
|
|
|
|
icsr wrote: What is the best way in Visual C++(6.0) to make a program wait till a folder is completely copied.
Are you doing this copying via code?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
No, the folders are copied out side of the program. The program should be able to identify the folders that are complete, as opposed to the ones that are still in progress. I tried traversing the directory with FindFirstFile and FindNextFile and tried opening the files inside, hoping that if it returns an invalid handle then the directory is still in progress. But this did not work.
Any helpful hints?
Thank you,
Indu
|
|
|
|
|
The only thing I can think of is to try and open the file(s) exclusively. Files that are being copied would not allow such access.
Are you using ReadDirectoryChangesW() for the monitoring?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I also looked at FindFirstChangeNotification, which will trigger an event when directory properties change. Has any body done anything similar, I am running out of options.
Thank you,
Indu
|
|
|
|
|
icsr wrote: I also looked at FindFirstChangeNotification...
This will tell you that some file has changed, but it won't tell you what that file is.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|