|
|
Watched code never compiles.
|
|
|
|
|
|
Compare what ? the file or the audio ?
With a lot of difficulties.
Good luck.
Watched code never compiles.
|
|
|
|
|
|
With a lot of work and with the help of a Fast Fourier Transformation. (google for that)
And then there is the issue of file formats and sampling rates and all that junk.
Good luck.
Watched code never compiles.
|
|
|
|
|
What do you mean by "compare" exactly ? Your question is totally vague, please clarify. And please describe your question in the body of the message, not in the header.
|
|
|
|
|
I have a large audio file (MP3 and wma). Now I want to find some particular Track (speech) in that audio large files. So How can I compare two Audio files Samples .
|
|
|
|
|
hello Friends
In my application there are too many windows and I want to know the device context(Handle) on which i want to draw mine image.How do I get that device context?
Any Ideas?
Regards
Yogesh
|
|
|
|
|
See here[^].
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
THanks For Reply.
I am not able to use GetDc bcoz my application is multiDoc And am not having handle to the Window as there are too many.And GetDC parameter is Handle to that Window.
I tried FindWindow also to retrieve the handle of Display window but FindWindow returning null.
I am Using VC6.0
Any other Ideas.
Regards
Yogesh
|
|
|
|
|
yogeshs wrote: am not able to use GetDc bcoz my application is multiDoc
Then there is something wrong with your application, multi-document has nothing to do with Windows on the display.
yogeshs wrote: And am not having handle to the Window as there are too many
Sounds like you need to reconsider the design of your application.
yogeshs wrote: tried FindWindow also to retrieve the handle of Display window but FindWindow returning null.
Then you need to use your debugger to find out why it returns NULL. Check the status returned from GetLastError() .
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
All you have to do is call GetDC() as Richard told you. And when you are done, call ReleaseDC() . It really doesn't matter if yours is a multi doc app as every doc (usually) has a window associated with it and GetDC() is related to a window.
|
|
|
|
|
Hello Sir,Thanks For Reply.I am using GetDC() but I dont have handle of my display window.And If i use NULL In GetDC() Parameter (HDC dc = GetDC(NULL)) then It is returning the Device context for Full Screen. but I need for only my dispaly where i have to draw mine images.
Any Idea for getting Handle of that Display Window Or anyother way to get DC?
Regards
Yogesh
|
|
|
|
|
Look at the link I gave you, GetDC(HWND hWnd) returns the device context for the window with the specified handle. If hWnd is NULL then you get the DC for the entire display. That is the way it works and you have to code to those rules. If you don't have the handle of one of your windows then there is something seriously wrong with your application.
Perhpas you are not explaining your problem clearly. In most cases you would write or draw on the DC within your window's WM_PAINT message handler where all the relevant details are provided by the framework.
Just say 'NO' to evaluated arguments for diadic functions! Ash
|
|
|
|
|
The only idea is to use GetDC() on a window.
I have some question. What are you trying to achieve? Is the window from your app or are you attempting to draw on some other app? To let people help you better, you have to respond to these questions.
|
|
|
|
|
Thanks For Ur Valuable Reply.I appreciate ur time for My Questions.
Let me tell you Again:
There Is an application which is used to draw some images or like that.
But Now,I want to draw Some Transparent Images By Using Draw method Of Graphics(From GDI PLUS).NOw to Draw On that Device Context,I need that DC.And the file in Which I am working doesnt contain any OnDraw or either am not able to get Handle of r that Display Window.
ANd Yes, Window is from my own application.
Regards
Yogesh
|
|
|
|
|
In win32 you can retrieve the active MDI child of a window with this:
HWND active_mdi_child = (HWND)SendMessage(hMainWnd, WM_MDIGETACTIVE, 0, 0);
In MFC you can also retrieve the active MDI child using this code:
CMDIFrameWnd *pFrame = (CMDIFrameWnd*)AfxGetApp()->m_pMainWnd;
CMDIChildWnd *pChild = (CMDIChildWnd*)pFrame->GetActiveFrame();
CMyView *pView = (CMyView*)pChild->GetActiveView();
I just copy-pasted this from here[^].
In MFC depending on your window structure you have to draw on either pChild or pView . You can get the HWND by writing either pChild->m_hWnd or pView->m_hWnd . From now on you can use the GetDC() or GetWindowDC() to obtain a HDC to the drawable surface and you have to release it using ReleaseDC() when you are done, but this is the general win32 approach. In MFC you can use the corresponding methods of the pChild or pView objects so you don't have to mess with win32 functions and the m_hWnd member (pChild->GetDC() , pChild->ReleaseDC(...) and so on).
BUT, if you want to draw your image somewhere, then you need a control (maybe a custom control) that draws the image on its own surface every time its WndProc() is called with WM_PAINT event, otherwise your image stays there only till the next time windows asks the window to redraw a part of its surface. It would be better to put a ON_WM_PAINT() to the message map of your view and then implement the OnPaint() method in your view, this guarantees that your image is always drawn there when it is needed. In pure win32 you have to make a control that is subclassed somehow (there are many solutions to this) if order to handle its WM_PAINT event, this is a bit more difficult then just adding an entry in a message map in MFC. If you have to do this then search for "window subclassing" with google.
|
|
|
|
|
Hi All,
I am getting Flicker for Toolbar which is Owner Drawn. I am creating a SplitterWnd which has a Form View in Right Side Pane and TreeView in Leftside Pane. There is no flicer in FormView but when i am trying to Disable the Icons in CToolbar for some Condition it is some times Continuosly Flickers i could not understand why this happens.
Code
----
void CMainFrame::OnUpdateFileDeleteplans(CCmdUI* pCmdUI)
{
bool bExecuteSQLWin = false;
if(bExecuteSQLWin)
pCmdUI->Enable(FALSE);
else
pCmdUI->Enable();
pCmdUI->Enable(CheckOpenPlans()); --> Here i added with a Function CheckOpenPlans().......>==========//
}
bool CMainFrame::CheckOpenPlans()
{
CMDIChildWnd* MyWnd = NULL;
MyWnd = MDIGetActive();
CView* pView = NULL;
if(MyWnd != NULL)
{
pView = (CView*) MyWnd->GetActiveView();
if((pView->IsKindOf(RUNTIME_CLASS(CSelectQueryView)) || pView->IsKindOf(RUNTIME_CLASS(OpenPlansTreeView))))
return false;
else
return true;
}
return true;
}
|
|
|
|
|
The OnUpdateToolbarButton() functions will be called automatically by the MFC rotuing during the OnIdle action of your application.
The flicker is probbaly caused by you changing the state of the button(s) multiple times in the same update call.
Try and make sure you only have a single call to Enable(). Assign the desired state to a local variable, compute any required changes in the variable and then call pCmdUI->Enable(variable). By the looks of it you may well be getting a call to Enable with false and true sequentially.
If you vote me down, my score will only get lower
|
|
|
|
|
Hi Roger,
Thank You Very Much for giving me a solution.
Thanks & Regards,
Uday.
|
|
|
|
|
Hello Everybody,
I am new to C programming not yet even C++ experienced. I am following instructions Beginning C (from novice to Professional) Forth Edition from Ivor Horton. I am working on Program and 7.14.
I am compiling with Visual Studio 2010 Express and NetBeans 6.9.1
The program compiles without errors or warnings with NetBeans.
I really like the VS 2010 Express package because of the ease of looking at locals and would like to know more about VS 2010 Ex. This is why I come to you.
This programs has:
#include <stdbool.h> for a header and
bool sorted = false; for a declaration.
I get errors building the program in VS 2010 Ex. the stdbool.h header is not in any sub folder of the main VS 2010 Ex. directory.
I tried to build it as a cpp and c file and same results.
I found a stdbool.h from the Bloodshed DevC++ or Bloodshed and that did not work.
I downloaded the pdf of C99 standard for c dated 2005 could not understand how to make the 6 lines of code to work correctly. seemed way to advance for a begginer.
I tried using #include <windows.h> that was recommended from a user here at codeproject.com.
I have created a small program just to test bool true and false pulled from Program 7.14 of the C programming book I am learning from.
I made this:
#include <stdio.h>
int main(void)
{
int false = 0;
int true = 1;
int i = 0;
int bool = false;
char sorted = ' ';
sorted = false;
return 0;
}
but as you experience will see that false will not be zero but rather a decimal of 32
Nothing worked.
HELP!! Please..
rarael
|
|
|
|
|
Hi,
Visual Studio is capable of building C programs as well as C++ programs.
The distinction between C and C++ by default is made based on the file extension (.c versus .cpp).
In C, I have never seen or needed a stdbool.h header file (I've used dozens of C compilers for all kinds of microprocessors).
Most C programs I ever wrote had
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
for starters. That was sufficient to get the symbols TRUE and FALSE predefined (note the upper-case in C, not in C++).
Basically, one of those header files contains:
#define FALSE 0
#define TRUE 1
BTW: I must advice against confusing names for variables; in your snippet that would be true, false, bool as those sound like something special but really aren't. C has no actual bool type (other languages do), so whenever you need a boolean value, you normally use a numeric type, mostly an int .
Finally, I see only one way your code will ever hold or show a value of 32: the space character has a value of 0x20, that is 32 in decimal. So "sorted" will be 32, but nothing else will.
Hope this helps.
Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum
Please use <PRE> tags for code snippets, they preserve indentation, improve readability, and make me actually look at the code.
modified on Sunday, December 19, 2010 11:18 PM
|
|
|
|
|
Thank you very much!
I took your insight and experience and applied them. Thank you very much again.
It worked out great. Just had to put the sorted = false; to the bottom of all
the declarations and had no errors or warnings in the build. All the things I tried through searches, a
build would recommend to change the string function (strcpy) to another string function.
I really appreciate the help and insight. I was getting frustrated with
google searching and the dead ends that resulted in many forums.
I changed this from the book:
#include <stdio.h>
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
#define BUFFER_LEN 100 /* Length of input buffer */
#define NUM_P 100 /* maximum number of strings */
int main(void)
{
char buffer[BUFFER_LEN];
char *pS[NUM_P] = { NULL };
char *pTemp = NULL;
int i = 0;
bool sorted = false;
int last_string = 0;
To this from your experience:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define BUFFER_LEN 100 /* Length of input buffer */
#define NUM_P 100 /* maximum number of strings */
#define false 0
#define true 1
int main(void)
{
char buffer[BUFFER_LEN];
char *pS[NUM_P] = { NULL };
char *pTemp = NULL;
int i = 0;
int sorted = 0;
int last_string = 0;
sorted = false;
|
|
|
|
|
You're welcome. I'm glad you're making progress.
I have two comments:
1.
if it is C code you want, you should use TRUE and FALSE (upper-case), and those really should already have be defined (as in #define...) somewhere in one of those header files for you, no need to do it yourself inside your code. You can define your own constants, and use those, but that would deviate from the conventions, and might become confusing later on. BTW: Under no condition you should change the values representing TRUE/true and FALSE/false!
2.
I don't know the book you are referring to; if it is causing too much hassle, I'd suggest you look for another one. On the other hand, if you made it to chapter 7, it may be just fine. Or maybe you skipped a lot?
|
|
|
|