|
Ya, its' true. What I mean that there is any numbers couldn't I use, may be those numbers are already use somewhere in the application.
I appreciate your help all the time...
Eranga
|
|
|
|
|
Anand Todkar wrote: Is there any way by which I can do it?
Set the taborder of all EditBox in a sequence. Now take the handle of EditBox in the top of zorder and call the GetWindow() with GW_HWNDNEXT. This will return the handle to the 2nd EditBox. now pass the 2nd EditBox handle to get third list and so on.
Another option is to set the id value of the EditBox in a sequence. Now call the GetDlgItem() function in a for loop with the index starting from the id of first EditBox to the last one.
|
|
|
|
|
Naveen.R wrote: Set the taborder of all EditBox in a sequence. Now take the handle of EditBox in the top of zorder and call the GetWindow() with GW_HWNDNEXT. This will return the handle to the 2nd EditBox. now pass the 2nd EditBox handle to get third list and so on.
This sounds good, let me try this way, as the Taborder is not going to change.
Thanks naveen
Thanks,
Anand.
|
|
|
|
|
Hi,
I made it very easy with an Array from pointers to the control. In my case, it was:
CMyColorComboBox* m_aComboBoxes [MAX];
then, in the constructor of the Dialog... I wrote the access to them.
m_aComboBoxes[0] = &m_cmcbbVisIn1;
m_aComboBoxes[1] = &m_cmcbbVisIn2;
m_aComboBoxes[2] = &m_cmcbbVisIn3;
m_aComboBoxes[3] = &m_cmcbbVisIn4;
and then I use loops to access, write, delete data from them.
for (int i = 0; i < MAX; i++)
m_aComboBoxes [MAX]->ResetContent ();
I have done it in that way because I had the member variables from class wizard. But you can use the idea as well without having any variable and using GetDlgItem (ID). If you use the GetDlgItem ... then you must use OnInitDialog or on InitialUpdate. Because if you use the constructor to give the pointers... then you will have an assertion because the window doesn't exist when trying to access.
Hope it helps
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
|
|
|
|
|
Hi All,
I am using list class in my project(MFC Application). I have made list like .....
typedef std::list<rect> rectlist; // Here list is of type RECT
in one header file. And during my project execution I am storing rectangles in the list.
And now,When I use list iterator in another class like below....( I have already included its header file in using class)
rectlist::iterator i;
And i use this iterator like below in any other function......
for (i = rects.begin(); i != rects.end(); i++)
{
CaptureScreen(*i, m_mainbuff); // Error is here
}
I got error msg like ...
list iterator not dereferencable
at runtime in debug assertion Failed Box.
Thanks in Advance...
Ashish
-- modified at 1:10 Tuesday 16th October, 2007
|
|
|
|
|
it may because of using *i in argument.
solution is try to give appropriate argument in function calling then copy it in to original list.
or it may required type casting..
give me the prototype of CartureScreen( ) function.
|
|
|
|
|
Prototype of CaptureScreen()...
void CaptureScreen(RECT &UpdateArea, BYTE *scrBuff);
i have just used this ....
<br />
rectlist::iterator i;<br />
<br />
for (i = rects.begin(); i != rects.end(); i++)<br />
{<br />
CaptureScreen(*i, m_mainbuff);<br />
}<br />
<br />
But in my case it does not go into loop even if condition is true. And if I make..
i == rects.end()
then it goes into the loop but their values are different.And if it goes into loop then it gives error as I explained above.And if I make it like....
<br />
CaptureScreen((RECT &)i, m_mainbuff);<br />
<br />
then it does not give error.But when for is incremented then again it gives error like....
list iterator is not incremental
That's all the case....
Thanks Hiru.
|
|
|
|
|
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++
|
|
|
|