|
I would like to know as well, because, like PJ, I am pretty sure there is NOT one available.
|
|
|
|
|
|
Hello everyone.
I use the grid control(DBGrid) in my program and link it to a remote data control(RDC), through which a data source is connected to my program.
I have read two examples on the RDC downloaded from the networks. And I do not understand the useage of the member function SetCursorDriver().
If you can help me please reply my message, thank you.
The sea is so big and my boat is so small.
|
|
|
|
|
We are working on web-narrator(reader) for hindi in that
we have prepared internet browser using Chtmlview class in mfc on which we are having button "PLAY" . problem is when i press it application starts playing the text(using TTS) but overall control of browser do not remains active it hangs up . i thing it is because of following code in play function spetially the loop of status checking
void CDirectSound::Play(DWORD dwStartPosition, BOOL bLoop)
{
if( ! IsValid() || ! IsEnabled() )
return; // no chance to play the sound ...
if( dwStartPosition > m_dwTheSound )
dwStartPosition = m_dwTheSound;
m_pDsb->SetCurrentPosition(dwStartPosition);
/*m_pDsb is member of CDirectSoundBuffer*/
if( DSERR_BUFFERLOST == m_pDsb->Play(0, 0, bLoop ? DSBPLAY_LOOPING : 0) ) {
// another application had stolen our buffer
// Note that a "Restore()" is not enough, because
// the sound data is invalid after Restore().
SetSoundData(m_pTheSound, m_dwTheSound);
// Try playing again
m_pDsb->Play(0, 0, bLoop ? DSBPLAY_LOOPING : 0);
//m_pDsb->GetStatus
}
LPDWORD lpdwStatus;
unsigned long ulStatus;
lpdwStatus=&ulStatus;
m_pDsb->GetStatus(lpdwStatus);
while(ulStatus!=0)
{
m_pDsb->GetStatus(lpdwStatus);
}
}
please if you get solution for the above problem do reply soon
|
|
|
|
|
Are you sure that 0 is the value you're looking for to terminate the loop? It could be that your logic is flawed. Checking the DirectSound documentation, IDirectSoundBuffer::GetStatus returns a combination of one or more of the following values:
DSBSTATUS_BUFFERLOST - The buffer is lost and must be restored before it can
be played or locked.
DSBSTATUS_LOOPING - The buffer is being looped. If this value is not set, the
buffer will stop when it reaches the end of the sound data. This value is
returned only in combination with DSBSTATUS_PLAYING.
DSBSTATUS_PLAYING - The buffer is playing. If this value is not set, the
buffer is stopped.
DSBSTATUS_LOCSOFTWARE - The buffer is playing in software. Set only for
buffers created with the DSBCAPS_LOCDEFER flag.
DSBSTATUS_LOCHARDWARE - The buffer is playing in hardware. Set only for
buffers created with the DSBCAPS_LOCDEFER flag.
DSBSTATUS_TERMINATED - The buffer was prematurely terminated by the voice
manager and is not playing. Set only for buffers created with the
DSBCAPS_LOCDEFER flag.
I'm not sure what values your own version of GetStatus returns,
but you may want to check for errors that may have terminated the playback. If some error occurs, can your own GetStatus *ever* return 0?
Just firing off some ideas...
Bob Ciora
|
|
|
|
|
I have an equation (abs(.223 - .323) / .223) *100 that isn't working - as I've researched the abs function it appears to only accept integer values? How do I get it to accept double or float values?
Thanks!
|
|
|
|
|
|
Visual Calc returns 44.843049 to (abs(0.223 - 0.323) / 0.223) * 100 ...
fabs() may be what you need...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
How can VC++ implement the function of MATLAB function imread()?
That is, read in a jpg file, then get the pixel values.
Does any one know if there is any library for doing this?
Thanks
|
|
|
|
|
|
I use load frame to create a childFrame.
CChildFrame* ChildFrame=new CChildFrame(); <br />
ChildFrame->LoadFrame(IDD_COMMANDFORMVIEW,WS_OVERLAPPEDWINDOW|32768,AfxGetMainWnd());
The childframe is creating a FormView that has one editctrl.
The view is loaded and i can see but when i try to do a Ctrl-C or Ctrl-V in the edit box nothing happens! If i right-click and select 'paste' it works fine. What's wrong with it?
Is there any sample on the internet that makes use of LoadFrame where i can see what i'm doing wrong?
- - - - - - - - - - - - - - - - - -
Memory leaks is the price we pay \0
01234567890123456789012345678901234
|
|
|
|
|
|
I found out that this is a general problem with Edit ctrls inside CFormView. You have to add an ON_UPDATE_HANDLER for ID_COPY,ID_PASTE, etc (that's why i couldn't find any WM_COPY, MFC turn them into commands!).
|
|
|
|
|
how to use crystal report with ado
|
|
|
|
|
|
I have a problem with a simple ifstream in Visual C++ 6.0 (Console App). The following part of programcode produces a "0xC0000005: Access Violation" Error. Can anybody see the problem?
included headers:
#include "stdafx.h"
#include "conio.h"
#include "windows.h"
#include "iostream.h"
#include "fstream.h"
Code:
...
ifstream dat;
dat.open("c:\\back.ini");
if(!dat){
return false;
}
...
|
|
|
|
|
you may not test directly !dat . you should look the error bits of ios_base class...
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
No, the problem is to open the file. If i remove if(!dat), the same error occures.
|
|
|
|
|
but wher does it crash ?
could you please help us in copying the lines of code && error description ?
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
It crashes during the running process, its not during the compiling process. The Application end with the Errorcode:
Nicht abgefangene Ausnahme in back.exe: 0xC0000005: Access Violation.
and display's me a part from the istream.cpp:
istream& istream::operator>>(char * s)
{
int c;
unsigned int i, lim;
if (ipfx(0))
{
lim = (unsigned)(x_width-1);
x_width = 0;
if (!s)
{
state |= ios::failbit;
}
else
{
for (i=0; i< lim; i++)
{
c=bp->sgetc();
if (c==EOF)
{
state |= ios::eofbit;
if (!i)
state |= ios::failbit|ios::badbit;
break;
}
else if (isspace(c))
{
break;
}
else
{
Stopps here-> s[i] = (char)c; <---Application Stopps here
bp->stossc(); // advance pointer
}
}
if (!i)
state |= ios::failbit;
else
s[i] = '\0';
}
isfx();
}
return *this;
}
|
|
|
|
|
cpp_fritz wrote:
istream& istream::operator>>(char * s)
...
Stopps here-> s[i] = (char)c; <---Application Stopps here
's' was not properly initialized before being passed in.
"You're obviously a superstar." - Christian Graus about me - 12 Feb '03
"Obviously ??? You're definitely a superstar!!!" mYkel - 21 Jun '04
Within you lies the power for good - Use it! Honoured as one of The Most Helpful Members of 2004
|
|
|
|
|
Functions and variable can be declared as static.
Can a class be declared as static?
For example given below
static class X {
public :
int x;
};
Philip
|
|
|
|
|
u should know what static means.
static makes a thing (function or varable) into real thing - or the thing is created in memory (an instance for var).
class is a concept or blueprint which can not be created in memory (its instance can).
includeh10
|
|
|
|
|
Nope, but you can do like this:
static class X {
public :
int x;
} static_object_of_class_X; // The variable static_object_of_class_X will have static linkage.
|
|
|
|
|
writing a class means in defining the memory organisation of the type you are creating.
static class X { /*...*/ }; is as if you define a syte that is already static (which don't mean anything).
static means several things.
1st, static means that the life of the variable should be durind still the program is running. of course, its scope don't change, but the variable is not destroyed when the function it is in ends.
2nd, static means that the data member is defined once for all instances of an object.
3rd, static applied for function members means that the function may access only static data members.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|