|
Sorry ill rephrase that... how do I make it a modeless dialog?
|
|
|
|
|
A nice tutorial on modeless (and modal) dialogs is available here[^].
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
i'd like to capture the message when key down or up on ComboBox.
.eg. when press the return key,then add a word to the ComboBox.
and how to capture the return key press?thx
GreenXML
|
|
|
|
|
Hmmm, you could use GetWindow (GW_CHILD) to get at the combo box's edit control, then subclass that (override it's PreTranslateMessage() ) to notify you when the user has pressed [Return].
Please post an article at CP if you get it to work. Thanks!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
BOOL MyDialog::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_KEYDOWN)
{
if(pMsg->wParam!=VK_RETURN)
{
if(GetDlgItem(IDC_MY_COMBOBOX)==GetFocus())
{
//her you have it
}
}
}
|
|
|
|
|
I've been using a standard (qwerty) keyboard and allowing XP to switch it to the Dvorak layout. For those that don't know, that is just the same keyboard with the keys rearranged (ex. I type r and get p). Sadly, XP wont carry this into some games, so I've decided to write a program that will re-interpret the keydown messages the games are getting.
I was just wondering if someone could give me some hints on where to start looking for examples on this sort of thing. Would this require hooks (I've never made one)?
Optimomally, the program would work like a program I downloaded today for getting sound from old dos games, where you just right click the exe and it does something with a DLL to the exe.
Thanks!
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
|
Hello-
I've been investigating DirectSound for an app for a couple days and still a bit confused. What I would like to do is stream an MP3 from an Icecast/Shoutcast server to my machine and run that through DirectSound.
To me, this would be done by writing the code to connect to the server, start streaming the MP3, then shovel that data into a DirectSound buffer which is configured to connect (via a filter graph) to an MP3 decoder.
There are streaming examples with the DirectX SDK, but they don't talk about MP3s -- they're just for PCM.
Am I approaching this correctly? Are there better examples for me to look at? I also want to incorporate my own FIR filter into the DirectSound stream -- I'm assuming this will be possible.
Cheers,
Jake
|
|
|
|
|
After a few hours of work, I've done some prelimenary research for you.
If you use a stream from the Internet, take the following steps into consideration:
1. Connecting to the stream and requesting for a stream (HTTP commands)
2. Receiving data from the stream
3. Running the stream through a DirectShow filter chain that decodes it
4. Shoveling from the final filter in the chain into the DirectSound buffer
5. Playing back the buffer
There are at least some SHOUTCast DirectShow filters available, but I have no knowledge on how/if they work. A better way, I would feel, is to directly connect to the SHOUTCast server and request for a stream.
The entire process bases itself around the IMediaObject interface, that represents a block of media data.
First, you should create the necessary filter object, in MP3 case, it could be MPEG-1 Stream Splitter Filter, that can receive MEDIATYPE_STREAM with MEDIATYPE_MPEG1Audio.
To continue from here, you can use ACM Wrapper filter, that supports conversion from MP3 to PCM format, if you have any MP3 decoders installed (installing WinAmp will install a decoder as well).
The ACM Wrapper outputs PCM data that can be directed into a DirectSound Renderer filter, or if required, you can use IMemAllocator interface to get the decoded IMediaSample objects out from the chain.
In order to utilize the received data, you can create an instance of a IMediaSample interface (and the object), set it up to represent the data you have received (MEDIATYPE_STREAM with MEDIATYPE_MPEG1Audio subtype, for example, if you use the MPEG-1 Stream Splitter). Then get a pointer into the sample's data area, copy data from the download buffer, and call IMemInputPin::Receive on the input pin. To get the input pin, get a pointer to the IBaseFilter interface on the MPEG-1 Stream Splitter interface, and query through the pins using EnumPins. When you find the suitable IPin, query for the IMemInputPin interface on it.
This isn't a complete example on how to do it, but it should help you get started.
Alternatively, if you already have a working application that connects to a SHOUTCast source, receives data and fills a temporary buffer (raw data buffer, non-DirectSound), then I could consider joining up to write the logic to decode and playback it.
-Antti Keskinen
----------------------------------------------
The definition of impossible is strictly dependant
on what we think is possible.
|
|
|
|
|
Hi all,
I'm really tired of looking for the solution of this annoying problem:
I have MFC application with CToolBar. In fact, I have CReBar and two CToolBars in it. I display few buttons with text in these toolbars (in single line). When user changes the size of main window and the width is not enough, I want toolbar to automatically wrap to more rows so that all buttons stay visible.
I don't want to use chevrons or floating toolbars. I create my toolbars with TBSTYLE_WRAPABLE and I tried to call SetRows(...), but it had no effect. Yes, it created as many rows as requested, but all buttons stayed in the first row even though if the size was too small to show them all.
Thank you all for any suggestion.
|
|
|
|
|
I seem to recall that toolbar button wrapping only occured at separators. Does it wrap if you add a few separators?
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
I tried that but no change. In fact, the toolbar gets wrapped when the size is too small, but it wraps to maximally 2 rows for me, although I call SetRows() with higher argument. Thus I think I'll have to get rid of it by writing my own code for wrapping the toolbar, since I haven't found any example on the web which uses toolbar wrapping for docked toolbar
|
|
|
|
|
Hi Im a c++ beginner, I was wondering if someone could help me with using pointers and triangular arrays. I would like to know how to define them correctly, accesing them and finally printing them with a for cycle. thanks!
links to faqs and tutorials are also greatly appreciated;)
|
|
|
|
|
Here is one solution.
char ***pArray = new char **[1];
pArray[0] = new char *[1];
pArray[0][0] = new char[32];
...
delete [] pArray[0][0];
delete pArray[0];
delete pArray;
Kuphryn
|
|
|
|
|
ok, now how would i point to a specific direction and print that? lets say^i have a an array[7][20][50]; and i would like to print it by pointers, how would i do that? or if i would like to print all rows position five etc...
thanks for your time
|
|
|
|
|
int *iArray;
iArray = new int [7][20][50];
for (int x = 0; x < 20; x++)
{
for (int y = 0; y < 50; y++)
{
}
} Hope that's helpful.
If you have a problem with my spelling, just remember that's not my fault. I (as well as everyone else who learned to spell after 1976) blame it on Robert A. Kolpek for U.S. Patent 4,136,395.
|
|
|
|
|
If I wanted to find all the child windows on a dialog that were edit controls should I be able to use the following code
FindWindow ("EDIT", NULL); If so should this code work in the first WM_PAINT message that a dialog receives? I ask because I try it and when it executes it returns NULL. I do have edit controls on my dialog. Any help is appreciated. Thanks.
- Aaron
|
|
|
|
|
|
Thanks for the information. One question...how do I inspect the window class to see if it's an edit control? How do I get the window class information from the hwnd value? Thanks again.
- Aaron
|
|
|
|
|
Try:
TCHAR buff[ 32 ];
GetClassName( hWnd, buff, sizeof( buff )-1 );
if ( stricmp( buff, "edit" ) == 0 )
;
Neville Franks, Author of ED for Windows www.getsoft.com and coming soon: Surfulater www.surfulater.com
|
|
|
|
|
Works beautifully. Thanks Neville.
- Aaron
|
|
|
|
|
Neville Franks wrote:
www.surfulater.com
Looks nicer by the day, Neville!
/ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
Hi,
I have the followings:
1. A Dll with a custom control (ControlDll.dll)
2. A dll with a dialog using the custom control (DialogDll.dll)
3. An exe that uses the dialog from DialogDll.dll
The control is register nicely like all custom controls using AfxRegisterClass...
When i run the exe, it failed (the dialog was not displayed), what i did is the following:
Checked teh 'no fail create' to see where it failed, and found out it could not find the control from the ID while in 'PrepareCtrl' of the DDX_Control of my custom control.
I then created another dialog, this time in the exe, which uses the same custom control from the ControlDll.dll, and it worked!
It seems that the nesting of dll within dll, and the custom control registration some how got lost
Any help will be wolcomed
10x
ronhash
|
|
|
|
|
I use Timer in my service prog like that:
timer2ID=SetTimer(NULL, 0, INTERVAl,Timer2);
when compile Debug ,it is perfect.but when complie Release,show the error :
D:\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxwin2.inl(469) : error C2039: 'OnTimer' : is not a member of 'CWnd'
D:\Microsoft Visual Studio\VC98\MFC\INCLUDE\afxwin2.inl(470) : error C2065: 'Default' : undeclared identifier
I don't use CWnd class in my prog.what is the problem?
appreciate any help!!!
|
|
|
|
|
timer2ID=::SetTimer(NULL, 0, INTERVAl,Timer2);
if you use windows api functions but i am not shure what classes and functions you have because you include mfc library.
|
|
|
|