I am programming a console application that plays .wav files. I have set the members of the WAVEFORMATEX to the values of the read file. As a try, I set the lpData member of the WAVEHDR member to the buffer where the file was read into and the dwBufferLength to the size of the file. I have also prepared the WAVEHDR structure. This plays the file when I call the Sleep function for some seconds (Not the best approach) after calling waveOutWrite. I have read that files should be played using double buffering approach but I don't know how this is implemented. I used a callback function in the waveOutWrite function and I am also able to trap WOM_DONE and WOM_OPEN messages.
Please I need help on how this double buffering sheme is implemented. I have read that when one buffer is being sent, the other is being prepared but I don't know how to do this. Some tutorials may help to get the idea.
I have seen an MFC application that uses Google Map to load roadway map into the application's window. The program is a custom made highway information system. That means it is possible to do it. However, I don't have access to that program, therefore, I can't show you how they did it.
The outline of the problem:
I have an exe which will be displaying the status of various pieces of remote equipment in the form of icons and screens.
The remote equipment is NOT defined at this stage so I want a DLL which I can NAME in a setup file, load, and which has a standard interface to my main exe. The interface (at the moment) is 'load', 'giveMeStatusIcon', 'updateStatus' (largely so I can force the change of the status icon), 'showStatusScreen'
The basics of loading a DLL from a name, getting the interface, calling the functions above all work. I can on my 'exe' screen show the returned status icons - these icons are resources in the dll and returned as icons for my exe to display
The problem comes when I ask it to show the status screen. This screen is defined in the DLL resource, and thats the way I want it - I don't want my exe to have to worry about what is in that DLL screen, what it does or how it does it. The DLL gets called, loads the dialog resource ok, but the DoModal call causes an assert - the DLL is not a CWinApp so DoModal can't apparently work.
I guess one possible way is to stop creating a DLL and create an EXE, start that and setup some inter process comms to deal with the communication. But I would much rather stick to the plan of using a DLL.
Does anyone have any suggestions?
Note I do NOT want to write all possible remote device DLL's now and start putting .h files in my exe, I want to stick to the basic idea of having these as items I can develop next month, next year, or whenever and use frmo my exe via loading of a dll file with a fixed API (at least to my exe) at run time.
The DLL gets called, loads the dialog resource ok, but the DoModal call causes an assert - the DLL is not a CWinApp so DoModal can't apparently work.
What is the assert you get, and why are you calling DoModal() on something that won't handle it? Assuming your DLL is pure Win32 then you should be able to do this without any problems using the DialogBox()[^] function.
I am creating a formview application in MFC.I have added some normal controls on it like buttons,checkboxs etc.I have also added Microsoft Forms 2.0 command buttons(ActiveX Controls) on it.The problem i am facing is that, when i add the WM_PAINT handler to the CFORMVIEW class and run the application,the activex controls are not getting displayed on the form.
the input will be 18 , as it starts counting from the start of the string. What i would like to know is, am i able to set a variable in the find syntax? instead of putting 0 , can i declare a variable and then can the sting.find() read it?
So , if i were to input in 3 , how can i declare this and then put it into the find statement? Hope for some help. thanks
int main ()
string s("abcdefghijleeeeeeeyhtpr") ;
int now = 6 ;
int nowe = 3 ;
int result = nowe - now ;
string::size_type f = result ;
string::size_type loc2 = s.find( "yht" , f ) ;
cout << loc2 << endl ;
cout << f << endl ;
when i tried running this , i got the result displaying (4294967295 ). why is this? are we not allowed to use the variable (result) and put it to size_type f = result? is it not the same as size_type f = 3?
Thanks guys, i got it. the issue was i thought that the output will start counting from the index i told it to. it only searches starting on the index, but output will be based from counting from the start of the file. Thanks!