|
Hi there,
There's a question about DirectSound. I wanna capture sound and play captured sound at the same time with the smallest latency. So I've got two buffers - sound and capture. I created N notification points in capture buffer and I'm trying to copy data from one buffer to another... But these buffers are owned by different devices. As everybody knows, there're not two equal frequency generators... so one buffer's always slower/faster than another. There're a lot of algorithms to manage this problems, they're called Sample Rate Convertors. They remove/add some samples from/to buffer, so difference between capturing and playing sound is getting to zero. But first of all I somehow should detect how many samples algorithm must add/remove... That makes a big problem for me.... How can I do it?
Thanks for suggestions.
Regards,
UVSoft.
|
|
|
|
|
Hi ,
How to rute a call from class Mainframe to InPlaceFrame in an Active Document Server Application ? Or how we can call a function mapped in InPlaceFrame from class MainFrame ?
Thnx in Advance
|
|
|
|
|
Hi ,
How to rute a call from class Mainframe to InPlaceFrame in an Active Document Server Application ?
Thnx in Advance
|
|
|
|
|
Hi all,
How do i make my dialog box stationary, that means in permanent position(not movable by an user)?
Can anyone please help me in this regards?
Thanks.
Regards,
Ram
|
|
|
|
|
You can catch the moved event and move it back. I don't believe you can lock it otherwise.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Do this...
CMenu* pSysMenu = GetSystemMenu(FALSE);
pSysMenu->RemoveMenu(SC_MOVE, MF_BYCOMMAND);
|
|
|
|
|
If the title bar is not needed remove it from ur dialog.
Dream bigger... Do bigger...Expect smaller
aji
|
|
|
|
|
Trap WM_NCHITTEST, and make sure you never return HT_CAPTION, and trap WM_SYSCOMMAND, disallowing SC_MOVE.
Steve S
Developer for hire
|
|
|
|
|
I have an MFC app that we use Microsoft Visual C++ 6.0 to compile.
I need to get information from a secure website into my app using 2 way SSL. I have tried using MFC's CHtmlView to obtain this information, and was successful; however, my users have all different types of web browsers. For example I have a user that has installed their X.509 certificate into Netscape, but not in Internet Explorer.
I need to somehow make a 2 way SSL connection from my app that uses the default web browser's certificate (which is password protected) and then obtain the body text of the webpage.
I was thinking about maybe trying to use ShellExecute and then obtain the windows handle (the first parameter) and somehow capture the body of the webpage. But I have not seen any examples on the web for this.
Ideally, I would like to not display the default browser, but just use the default browsers certificate store to communicate via 2 way SSL. All I need is to obtain one line of text from this secure webpage (generated from a servlet running on weblogic 8.1)
Thank you for any responses.
Stuart
|
|
|
|
|
I am using Visual C++ 6.0 MFC. I have a tab control with dialog resources as tab pages. If I click on OK or CANCEL buttons the CWnd::SendMessage(WM_COMMAND, wParam, lParam) returns a value of 1 and everything is good. If I click on any other button control (whose resource value is stored in wParam) the CWnd::SendMessage(WM_COMMAND, wParam, lParam) returns a value of 0. Does anyone know what's going on inside the SendMessage() function? Why does the function not recognize the control ID?
Thanks
Buck Brown
|
|
|
|
|
Did you see MSDN.
From the MSDN:
"The SendMessage function sends the specified message to a window or windows. It calls the window procedure for the specified window and does not return until the window procedure has processed the message."
Syntax
<br />
LRESULT SendMessage(HWND hWnd,<br />
UINT Msg,<br />
WPARAM wParam,<br />
LPARAM lParam);<br />
|
|
|
|
|
Thanks to everyone at CodeProject for providing a fantastic resource for programmers.
I am using several comboboxes to navigate through a flat file database of my own construction. Three of these comboboxes are almost identical in structure and function.
When I select a record from the drop down list from two of the combo boxes (all are set in dropdown mode with identical checkboxes), the record is displayed, and the statements:
pComboBox1or2->SetFocus;
pComboBox1or2->SetEditSel(0,-1);
pComboBox1or2->Clear();
clears the edit box of comboboxes 1 and 2 exactly as expected.
However, when I use the same exact lines for combo box 3
pComboBox3->SetFocus;
pComboBox3->SetEditSel(0,-1);
pComboBox3->Clear();
in the same exact point in almost identical code for combobox 3, the edit box of the combobox refuses to clear.
Interestingly, calling the combobox3 lines from the combobox 1 or two functions clears the combobox3 edit box - however this is not adequate as I need to clear the edit box after selecting a record.
While trying to figure this problem out, I placed a 500 iteration loop around the statements for combobox1or2, and noted a flashing edit field - which ended with a blank edit field. When I tried the same thing with the troublesome combobox3, the edit field did not flash (although it took about the same amount of time for the process to finish), and the edit box did not clear.
I have tried everyhting I can think of to make the code for the various boxes as similar as possible, and find it very strange that two of the three comboboxes work as expected, while the third does not.
Any suggestions?
Thanks in advance for your assistance.
-- modified at 18:33 Wednesday 26th July, 2006
|
|
|
|
|
your problem is that combox1 and 2 are ok in a same way but combo3 its not same,Right?
|
|
|
|
|
Correct.
All three boxes are almost completely identical in every way - except their behavior. Combo 1 and 2 behave linearly (as expected) every time I try, but combo 3 does not behave linearly much at all, especially with respect to the key behavior of leaving the edit box blank after the record selection is complete.
Completely disabling the edit box, for example painting over it to hide the functinoing edit box underneath might be acceptable. I tried using the Drop List box, as a menas of achieving a secondary goal of preventing user input, but this makes the functioning bozes also fail to clear their edit boxes after record selection.
It is as if combo 3 is not completely switching out of Drop List mode when I change the selector in the resource editor (visual ++ 6.0) except that combo 3 allows changing the edit box text in drop down mode while combo 2 does not allow edit of edit box (in drop list mode).
A good work around would be a means to permanently hide the edit box so it didnot matter if it was not cleared and this would have the added feature of preventing user confusion/text entry in the edit box.
Thanks for your reply.
"For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." Richard Feynman, Minority Report to the Official Report on the Space Shuttle Challenger Crash
|
|
|
|
|
Possible workaround:
after trying many things such as calling the complete or partial selchange functions that did work, breaking the edit box clearing code out into a separate function etc. I appear to have found something that will work.
Inserting a pComboBox3->Paste(); line like this:
pComboBox3->SetFocus;
pComboBox3->SetEditSel(0,-1);
pComboBox3->Paste;
pComboBox3->SetEditSel(0,-1);
pComboBox3->Clear();
appears to clear the edit box.
It may not be pretty - but, well - neither am I.
Thanks to all of you who considered my problem and especially to WhiteSky who responded.
Thanks again to everyone at Code Project.
"For a successful technology, reality must take precedence over public relations, for nature cannot be fooled." Richard Feynman, Minority Report to the Official Report on the Space Shuttle Challenger Crash
|
|
|
|
|
hello
I'm looking for a common dialog box to choose folders an exaple of files is GetOpenFileName(...) is there a common dialog box for directories.
Thank you
G_S
|
|
|
|
|
Look for SHBrowseForFolder ... I believe there is a decent article on it in CP ... and Google finds some others as well.
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
|
|
|
|
|
|
|
I'm trying to code a function which returns the number of words in an array, strSentence[100, 1000].
Algorithm:
1. return the first occurrence of strWord.
2. Remove strWord from strSentence.
3. Repeat the above steps until (1) returns no value.
I am using strstr to return the first occurrence of strWord within strSentence. However, the following error is being displayed:
SentenceAr.cpp(94): error C2664: 'strstr' : cannot convert parameter 1 from 'char [100][1000]' to 'const char *'
Code:
int CSentenceAr::HowManyWords(const char strWord[MAX_WORD_LENGTH])
{ char *strCurrentSentence;
ZeroMemory(strCurrentSentence,sizeof(strCurrentSentence));
char *ptrPosition;
for (int iCurrent = 1; iCurrent <= iNumberOfLines; iNumberOfLines++)
{ strcpy(strCurrentSentence, strSentence[iCurrent]);
ptrPosition = strstr(strSentence, strWord);
}
Any work around for this, please?
Jon
|
|
|
|
|
strstr doesn't know about arrays of arrays of chars, it only knows about arrays of chars.
so... ptrPosition = strstr(strSentence[some_index], strWord);
|
|
|
|
|
jon_80 wrote: ZeroMemory(strCurrentSentence,sizeof(strCurrentSentence));
...
strcpy(strCurrentSentence, strSentence[iCurrent]);
These two statements look suspect as strCurrentSentence does not point to a valid memory address.
jon_80 wrote: ptrPosition = strstr(strSentence, strWord);
This should probably be:
ptrPosition = strstr(strCurrentSentence, strWord);
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
CSentenceAr.h
int HowManyWords(const char strWord[MAX_WORD_LENGTH]);
CSentenceAr.cpp
int CSentenceAr::HowManyWords(const char strWord[MAX_WORD_LENGTH])
{ char strCurrentSentence;
ZeroMemory(strCurrentSentence,sizeof(strCurrentSentence));
char ptrPosition;
for (int iCurrent = 1; iCurrent <= iNumberOfLines; iNumberOfLines++)
{ strcpy(strCurrentSentence, strSentence[iCurrent]);
ptrPosition = strstr(strSentence, strWord);
}
}
Now I'm getting more errors:
SentenceAr.cpp(89): error C2664: 'memset' : cannot convert parameter 1 from 'char' to 'void *'
SentenceAr.cpp(93): error C2664: 'strcpy' : cannot convert parameter 1 from 'char' to 'char *'
SentenceAr.cpp(94): error C2664: 'strstr' : cannot convert parameter 1 from 'char [100][1000]' to 'const char *'
Jon
|
|
|
|
|
jon_80 wrote: ZeroMemory(strCurrentSentence,sizeof(strCurrentSentence));
This is not necessary (if strcpy() is to be used later on).
jon_80 wrote: SentenceAr.cpp(93): error C2664: 'strcpy' : cannot convert parameter 1 from 'char' to 'char *'
The compiler is telling you exactly what the problem is. Parameter 1 needs to be a char* , but strCurrentSentence is just a char .
jon_80 wrote: SentenceAr.cpp(94): error C2664: 'strstr' : cannot convert parameter 1 from 'char [100][1000]' to 'const char *'
Parameter 1 cannot be a 2D array. Chris showed you a solution. Why did you not use it?
|
|
|
|
|
The program uses a fixed array, so I need to work around it. Sorry, but I'm a newbie.
Now I'm getting: SentenceAr.cpp(100): error C2664: 'strcpy' : cannot convert parameter 1 from 'char' to 'char *'
for (int iCurrent = 1; iCurrent <= iNumberOfLines; iNumberOfLines++)
{ //retrieve line of text
strcpy(strCurrentSentence, strSentence[iCurrent]);
ptrCurrentSentence = &strCurrentSentence;
while (bFound == true)
{ ptrPosition = strstr(ptrCurrentSentence, strWord);
if (ptrPosition != NULL)
{ iResult++;
}
else if (ptrPosition = NULL)
{bFound = false;}
}
}
return 0;
}
Jon
|
|
|
|