|
hi anybody.
i have tried the wait function in the forum .
it works fine in taking pictures with cameras like :
<pre>camera1.release();
wait(1);
camera2.release();</pre>
but when i try showing images in picture box with time interval and the same wait function , the program freezes and only shows the last image after all of waits.
i mean if we have 6 images in program and 10 seconds waiting interval , the last image shown after 10 seconds.
my yahoo id is :mshankayi@yahoo.com
mail :mohd109@gmail.com
i really need to know where is the problem
if anyone wants all the code for helping please just email me.
thanks in advance
sincerely
Mohammad Shankayi
|
|
|
|
|
I'm not sure what wait() is but if it behaves like Sleep() does, the primary thread will be blocked until that function returns. When the primary thread is blocked, it's not going to be processing any messages.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
great
that's it
and one question : what class in .net can do what i want
because it's a simple function.
not to sleep just do sth in time intervals.
thanks a lot
sincerely
Mohammad Shankayi
|
|
|
|
|
If you want to display a picture roughly every 10 seconds, call SetTimer(10000). Draw the picture in/from the WM_TIMER handler function.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
If you're doing this in .net, then this is not the best forum to come for help.
There's a C# and a C++/CLI one.
Good luck,
Iain.
I have now moved to Sweden for love (awwww).
If you're in Scandinavia and want an MVP on the payroll (or happy with a remote worker), or need contract work done, give me a job! http://cv.imcsoft.co.uk/[ ^]
|
|
|
|
|
Hi guys,
I implemented Class Time with private members and public function, any way I used to declare friend function to access those private data members.
The first Time give me the right value but the second gives me 0 Zeroooos I done know why
And the header is follwing over here
#pragma once
#include <iostream>
using namespace std;
class Time
{
private:
int hour;
int minute;
int second;
public:
Time();
Time(int hour,int minute,int second);
void setTime();
int getHour(int h);
int getMinute(int m);
int getSecond(int s);
void printTime();
friend ostream & operator<<(ostream& , Time);
friend istream& operator>>(istream&,Time);
};
.CPP
Time::Time()
{
this-> hour = 0;
this-> minute = 0;
this-> second = 0;
}
Time::Time(int h,int m, int s)
{
this-> hour = h;
this-> second = s;
this-> minute = m;
}
istream & operator>>(istream &in ,Time t2 )
{
in>>t2.hour>>t2.minute>>t2.second;
return in;
}
ostream& operator<<(ostream &o, Time t2 )
{
o<<t2.hour<<t2.minute<<t2.second;
return o;
}
Finally the main
Time t(1,22,22);
Time t2;
cout<<"The first Time is:\n";
cout<<t;
cout<<endl;
cout<<"Enter the second time\n";
cin>>t2;
cout<<"2nd time\n";
cout<<t2;
cout<<endl;
system("pause");
return 0;
|
|
|
|
|
dr.nokia wrote: istream & operator>>(istream &in ,Time t2 )
This function is not changing the t2 variable that was created in main() . Change the second parameter to a reference instead.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
dr.nokia wrote: istream & operator>>(istream &in ,Time t2 )
{
in>>t2.hour>>t2.minute>>t2.second;
return in;
}
you need pass a reference to change the actual object:
istream & operator>>(istream &in ,Time & t2 )
{
in>>t2.hour>>t2.minute>>t2.second;
return in;
}
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Thanx alot guys now it works I forgot to add this (&)
|
|
|
|
|
A running exe checks version info, if find new, can the exe download new version of itself and replace the exe? is the peplace process trusted?
|
|
|
|
|
includeh10 wrote: can the exe download new version of itself
Yes
includeh10 wrote: and replace the exe?
No, the exe file will be locked by the OS as it is a running process. You can however save the new file under a different name and call the MoveFile function and specify the MOVEFILE_DELAY_UNTIL_REBOOT flag to have the OS replace the exe file the next time the machine is rebooted.
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
Hi I want to Develop a Dictionary Application what data structure i have to use so that my searching becomes becomes faster and the data organized properly.....
|
|
|
|
|
A Simple data structure for Dictionary, at least for "European" type languages is the Trie[^].
This signature was proudly tested on animals.
|
|
|
|
|
Great. What's your question? "How to start?" does not count.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
|
Hi
I just got encrypt ActiveX dll. I want to it use without registering it.
Any sample would be greatly appreciated.
Best regards,
|
|
|
|
|
ActiveX can not be used if without register it.
but you can register it in main program, so it looks not registered - or you can unregister it when main app exists.
MSDN has a sample about how to register ActiveX, just a few of lines, very easy.
I can not remember the sample name - regsrv32 or some name similar to this.
modified on Friday, October 2, 2009 12:08 PM
|
|
|
|
|
regsvr32
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
includeh10 wrote: ActiveX can not be used if without register it.
This is not completely true.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
how so?
You may be right
I may be crazy
-- Billy Joel --
Within you lies the power for good - Use it!
|
|
|
|
|
|
Hi guys,
I've just written a piece of code which works fine and now I need to do one more and the last operation to complete the whole project. I'd like to count how many times all elements in each combination repeat. To be more precise I'm interested in number of occurences which are equal or bigger than six. Here's the code. You can use it for your studies if you want:
#include "IndexCombination.h"
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <iterator>
#include <map>
#include <sstream>
using namespace std;
using namespace stdcomb;
bool GetNextComb(std::vector<unsigned int> &vi);
struct Element
{
char name[6];
int numbers[30];
char chain[90];
};
const Element elements[] = {
{
"ia11",
{3,9,17,21,24,31,33,36,42,49,4,8,19,22,28,30,34,39,43,47,2,6,10,13,14,25,29,37,38,46},
"3,9,17,21,24,31,33,36,42,49,4,8,19,22,28,30,34,39,43,47,2,6,10,13,14,25,29,37,38,46"
}, {
"ia34",
{1,6,12,15,22,27,31,32,41,42,4,7,14,17,23,30,33,36,45,48,2,9,13,18,21,26,34,39,44,49},
"1,6,12,15,22,27,31,32,41,42,4,7,14,17,23,30,33,36,45,48,2,9,13,18,21,26,34,39,44,49"
}, {
"ia72",
{3,8,11,18,22,25,36,37,43,46,1,6,16,17,23,28,35,40,41,44,2,5,12,19,24,27,31,34,42,49},
"3,8,11,18,22,25,36,37,43,46,1,6,16,17,23,28,35,40,41,44,2,5,12,19,24,27,31,34,42,49"
}, {
"ia167",
{3,4,12,15,21,28,32,39,47,48,6,9,16,17,29,30,31,38,41,42,7,8,11,20,26,27,34,35,45,46},
"3,4,12,15,21,28,32,39,47,48,6,9,16,17,29,30,31,38,41,42,7,8,11,20,26,27,34,35,45,46"
}, {
"ia190",
{3,10,11,14,22,23,32,35,43,44,6,9,16,19,24,29,37,38,45,48,2,5,13,18,25,30,31,40,41,0},
"3,10,11,14,22,23,32,35,43,44,6,9,16,19,24,29,37,38,45,48,2,5,13,18,25,30,31,40,41,0"
}, {
"ia21",
{2,5,16,19,25,30,34,39,45,48,1,9,12,13,21,24,33,36,44,49,3,8,15,20,23,26,35,40,43,46},
"2,5,16,19,25,30,34,39,45,48,1,9,12,13,21,24,33,36,44,49,3,8,15,20,23,26,35,40,43,46"
}, {
"ia64",
{6,9,13,20,28,29,33,40,43,48,2,7,16,19,24,27,31,34,44,47,5,8,14,17,21,30,32,37,41,46},
"6,9,13,20,28,29,33,40,43,48,2,7,16,19,24,27,31,34,44,47,5,8,14,17,21,30,32,37,41,46"
}, {
"ia102",
{4,9,14,19,22,29,35,38,46,47,5,8,13,16,21,26,33,40,41,48,6,7,15,17,28,30,32,39,42,45},
"4,9,14,19,22,29,35,38,46,47,5,8,13,16,21,26,33,40,41,48,6,7,15,17,28,30,32,39,42,45"
}, {
"ia178",
{6,9,15,20,23,24,37,38,42,45,7,8,16,19,22,25,34,39,43,46,1,2,17,18,26,29,31,40,47,0},
"6,9,15,20,23,24,37,38,42,45,7,8,16,19,22,25,34,39,43,46,1,2,17,18,26,29,31,40,47,0"
}, {
"ia180",
{1,4,13,18,27,30,33,38,45,46,2,3,12,15,22,23,39,40,44,47,8,9,11,17,24,25,32,37,49,0},
"1,4,13,18,27,30,33,38,45,46,2,3,12,15,22,23,39,40,44,47,8,9,11,17,24,25,32,37,49,0"
}
};
int main(int argc, char *argv[])
{
CIdxComb cb;
cb.SetSizes(10,6);
vector<unsigned int> combination(6);
combination[0] = 0;
combination[1] = 1;
combination[2] = 2;
combination[3] = 3;
combination[4] = 4;
combination[5] = 5;
int Total = 0;
while(cb.GetNextComb(combination))//the compiler stops here
{
Total++;
cout << "Combination number. " << Total << endl;
for (unsigned i = 0; i < combination.size(); i++)
{
const Element &element = elements[combination[i]];
cout << element.name << ": " << element.chain << endl;
}
cout << endl;
}
system("PAUSE");
return EXIT_SUCCESS;
}
I know that only a few lines are needed to achieve the goal. I've read quite a lot on the subject, but somehow can't figure out how to do it.
Can anybody help me ?
|
|
|
|
|
Waldemar Ork wrote:
while(cb.GetNextComb(combination))//the compiler stops here
And what error does the compiler give you when it stops?
What is the output that you are expecting? I'm just guessing, but I don't see any relevance to the name and chain members of the structure. If that's the case, remove them from the problem.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
This comment is out of date, I forgot to remove it some time ago. I'm really sorry.
|
|
|
|
|
Hi all,
Here i am developing VSS Hardware provider, when i am calling the DOSnapshot method from the requestor. VSS is returning with the error VSS_E_HOLD_WRITES_TIMEOUT
Like this
Returned HRESULT = 0x80042314
- Error text: VSS_E_HOLD_WRITES_TIMEOUT
- Please re-run VSHADOW.EXE with the /tracing option to get more details
"http://msdn.microsoft.com/en-us/library/aa382659(VS.85).aspx"
Thanks in advance
Vishwanagh
|
|
|
|
|