|
Hi all,
How to generate beep sound or audio from a system not having speakers in VC++.Net?
I used Beep(freq,mili_secs) to generate a beep from motherboard.Will it work without sound card installed on system?
And how to know diffrent frequencies?
Regards,
Aniket A. Salunkhe
modified on Sunday, July 20, 2008 1:55 AM
|
|
|
|
|
Hi Aniket,
I think you should try using the MessageBeep[^] function.
Best regards,
Mihai Moga
|
|
|
|
|
Aniket Salunkhe wrote: I used Beep(freq,mili_secs) to generate a beep from motherboard.Will it work without sound card installed on system?
Yes, provided your system satisfy function requirements [^].
Aniket Salunkhe wrote: And how to know diffrent frequencies?
Documentation states that frequency maybe genrated in the "37 through 32,767" Hz range.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
I have a problem with MDI forms. An MDI form in my application sets focus to a control on it(also scrolls to its location) when the form is clicked/activated/focused. I'm looking a way to prevent it. This is actually a C# application and I have no C++/WinApi knowledge. I tried Spy++ and checked messages it recieves when the mdi form is activated and when this problem occurs. I saw several messages like WM_FOCUS and such. I checked the message number, e.g 0022, and overriden WndProc function of the mdi form and tried to handle it like "if(m.Msg == 0022 || m.Msg == 22)return" for all of the messages includes word "focus" but this didn't do any good. I don't know what else I can do.
This is actually a .NET question I posted here but I thought maybe someone with C++/WinApi knowledge could help me with this. It's driving me insane and I appreciate any help.
|
|
|
|
|
Hi,
Preview works,
Capture does not work at
//
Problem: RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pBuild, NULL, pMux)
Please help.
void CWebCamDlg::OnStart()
{
// TODO: Add your command handler code here
UpdateData();
IGraphBuilder *pGraph2;
IMediaControl *pControl2;
IVideoWindow *pVidWin3;
ICaptureGraphBuilder2 *pBuild2;
hr =CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER,IID_IGraphBuilder, (void**)&pGraph2);
pGraph2->QueryInterface(IID_IMediaControl, (void **)&pControl2);
///////////////////////////////////////////////////////////////////////////////////////////////
hr =CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL, CLSCTX_INPROC_SERVER,IID_ICaptureGraphBuilder2,(void**)&pBuild2);
pGraph2->QueryInterface(IID_IVideoWindow, (void **)&pVidWin3);
hr = pBuild2->SetFiltergraph(pGraph2);
//hr = pGraph2->AddFilter(pBase, L"Capture Filter");
IBaseFilter *pMux;
//CoCreateInstance(CLSID_AviDest, 0, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&pMux);
//pGraph2->AddFilter(pMux, L"AVI MUX");
IBaseFilter *pWriter;
CoCreateInstance(CLSID_FileWriter, 0, CLSCTX_INPROC_SERVER, IID_IBaseFilter, (void **)&pWriter);
hr =pBuild2->SetOutputFileName(&MEDIASUBTYPE_Avi,L"c:\\dwk.avi",&pMux,0);
////////////////////////////////////////////////////////////////////////
//prolbem
//pBase from preview
hr = pBuild2->RenderStream(&PIN_CATEGORY_CAPTURE, &MEDIATYPE_Video, pBase, NULL, pMux);
//////////////////////////////////////////////////////////////////////////
pControl2->Run();
pVidWin3->put_Owner((OAHWND)m_hWnd);
pVidWin3->put_WindowStyle(WS_CHILD | WS_CLIPSIBLINGS);
CRect rc;
GetWindowRect(rc);
ScreenToClient(rc);
pVidWin3->SetWindowPosition(0, 0, rc.Width(), rc.Height());
// Release the mux filter.
pMux->Release();
IConfigAviMux *pConfigMux = NULL;
pMux->QueryInterface(IID_IConfigAviMux, (void**)&pConfigMux);
pConfigMux->SetMasterStream(1);
pConfigMux->Release();
IConfigInterleaving *pInterleave = NULL;
pMux->QueryInterface(IID_IConfigInterleaving, (void**)&pInterleave);
pInterleave->put_Mode(INTERLEAVE_CAPTURE);
pInterleave->Release();
}
Please Help!
Thanks
|
|
|
|
|
Hi,
I am using two differnt applications within one project in vc++.
For these I want to load two different application icons. However i dont want to another icon id. I want to use this same icon id. The reason is because i have all my menus,etc with this id. So i want to have this id but pointing to two differnt resource files, which would be decided in the compile time.
How to use/point a icon id to two different files programatically?
Priya Sundar
|
|
|
|
|
I don't understand the problem. Just make sure you assign the same values in the resource.h file.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi for eg assume we have 5 nodes
and need to travel from 1 to 2 we will get total 16 paths i need all those paths
i have writtn for that but that is time consuming if u have any good logic plz suggest
|
|
|
|
|
Looks similar to Travelling Salesman Problem [^]. An amusing algo maybe the Simulated Annealing [^] one.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All,
I have this global variable declared as in the below statement:
const LONG MYITEMID = MAKELONG(MAKEWORD('m','i'),MAKEWORD('d','0'));
Here when i try to build this i am getting the warning displayed 3 TIMES:
W8084 Suggest parentheses to clarify precedence
Can anyone tell me how to resolve this?
I have tried all types of typecasting.. but it didnt work.
Kindly help!
Priya Sundar
|
|
|
|
|
Hi Priya,
this is a Borland C++ warning, and it works well under Visual C++ (no error). If you would like to skip this please put # pragma warn -8084 .
Best regards,
Mihai Moga
|
|
|
|
|
Hi Moga,
You are right. it is a Borland c++ warning message.
But do you know why is this message coming for this sort of statement?
Thanks for the help. After putting that statement now it is working fine.
Priya Sundar
|
|
|
|
|
Hi Priya,
I'm not familiar with Borland C++, so I cannot answer to your question. Sorry!
Best regards,
Mihai Moga
|
|
|
|
|
|
Priya_Sundar wrote: const LONG MYITEMID = MAKELONG(MAKEWORD('m','i'),MAKEWORD('d','0'));
Here when i try to build this i am getting the warning displayed 3 TIMES:
W8084 Suggest parentheses to clarify precedence
Have you considered looking at how the preprocessor is expanding that statement? It might help you to see it in a different light.
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hi All,
Im using List Control in my project. I have implemented the background color and text color of List Control.Everythig is working fine. But dint change the background color of header.How can i set the background color for header. Help me.
Thanks & Regards,
Anitha
|
|
|
|
|
Hi Anitha,
in order to change the background color of the CListCtrl's header you need to customize the header control. Please have a look to Matt Weagle's Using the Header Control[^] article. This should do it for you.
Best regards,
Mihai Moga
|
|
|
|
|
OnSelChange event of tab control i want to show a dialog
that dialog should with in the tab control (unable dialog move)
how can i set locatoin of dialog programatically ?
CTabCtrl *t=(CTabCtrl*)GetDlgItem(IDC_TAB1);
t->insertItem(0,"one");
t->insertitem(1,"two")
|
|
|
|
|
|
When using rand() from the standard cstdlib include files, how often should you seed the number generator?
Do you need to seed every time you use the rand() function, or just once at the start of the application?
Also, is srand((unsigned)time(0)); adequate for seeding purposes, or is something more complex a better idea?
|
|
|
|
|
Once. Otherwise you could seed it with the same time value which would result in the same number multiple times which is probably not what you wanted.
|
|
|
|
|
Iam having a MDI application.
I have two queris.
1. How to add the menu in childframe
2. For different child how i can add the different menu.
Thanks in davance.
Regards
Lavate Mallikarjun Avanna
|
|
|
|
|
In one project I used different Views with different Menus according to which was the active one. I did it creating the menus in the resource editor and then in the MyApp files (.h and .cpp) creating different CMultiDocTemplate one for each type of view, saying which menu was owned by which view.
BOOL CFPSApp::InitInstance()
{
AfxEnableControlContainer();
.
.
.
.
pDocTemplate = new CMultiDocTemplate(
IDR_FPSIITYPE,
RUNTIME_CLASS(CFPSDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CFPSView));
AddDocTemplate(pDocTemplate);
.
pParamRegMatTemplate = new CMultiDocTemplate(
IDR_VIEWTYPE,
RUNTIME_CLASS(CFPSDoc),
RUNTIME_CLASS(CChildFrame),
RUNTIME_CLASS(CParamRegView));
AddDocTemplate(pParamRegMatTemplate);
.
}
this option is good when you know for sure how your project is going to be structured. There are other options to load/unload menus dinamically. If you use it you will have to load/unload the menu in the OnInitialUpdate and when your view loses and wins the focus another time. With the other way I have explained all is done automatically.
Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
“The First Rule of Program Optimization: Don't do it. The Second Rule of Program Optimization (for experts only!): Don't do it yet.” - Michael A. Jackson
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
Hi
is it possible to show a single item's text in multiple line in a combo box?
Thanks
|
|
|
|
|
Hi sheshidar,
I really do not know if that's possible, but I would start by modifying Xiao Wu Guang's Multi Column ComboBox[^]. Hope this helps!
Best regards,
Mihai Moga
|
|
|
|