|
I m building voice conversation application .
now i want to send SoundBuffer (of Directx) via Socket to my server.
how can i send it .. will it be lose its data .
plz help mee
thanx
|
|
|
|
|
Hello, I have a MFC application that is running (dialog based with icon in task bar).
I want to terminate this apllication so I post the WM_CLOSE message to the handle of the window.... But that doesn't work !!
If I post the WM_QUIT message, that works fine
Why ???
|
|
|
|
|
One possibility - if the MFC dialog overrides OnClose() and doesn't call the base class's OnClose(), the dialog will not be closed.
|
|
|
|
|
Huummm yes ok !! That's it.
I have a button called Close on the dialog that just hide the window. I added a handler for this command: OnClose() and this function doesn't call the base class OnClose....
Thanks for reply !!
|
|
|
|
|
I have enabled multiple file selection in an Open-a-File dialog.
Please tell me how to obtain (a list of) all the selected files in this Open-a-file dialog and fill CListBox control with them.
|
|
|
|
|
Like this:
CFileDialog aDlg(...);
CListBox lb;
if(aDlg.DoModal() == IDOK)
{
POSITION pos = aDlg.GetStartPosition();
while(pos != NULL)
{
CString file = aDlg.GetNextPathName(pos);
lb.AddString(file);
}
}
|
|
|
|
|
Thanks a lot! It works great, but another problem is rising - if the selected files are too many (or
the string in the "file name" edit control is too long) - nothing happens - i tried to change some
of the members of the OPENFILENAME Structure, but with no result. Is it possible to make the "file
name" edit control to accept longer strings and how?
|
|
|
|
|
No problem
I'm not really sure what you are asking with the second part, so I'll try to answer three things you could mean
1. You get a problem when you have too many files seleced in the file dialog
2. You get a problem when the file name for one of them files selected is long
3. You get a problem when adding a large number of files, or a file with a long name, to the list box.
1.
As for as I know there is no limited on the number of files you can select, I've never seen it anyway. The only problem you might get is because windows adds each file you select to the edit control, so if you select a lot you may overrun the edit control - is that what you mean? If so, see 2.
2.
Hmmm... Well, the max length of a file name is MAX_PATH (255 chars) in Windows anyway, the edit control that accepts the file list should be able to take that easily, but with a lot of files it concevable you will overrun it.
The only thing I can suggest is to use the "explorer style" file dialog (the one with the places bar down the side) this may be able to handle a large list of files better. Though you are now faced with another problem. Using the explorer dialog via MFC is tricky. You have to set define _WIN32_WINNT >= 0x0500 (which also means this will only work on 2k+) but thats not all there is to it because the setting this define adds some extra members to the OPENFILENAME struct which cause windows to display the explore style dialog rather than the new one. Unfotunatly, the size of OPENFILENAME is set with in MFC and short of recompiling MFC dlls, you are stuck with it. There are ways round it, search for OPENFILENAME on MSDN and look for 2000 Peridocal (called C++ Q AND A) buy Paul DiLascia. It's called "Windows 2000 File Dialog Revisited; Autocompletion and the ACTest Demo App" and it will show you how to use the new open dialog which might fix your problem. Of course if it doesn't, then.. err..
The other thing it might be is this:
FIX: Common File Dialog Multiple Selection File Limit : Q179372
But this has aparently been fixed in a service pack. WHat version you running?
3.
If this is your problem you are hitting a limit with the number of entrys a list box can handle, use a CListCtrl instead.
|
|
|
|
|
Hi !
I'm trying in one of my listCtrl to implement a insert line function with the taste Insert.
But it appears that the "OnKeyDown" event doesn't work with that key when the NUM_LOCK key is on.
In that case, the Parameter nChar of the funtion OnkeyDown is always 255, and I can´t detect wich key has been pushed down. Couls someone gives me a tip ?
Tanks !!
Sébastien
Sébastien.V
|
|
|
|
|
try using GetAsyncKeyState()
|
|
|
|
|
Hi,
This probably a silly question but how does one get the an MDI app to stop producing an open view on start up?
Also, if I have 3 different types of views (e.g. CListView, CTreeView, CEditView) how does one create one a new view for each one without going through the menu?
regards,
Rich
"Programming today is a race between software engineers striving to build bigger and
better idiot-proff programs, and the Universe trying to produce bigger and better idiots.
So far the Universe is winning."
|
|
|
|
|
RichardS wrote:
This probably a silly question but how does one get the an MDI app to stop producing an open view on start up?
In your CXXXApp::InitInstance () routine, you will find a variable of type CCommandLineInfo.
The CWinApp::ParseCommandLine function sets the cmdInfo.m_nShellCommand variable to FileNew if you
have no parameters.
Just set it to FileNothing before the CWinApp::ProcessCommandLine function is called.
RichardS wrote:
Also, if I have 3 different types of views (e.g. CListView, CTreeView, CEditView) how does one create one a new view for each one without going through the menu?
If you search MSDN Magazine / MSJ for a "C++ Q&A" article by Paul DiLascis about replacing views, it should
give you the information you need.
Iain.
|
|
|
|
|
Can anybody tell me why copying an unlocked block of global memory using memcpy() would cause the call stack to change. The code looked like this:
<br />
<br />
UINT size=GlobalSize(hGlobal);<br />
<br />
LPBYTE pBuffer=new BYTE[size];
<br />
memcpy(pBuffer,hGlobal,size);
<br />
I realised the problem was caused by not using GlobalLock() to get the actual address of the memory to copy but I have no idea why using the hGlobal handle as the source address would cause the call stack to change!
Systems AXIS Ltd - Software for Business ...
|
|
|
|
|
Hello!
GlobalAlloc() returns a "handle to the newly allocated memory object", and this does not mean pointer to allocated memory. So I suspect, that this handle is a pointer to structure, in which one of the field is pointer to memory (only suspission).
But: it did not overwrite my stack:
<br />
HANDLE hGlobal = GlobalAlloc( GMEM_ZEROINIT, 2048);<br />
UINT size=GlobalSize(hGlobal);<br />
LPBYTE pBuffer=new BYTE[size];
memcpy(pBuffer,hGlobal,size);
If you want to use memory pointer, take a look at the flag GMEM_FIXED in GlobalAlloc()
|
|
|
|
|
how did you get MDI windows to go out of status bar like in mIRC ?
http://flat.hypermart.net/mIRCstatusbar.gif
what is name of this class ?? extended status bar ?
is there a class or source code somewhere on this site or on any MFC sites.
|
|
|
|
|
ay ay ayy !!!!
that's not a status bar !!! that's a dynamic window.
TOXCCT alias Nicolas C.
|
|
|
|
|
ok thank you.. I am not even sure what name for it.
do you have source code or class for it ?
|
|
|
|
|
hemm, no, not at all.
what did you want it for exactly .??
TOXCCT alias Nicolas C.
|
|
|
|
|
I think it's called taskbar.
You can create it as a DialogBar initially docked to the bottom of the main window. And prohibit it from moving.
But I wonder, that there wouldn't be any sample code, which emulates taskbars. If you really don't find anything, I'll probably write one (and publish it on the CodeProject )
Robert-Antonio
"Love without sex is like a fish without antlers"
|
|
|
|
|
yea similar to taskbar......
I still do not find anything about it
go ahead and write project.
|
|
|
|
|
actually, in the case of mIRC, that taskBar is not even definitively docked, you can move it if you want !!!
but i'm waiting for your article Mr Robert A. T. Kaldy
TOXCCT alias Nicolas C.
|
|
|
|
|
im trying to make irc client.
i guess there none of articles or info on this thing.
|
|
|
|
|
When I design
CDialog , its size shown in editor in dialog units,
but I need to set it in pixels - precisely.
How to do it ?
Thanks
|
|
|
|
|
You cannot set the real size of a dialog in the resource editor. The units you see are
in Dialog Units. These are translated into real coordinates at run time by the CreateDialogXXXX
functions.
The translation depends on the font of the dialog, and various OS things (Large / Small Fonts,
accessibility settings etc).
To translate between dlg and reall units, look at ::MapDialogRect.
If you have to be pixel accurate, you need to write some code in your OnInitDialog routine.
You'll probably want the following functions...
GetClientRect, GetWindowRect, ClientToScreen, ScreenToClient, SetWindowPos, etc.
Iain.
|
|
|
|
|
hi,
i am trying to retrieve the text,ie the address from the address bar of the explorer. i have the handle to that edit box,how can i retrieve the text. i have tried GetWindowText, various options of SendMessage.
Thank You
|
|
|
|