|
Sure because you're to busy stuffing your face with a double cheeseburger!
led mike
|
|
|
|
|
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
I am looking for an advise, explanation of using CAVI.
My BITMAPINFO bmiColors at index 0 appears to have RGB color quad (red , green, blue and reserved) OK but it looks like the "reserved" is actually the next red value.
I have been looking thru the documentation and cannot find explanation for usage of "reserved" "color" and how it gets “filled”.
Any help is appreciated.
Vaclav
|
|
|
|
|
I don't know what CAVI is, but...
Are you sure the bitmap HAS an RGB color table?
What are the BITMAPINFO.bmiHeader values?
Vaclav_Sal wrote: cannot find explanation for usage of "reserved"
From the RGBQUAD docs: "Reserved; must be zero."
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
my bitmap has all required values. The code works "almost perfect", I actually display the captured video, however, I need the color histogram and this is where I see strange values.
And the "reserved" value is NOT zero after the single frame capture!
I think I am overlooking some AVI macro to control the "reserved" value.
It looks like the AVI "bitmap" is plain RGB, not a RGBQUAD.
PS. CAVI - multimedia macros - example "capGetVideoFormat".
Thanks Vaclav
|
|
|
|
|
Again...What are the BITMAPINFO.bmiHeader values?
The format is pretty important
Are you the one constructing the BITMAPINFO?
What code is setting the color table values?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark,
just FYI. I think I can figure this out by myself.
Here is the AVI calback setup and its callback function.
BOOL bCallback = capSetCallbackOnFrame(hWnd, _grabber_CallbackProc);
The docs saiz something about "..and will display it in created window".
It does and that what tru me off - there is no need to convert it to bitmap and then display it if I only want to see it in view window. OK.
However, the _grabber_CallbackProc SetImageData method copies the raw data and it gets messed up in BITMAPINFO!
What I really need is to find out the "layout" of the LPVIDEOHDR and than copy it into BITMAPINFO color map correctly.
Or better yet - do my histogram extraction on the AVI data directly.
LRESULT PASCAL _grabber_CallbackProc(HWND hWnd, LPVIDEOHDR lpVHdr)
{
ASSERT_VALID(theOnlyOneGrabber);
validCallHint = TRUE;
// set grabber image data
theOnlyOneGrabber->SetImageData(lpVHdr->lpData);
validCallHint = FALSE;
return 0;
}
PS As always - ignore the > !!
Thanks for reading.
Vaclav
|
|
|
|
|
Vaclav,
Did you get it straightened out?
There's no BITMAPINFO info in the VIDEOHDR struct. You need to keep
that info yourself if you need it.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Hi friends it's my first participation in this forom and i hope to find a solution to my problem.
I want to build a program (with c++ or vb or borland c++ or other)
1/this program extract some columns from an excel file A (extension .xls) ,an other B (extension .csv) and file C (extension .dat) to a 4th excel file D(.xls).
2/I will then put file D in a data base.
I'm not good in programmation and i wish that u can help me to do the 1st step of my prog.
i'm waiting your popositions .thank u
|
|
|
|
|
This is not a trivial task. One solution would be to use ODBC. The other would be to use Excel Automation.
"Love people and use things, not love things and use people." - Unknown
"The brick walls are there for a reason...to stop the people who don't want it badly enough." - Randy Pausch
|
|
|
|
|
Here is two sets of preprocessor I did not understand completely,
First one is trying to define the class if it is not already defined and
the second one is trying to define a header file if it is not already defined.
But my quesion is what is the syntax or rules for the identifier.
Why there is a underscore before the word Class and H (in second example).
The way I understand is _Class means for Class and _H means for Header.
In header case, it is all upper case. Why it that.
I understand #define, #ifndef but I am not clear about the systax for identifier.
If any body can answer my confusion or direct me to any article I will be glad.
#ifndef TEggCodeParser_Class
#define TEggCodeParser_Class
#if !defined( EXAMPLE_H )
#define EXAMPLE_H
Thank you.
|
|
|
|
|
You can use any valid identifier. Underscores can be used to prevent
future clashes with similar identifiers, or just to indicate that the
identifier is a macro. Just a matter of convention.
Mark
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
In fact the rule is really simple: you can merely put 'almost' what you want. Preprocess is in fact far less complicated that you might think, it is really no more than text processing. In this case, the #define TEggCodeParser_Class can be used later as a kind of flag: if you check for the existance of TEggCodeParser_Class , you can remove certain part of your code from the compilation.
The second example is used to avoid including multiple time the same header file. Don't forget that both of these conditions should be terminated by a #endif. If EXAMPLE_H was already defined (because the header file was already included for example), then everything which lies between the #if !defined and the #endif will be 'discarded'.
|
|
|
|
|
Hello,
I had set timeout with
int n = 20000;
setsockopt(ClientSocket,SOL_SOCKET,SO_RCVTIMEO,(char*)&n,sizeof(int);
and
set mode nonblocking with function call
int iMode = 1;
ioctlsocket(ClientSocket,FIONBIO,(u_long FAR*)&iMode)
if i set mode to nonblocking than timeout is not called in recv().
but if i do it with mode blocking (default) than every thing is
working fine and timeout called.but i have to work with non blocking
mode so anybody can tell me how can i set timeout in nonblocking socket.
or why i dont get timeout ,i missed something plz reply.
Thanx in advance.
|
|
|
|
|
one Suggestion re posting questions will not help you to get answers.
Now i am not sure if this will answer the problem but i will try.
1. Blocking socket and time out set.
This is ideal condition since it is a blocking call After timeout it will come out of the blocking call if nothing to receive.
2. Non blocking and time out set.
Since this is the non blocking call it will come out immediately so there is no need of timeout rather even if it is set you will not get it because if there is nothing to receive call will return..
I hope that makes sense.
Regards,
Sandip.
|
|
|
|
|
Hi,
I have a very famous problem with multiple inheritance here.
class A{
public:
A(){ cout<<"A"<<endl; }
};
class B: public A{
public:
B(){ cout<<"B"<<endl; }
};
class C: public A{
public:
C(){ cout<<"C"<<endl; }
};
class D:public B,public C{
public:
D(){ cout<<"D"<<endl; }
};
int main()
{
D *d = new D;
}
Output:
A
B
A
C
D
I am not able to understand that why the constructor of A is called again after B. Or why not the same is happening after constructor of C is called.
|
|
|
|
|
laksh2204 wrote: I am not able to understand that why the constructor of A is called again after B. Or why not the same is happening after constructor of C is called.
So the compiler goes likes this...
First time it sees "new D" it
1. calls constructor of D
2. which in turn calls constructor of B (Since B if the first base class)
3. which in turn calls constructor of A (Prints "A")
4. then (Prints "B")
5. then the compiler calls constructor of C (Second base class)
6. which in turn again calls constructor of A (Prints "A")
7. then (Prints "C")
8. in the end (Prints "D")
So bottom line is unless base class constructor code executes derived class
constructor doesn't execute.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
modified on Wednesday, August 27, 2008 8:58 AM
|
|
|
|
|
OK, thats nice explanation..
one more issue comes into my mind.
A
/ \
B C
\ /
D
In the same diamond structure if my declaration is like:
class A;
class B : virtual public A;
class C : virtual public A;
class D : public B, public C;
now when i do
A *d = new D; //it will work as ambiguity is removed by virtual.
But, which path will be followed??
A->B->D or A->C->D??
or something else...
|
|
|
|
|
laksh2204 wrote: A *d = new D; //it will work as ambiguity is removed by virtual.
But, which path will be followed??
A->B->D or A->C->D??
Now your output will be
A
B
C
D
I guess first base class gets the preference.
Nibu babu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|
|
This is due to the fact that the base class constructor has to get called before the derived class constructor gets call. since D derives from both B and C constructor of A gets called in either of the cases
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
|
Hi Friends,
I want to run a VB Script in a button click event.
This VB Script is defined in the program itself.
Could anyone tell me how to run the script.
The price of anything is the amount of life you exchange for it.
Thanks and Regards.
SANTHOSH V
|
|
|
|
|
|
Hi All
Can i add EditControl through code.if yes then plz help me..
|
|
|
|
|