|
toeh wrote: I tried to connect char myvar[] with + operator.
The word you are looking for is concatenate.
toeh wrote: char myvar3[]=myvar1+myvar2; // It's wrong.
Because no memory has been set aside for myvar3 . Try:
char myvar3[13];
strcpy(myvar3, myvar1);
strcat(myvar3, myvar2);
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You cannot concatenate C-style strings like that. Either use strcat() or a string wrapper class (std::string , CString , etc.)
|
|
|
|
|
I tried to specify file name with CreateFile().
It requires char* only.
But I would like to form file name from string.
So I have to convert it to char* and take it into function.
Well, how can I convert string to char* ?
Thank you.
|
|
|
|
|
|
Hello everyone,
I followed the steps for automating Excel using MFC, given in Microsoft's website. However, when I execute the program, then the dialog appears with the "Run" button. But when I click the button, it gives an error message saying "couldn't CreateDispatch() for Excel". What could be the problem here? Oh, and I just upgraded to Office 2003.
Regards,
Prashanth
|
|
|
|
|
I am currently trying to write a program that plays multiple movies and allows the user to draw directly onto the screen while the video is playing. I would like it to persist throughout playback. I am kind of confused to what the best approach to do this would be. I am planning to use the QuickTime API for the video, I like the rendering better than WMP. I was looking for any advice on how to approach this. Should I use multiple views on one document or multiple windows overlayed with one another? Any and all advice is welcomed thanks.
Mike
|
|
|
|
|
Do you mean draw on the video or elsewhere on the screen?
|
|
|
|
|
Yes to draw on the video and have it persist without the video player redrawing that part of the screen.
|
|
|
|
|
barrem wrote: Yes to draw on the video and have it persist without the video player redrawing that part of the screen.
The video player is redrawing at least the video portion of the screen/window at regular intervals.
You'll need to persist whatever is drawn somehow so that it can be redrawn on every frame of video
just before the frame is rendered. This will make it appear the smoothest. You could also redraw
the persisted drawings on the window right after every frame is rendered but this will flicker.
Either way, you need access to the frames of video or at least notification that a frame was just
rendered. I've never used the QT player (for development) so I don't know if you have access to
video at this level.
|
|
|
|
|
I need to figure out if a HBITMAP/CBitmap has an alpha channel, but bitmap.bmBitsPixel is always 32, no matter if it's a 16-color bitmap or 24-bit+alpha channel bitmap.
|
|
|
|
|
I don't think DDBs support alpha channel, at least not in the standard Windows APIs.
|
|
|
|
|
One way is to see if there are any non-zero values in the alpha channel. If so, they it likely has one, though this is definitely not exact.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Is it possible to overload a pure virtual function?
ie:
<br />
class CSomeClass<br />
{<br />
public:<br />
CSomeClass();<br />
virtual ~CSomeClass();<br />
<br />
virtual void Function1(BOOL parm1, BOOL parm2 = TRUE)=0;<br />
<br />
virtual void Function1(BOOL parm1, BOOL parm2 = TRUE, int parm3 = 0)=0;<br />
long m_lData;<br />
}<br />
Or am I missing something, else? I think I can it's just that it's 5:00pm and my brain is fried.
|
|
|
|
|
Is it possible to overload a pure virtual function?
Yes
Although in your example there will be ambiguity when calling the function because of the
default parameters.
|
|
|
|
|
Mark Salsbery wrote: Although in your example there will be ambiguity when calling the function because of the
default parameters.
As Mark said. Either remove the defaults, at least from the last param or change their types so the function signatures are unique.
|
|
|
|
|
Neville Franks wrote:
... remove the defaults, at least from the last param or change their types so the function signatures are unique.
Yup, that's it. The system is complaining about this exact problem. I'll re-arrainge the order of the last two parms when I hook up my workplace LT later. Thanks. I thought of doing this myself earlier but I was getting frustrated with the whole thing so I took a break. These are the last two bugs I have to work out (until the next two, that is!). :P
Thanks, Guys!
C
|
|
|
|
|
Hi Neville. Haven't seen you around in a while.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Ive been using SetPixel alot, where i feed it seperate R G B values, but now im playing with GetPixel, but it only seems to return one big bitwise value, so how can i most cpu friendly wise convert this big number into 3 sperate ints?
thanks
/Johannes
|
|
|
|
|
Johpoke wrote: so how can i most cpu friendly wise convert this big number into 3 sperate ints?
Why not just use GetRValue() , GetGValue() , and GetBValue() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
That sounds right, but how do i connect them or use them correctly? i just get out weird characters, no numbers..
:/
/Johannes
|
|
|
|
|
Johpoke wrote: ...but how do i connect them...
Huh?
Johpoke wrote: i just get out weird characters, no numbers..
How are you using those functions?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
im not sure if im using them correctlt, msdn didnt explain alot, first i tried geting pixel, and sening the int to getrbvale, i also tried some other data types, and last i tied:
cout<<getrvalue(getpixel(hdc, pos.x,="" pos.y));
how="" do="" i="" get="" the="" rvalue="" g="" and="" b="" for="" pixel="" seperate??
thanks!
=""
<div="" class="ForumSig">/Johannes
|
|
|
|
|
Johpoke wrote: cout<<getrvalue(getpixel(hdc, pos.x,="" pos.y));<="" blockquote="">
This is doing exactly what it is supposed to (i.e., printing the character equivalent of the red value). Since your red value is likely not a printable character (e.g., some value less than 33 or greater than 127), that's why you're not seeing a number. Cast it to an int instead.
Johpoke wrote: how do i get the Rvalue G and B for the pixel seperate??
By using the three functions I mentioned earlier.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
yep feeding it into int, or doing int(GetR... works great
thanks for the help!
/Johannes
|
|
|
|
|
Hi,
I'm trying to control another application (Acrobat 5 print settings) and I'm telling it to check a checkbox which is working ok, but when I click OK button and go back in the setting is lost. (unchecked)
If I do it manually with mouse then it saves the information, so my question is:-
is there any further window messages to send to the checkbox or window to save the information in the app, I've tried sending UpdateData and UpdateWindow without any luck.
currently doing code:
if(childWnd->GetDlgCtrlID( )==0x63686B39)
{
CButton *btn = (CButton *) wnd2->GetDlgItem(0x63686B39);
btn->SetCheck(TRUE);
}
Thanks,
Lee.
|
|
|
|