|
Hey,
I've developed a custom control with uses a memDc to draw flickerfree. The control works perfectly on WinXP but not on W2k. In W2k is instead of the control a blank screen.
Can somebody help me.
<br />
CDC dcMem; <br />
CBitmap *bmpMem; <br />
CBitmap* pOldBmp=NULL; <br />
<br />
bmpMem = new CBitmap(); <br />
<br />
if(dcMem.CreateCompatibleDC(pDC)) <br />
{ <br />
if(bmpMem->CreateCompatibleBitmap(pDC,iBitmapWidth,iBitmapHeight)) <br />
pOldBmp = dcMem.SelectObject(bmpMem); <br />
else <br />
return -10; <br />
} <br />
else <br />
return -9; <br />
<br />
<br />
<br />
<br />
pDC->BitBlt(reRect.left, reRect.top, iBitmapWidth, iBitmapHeight, <br />
&dcMem, <br />
reRect.left, <br />
reRect.top +m_iVertScrollbarPos, <br />
SRCCOPY); <br />
|
|
|
|
|
I have had similar problems - sounds like it is creating a very large buffer because of some system dependent call that returns a very large value that causes an error. Check the Scrollbar values for example to see if this is the case - that it returns a large eroneous value.
A cynic is a man who, when he smells flowers, looks around for a coffin. -H.L. Mencken
|
|
|
|
|
hi..i m developing a n/w based 3d arcade game,n now i want to put it on the network..n max two player can play this game...can anyone help me in this regard..how can i implemnt the n/w in my game....
Regards
NooR
|
|
|
|
|
Hi,
I think this tutorial will help:
<a href="http://www.codeguru.com/cpp/i-n/network/games/article.php/c5441/">http:
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
hi,
v have made a gam i-e arcade game havin loads of textures due to which its speed get so slow.in order to make it fast..wat thing is to adopt..either in programming or have to use external hardware.like RAM
Regards.
NooR
|
|
|
|
|
speak english please... and ask specific question.
|
|
|
|
|
Hello.
I'm building my own flash to video converter. And I have a bit of a problem with the sound.
I have tried different approaches, first by creating an avi-file with the video and then afterwards adding the sound. The latest one has been to save the video and audio into two different files as raw data, and then used ffmpeg to make the avi.
But I always get same result that the sound is lagging behind the video.
I used ffmpeg on the raw datafiles and found out that the sound file is a few second longer.
I have seen a flashconverter that converts the movie without playing the sound and still is enable to record the sound.
So I'm wondering how it is possible to grab the sound without playing it?
And if anyone has some other suggestions to my problem with the sound lagging, sound being longer than the movie.
Thanks
Torbjörn
|
|
|
|
|
hello!! i am trying to write some data that is present in the node of a linked list on to an FTP file. suppose that i have a linked list that stores an integer in each of its node, i can write the integer value present in a node to a file on the FTP server but i want to print them in separate lines. so, how can i switch to the next line to write the next value?
vijay
|
|
|
|
|
Hi,
This site has alot of Solutions that might help, just scroll down to Winsocks....
<a href="http://www.codeguru.com/cpp/i-n/network/">http:
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
aroli vijay wrote: so, how can i switch to the next line to write the next value?
Is a CR and/or LF character not sufficient?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I want to call the function
strtok(char *strToken, const char *strDelimit );
but my data is object of CString.
What the function can convert data from CString to char?
|
|
|
|
|
You may use
CString::GetBuffer()
RinuRaj
|
|
|
|
|
Hi,
char or char* ?
CString variable to char*
-------------------------
Use CString::GetBuffer(). It can be used in a manner similar to this:
void test_func ( LPTSTR lpszString, int length );
CString string;
test_func ( string.GetBuffer ( 50 ), 50 );
string.ReleaseBuffer ( );
CString variable to char
------------------------
CString DummyString;
const size_t StringSize = 100;
size_t CharactersConverted = 0;
char DummyToChar[StringSize];
wcstombs_s(&CharactersConverted, DummyToChar,
DummyString.GetLength()+1, DummyString,
_TRUNCATE);
CString to Char
---------------
#include <afx.h>
#include <stdio.h>
void main()
{
CString theString( "This is a test" );
char* mychar = new char[theString.GetLength()+1];
_tcscpy(mychar, theString);
printf ("mychar= %s",mychar);
}
Note: None of the code has been tested.
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
if you use CString in your program, you are in C++. strtok() is a function of the C runtinme.
so, there certainly is a better function to do what you exactly try to do...
|
|
|
|
|
I want to separate the character
such as
CString data[3],buffer;
buffer="aaa,bbb,ccc"
I want
data[0]="aaa";
data[1]="bbb";
data[2]="ccc";
|
|
|
|
|
|
I use Visual c++ 6.0, I don't know why,
I can't call this function.
But I already try follow "Rinu_Raj" and "programm3r" by use
CString::Getbuffer()
as..
char Del[]=",";
char *str,*buff;
CString buffer,data[3];
buffer="aaa,bbb,ccc";
str = buffer.GetBuffer (10);
buffer.ReleaseBuffer ( );
buff = strtok(str,Del);
data[0] = buff;
buff = strtok(NULL,Del);
data[1] = buff;
buff= strtok(NULL,Del);
data[2] = buff;
TRACE("backup[0]=%s\n",data[0]);
TRACE("backup[1]=%s\n",data[1]);
TRACE("backup[2]=%s\n",data[2]);
I confuse the input parameter of Getbuffer().
I try to change it to 1,10,100,1000 it still can use no problem.
How much value I should be use
and
What does this parameter mean?
|
|
|
|
|
Max++ wrote: buffer="aaa,bbb,ccc";
str = buffer.GetBuffer (10);
buffer.ReleaseBuffer ( );
That won't work. Once you use ReleaseBuffer, the pointer isn't valid.
Since you're using a single character delimiter, you could use AfxExtractSubString instead.
Steve S
Developer for hire
|
|
|
|
|
try this, if satisfies your need. Use sTemp to assign to array.
int nIndx=0;
CString sTemp;
while(nIndx != -1)
{
int nTemp=s.Find(",",nIndx);
if (nTemp==-1)
{
if (nIndx !=0)
{
sTemp=s.Mid(nIndx,(s.GetLength()-nIndx));
}
break;
}
sTemp=s.Mid(nIndx,(nTemp-nIndx));
nIndx=nTemp+1;
}
|
|
|
|
|
Use AfxExtractSubString() instead.
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Example below which is helps to make use of strtok
eg.
char *szSep="\";
char *sDest=NULL;
char *szChar=NULL;
CString sString="Hell0\Word";
sprintf(szChar,"%s",sString);
sDest=strtok(szChar,szSep);
kk
|
|
|
|
|
don't mix C and C++
there are whatever you want in the C++ libraries.
also, read the previous answers...
|
|
|
|
|
Karthikeyan .g wrote: sprintf(szChar,"%s",sString);
You don't expect this to work, do you?
"Talent without discipline is like an octopus on roller skates. There's plenty of movement, but you never know if it's going to be forward, backwards, or sideways." - H. Jackson Brown, Jr.
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
You do NOT want to pass in a CString's buffer to strtok. strtok changes the buffer it operates on. Thus, if you pass in the buffer returned from GetBuffer, it will change it and the original CString object will be invalidated (that is, the data will be changed) when you call ReleaseBuffer. Looking through what you want to do, just use something like:
void Split(CString strText, CString strSeparators, CStringArray& strArray)
{
int start = 0;
while (start >=0 && start < strText.GetLength())
{
int stop = strText.Find(strSeparators, start);
if (stop < 0 || stop > strText.GetLength())
stop = strText.GetLength();
strArray.Add(strText.Mid(start, stop - start));
start = stop + 1;
}
}
The strArray parameter will hold the values you are looking for.
If you decide to become a software engineer, you are signing up to have a 1/2" piece of silicon tell you exactly how stupid you really are for 8 hours a day, 5 days a week
Zac
|
|
|
|
|
hi,
I have got blob file, and i want to insert that into image/blob column of database, how can i do that programmatically in C++/MFC.
Warm Regards,
Mushq
|
|
|
|