|
Hi,
In my application whenever alarms occur, we are playing sound.(.wav file)
For that
i include this set of code in one thread function.
void tRecvActiveData()
{
while(1)
{
if(bAlarmHHBeep)
PlaySound("IDR_LOWALM", hInst, SND_RESOURCE | SND_ASYNC)
}
}
when the application is running,this sound is playing continoulsy but not fully completed.
Only its playing a single beep(starting sound only).
It does not get completed fully.
That thread function is used for continous checking of alarm.
Pls kindly help me out..
|
|
|
|
|
add the SND_LOOP and SND_NOSTOP flags.
Independent ACN Business Owner- Check out the possibilities for your future!
- Financial independance
- Full time or Part time
- In more than 20 countries through North America, Europe, Asia and the Pacific
- Featuring the ACN IRIS 5000 video phone. See the person you are talking to.
Within you lies the power for good - Use it!
|
|
|
|
|
Thanks for your valuable support.It is working fine.
|
|
|
|
|
Hi,
I have 2 custom drawn oval buttons that initialized inside onInitDialog. The problem is that those buttons are trying to save the background of their position (to create their transparent mask) before the actual background is drawn to this dialog.
I draw the dialog's background inside the onPaint() instead of the onEraseBkgd() to avoid flickering, but onPaint() is called after the onInitDialog is over.
Any recommendations ?
Regards,
sdancer75
|
|
|
|
|
You can always use a static variable to save anything you need from the first OnPaint() call...
static bool FirstPaint = true;
if(FirstPaint){
FirstPaint = false;
}
|
|
|
|
|
Thank you Albert for your answer, but onPaint() is comming after the custom draw of the button.
So the buttons are initialized inside the onInitDialog do everything they need and after that is called the onPaint() method.
What I need is to call onPaint() before any button initialization inside the onInitDialog.
Regards,
sdancer75
|
|
|
|
|
sdancer75 wrote: onPaint() is comming after the custom draw of the button
It shouldn't... any custom drawing should take place within OnPaint(). That is the proper place to do it, hence the name. If you're doing it elsewhere, well, don't.
|
|
|
|
|
Thank you Albet,
The custom draw is done inside the onDraw of the button class, so this is preceding by default the OnPaint() of the parent window.
Anyway the solution I found is to delay the onDraw using a flag variable inside the OnEraseBkgnd() of the button class, that always executed after the OnPaint() of the parent class.
Best Regards,
sdancer75
|
|
|
|
|
Need help creating a scrollview like MSWord or Adobe Reader. What I mean to do is - create a view which displays like a centered A4 piece of paper. (Also like Print Preview).
Can you please provide a link to a sample application that does this?
Thanks
bart
|
|
|
|
|
|
Hi all. Which is the best way to disable OnFileNew, OnFileOpen and OnFileSave(As) in a SDI application ? Beside, I wish to dispaly in status bar a custom message ( "You can't open a document" or something ... )
I found a little solution to disable menu item (CCmdUI* ... ) but I want to set a message in status bar before ....
|
|
|
|
|
Just add handlers for ID_FILE_NEW , ID_FILE_OPEN , ... to your class, and update the status bar from within your functions. And, of course, don't call the corresponding CWinApp handlers OnFile... from your own handlers.
|
|
|
|
|
CStatusBar[^] has an explanation of the sequence to follow.
Unrequited desire is character building. OriginalGriff
I'm sitting here giving you a standing ovation - Len Goodman
|
|
|
|
|
Hi Developers,
I am developing a MDI based application. I want to show a transparent image. I have used Microsoft Activx Picture Control 2.0. But it's not showing the image transparently, it's coming with a gray background. In MFC picture controls is not supporting PNG image.
Can anyone help me to do it.
Thanks In Advance.
Amrit Agrawal, Mumbai.
|
|
|
|
|
Try it[^] in your own control's rendering...
They sought it with thimbles, they sought it with care;
They pursued it with forks and hope;
They threatened its life with a railway-share;
They charmed it with smiles and soap.
|
|
|
|
|
Friends, I use Visual Studio (2008) and created a project (MFC Doc-View application). I have to use some third party libraries (which has DLLs etc). How to use 'using' to make the program alright? I request a reliable reply.
If 'using' cannot be made use of in MFC, may I know how to invoke the DLLs.
My e-mail is rajeswarit@rediffmail.com
With many thanks,
Rajeswari
|
|
|
|
|
|
A quick off-topic remark: I suggest to edit your posting to at least insert blanks in your email address, replace '@' with '(at)' or similar means to confound spam bots that frequent public forums in search of email addresses. Doing so might safe you from unwanted spam. Even better, don't post your E-Mail address at all, at least not in places that can be read with public access.
Regarding your question, invoking a DLL has nothing to do at all with 'using' (at least in C/C++). Referring classes and functions from another DLL can be achieved by different means, but the easiest is to add the header files of that DLL to your project, #include them, and add the export libraries (*.lib) to your linker 'additional libraries' (or similar) options. Follow the links in the response above for more help.
|
|
|
|
|
Hi,
I have a file that is replacing embedded blanks with x0d 0a and starting text again is there anyway to read the text as I CRead::Read(file,121) and I am expecting text in certain columns
Thanks
|
|
|
|
|
ForNow wrote: I have a file that is replacing embedded blanks with x0d 0a...
I'm with you so far.
ForNow wrote: ...and starting text again
Things start getting unclear at this point.
ForNow wrote: is there anyway to read the text as I CRead::Read(file,121)...
Not sure what this means.
ForNow wrote: ...and I am expecting text in certain columns
Ok. Does this have any relevance to your other text?
Please be clear with your question(s). Run-on sentences make it hard to decipher.
"One man's wage rise is another man's price increase." - Harold Wilson
"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
"Show me a community that obeys the Ten Commandments and I'll show you a less crowded prison system." - Anonymous
|
|
|
|
|
e.g. This how the file appears when open it under note pad
Options for this Assembly
0 NOADATA
ALIGN
ASA
BATCH
CODEPAGE(047C)
NOCOMPAT
NODBCS
NODECK
DXREF
ESD
NOEXIT
NOPCONTROL
NOPESTOP
here is how the file looks in memory using CFILE::READ(pbuf,121)
0x001AA3C8 54 0d 0a 20 20 20 20 20 4f 50 54 41 42 4c 45 28 55 4e 49 2c 4e 4f 4c 49 53 54 29 0d 0a 20 20 20 4e 4f 50 43 4f 4e 54 52 4f 4c 0d 0a 20 20 20 4e 4f 50 45 53 54 4f 50 0d 0a 20 T.. OPTABLE(UNI,NOLIST).. NOPCONTROL.. NOPESTOP..
0x001AA402 20 20 4e 4f 50 52 4f 46 49 4c 45 0d 0a 20 20 20 4e 4f 52 41 32 0d 0a 20 20 20 4e 4f 52 45 4e 54 0d 0a 20 20 20 20 20 52 4c 44 0d 0a 20 20 20 20 20 52 58 52 45 46 0d 0a 20 20 NOPROFILE.. NORA2.. NORENT.. RLD.. RXREF..
for example the are at least over 100 blanks "0x20" between NOPCONTROL and NOPSTOP They are being truncated discregarded After the text NOPCONTROL all blanks following are being disregarded and replaced by carriage reuturn X0D and line feed 0x0A
|
|
|
|
|
Notepad is showing NOPESTOP in the next line after NOPCONTROL.
This means that there is a 0x0D/0x0A pair after NOPCONTROL.
You can verify this by turning off word wrapping (Format -> Word Wrap).
If the test still displays as it is now after turning off word wrap, you can be sure that there is a 0x0D/0x0A pair after NOPCONTROL.
|
|
|
|
|
Is there any way to do one CFILE::PREAD for every 0xoA/0x0d
Thanks
|
|
|
|
|
|
I have C++ application in which so many STL data structures used. I am storing my own class objects in the STL data structures. For example some are std::map<wchar_t*,wchar_t*>, std::map<int,myclass*>, etc...
I would like to serialize the data structure with out using MFC's CArchive. I tried to use wfstream and it is not working for unicode strings.
is there any easy way to achieve this?
thanks in advance
- Mutpan.
|
|
|
|