|
It is in the project's string table. The identifier of the string is IDR_MAINFRAME. Probably the easiest way to get a proper string is to generate a new project, and enter the strings properly. Then, open the string table of the new project and copy IDR_MAINFRAME from that string table to your new string table.
Chris Richardson
|
|
|
|
|
Thanks for the answer,
but it does not work. When 'open' or 'save as', all files are shown. Are there any other things beside the IDR_MAINFRAME need to be modified?
|
|
|
|
|
It is actuall stored in the string table, but in the document ID string. When you registered your DocTemplate in InitInstance, it had an ID of ID_MYDOCTYPE or some such. Look up the string for ths in the string table. It should have a format of somthing like:
"\nRefinementPro\nRefinementPro\n\n\nRefinementPro.Document\nRefinementPro Document"
I forget exactly which position int the \n delimited list you need to put *.ext for your extension.
Roger Allen
Sonork 100.10016
I have a terminal disease. Its called life!
|
|
|
|
|
Hi.
I am implementing an overlapped I/O based Winsock program. I would like to know how to format the data buffer after WSARecv returns. For example:
-----
// Allocate 100 bytes.
TCHAR *data = new data[100 + 1];
data[100] = NULL;
// Link data buffer and size to WSABUF.
WSABUF wBuf;
wBuf.len = 10000;
wBuf.buf = data;
...
WSARecv(..., &wBuf,...,);
...
-----
Given WSARecv returns after sometime with the data, how do you format, 20 bytes of valid data. In other words, data could contain 100 bytes of data, however, what if only 20 bytes are valid and the rest are random data Winsock produces from the socket?
I tried using CString and trim(), but it does not seem to help under an overlapped I/O. For example:
-----
WSARecv(...);
...
CString validData = CString(data);
validData.trim();
-----
The solution above does not work for overlapped I/O. Even with trim(), validData will hold some valid data and a whole lot of random bytes.
I would like to know how to format a raw byte data buffer into valid characters only.
Thanks,
Kuphryn
|
|
|
|
|
The data you send must contain some information indicating which bytes are valid data, e.g. a byte count in the beginning of the packet.
|
|
|
|
|
You should memset(data, 0, sizeof(data)) the buffer before you begin the read, that way it's formatted so that even if you read less than the buffer size, your string will still be NULL terminated, and when you do your magic CString(data), it'll work out better. It's always a good idea to zero out the memory of any character buffer for this reason (and many more.)
Your buffer size is 100 when you allocate it, but not when you link it to WSABUF, was that a typo?
|
|
|
|
|
Interesting. Thanks.
What does memset() do?
For example, given a data buffer of size 100, what will memset() do to the allocated memory? I do not want to deallocate 100 bytes; however, memset() would be of great use of all it does it clear the memory buffer of old data.
What is the difference between memset() and ZeroMemory()?
Kuphryn
|
|
|
|
|
memset fills a buffer of a certain size with a value, in your case, you'd use 0 (zero.):
char szBuf[101];
memset(szBuf, 0, sizeof(szBuf));
ZeroMemory is just the same thing, just a macro (shorthand definition):
#define ZeroMemory(p, s) memset((p), 0, (s))
Or something like that. When you compile, all the ZeroMemory()*s will get expanded to memsets.
|
|
|
|
|
|
You're pretty brave to tackle overlapped I/O using sockets and not know about memset
|
|
|
|
|
Hi All,
I have created a dialog based application in MFC with no title bar (its a skinned dialog). It does have a taskbar icon, but since I can't use the WS_SYSMENU attribiute, I cannot have a menu popup when the user right clicks the taskbar icon.
Is there a way I can either insert a sys menu without having a title bar, or better yet, work like WinAmp, which somehow traps the taskbar button mouse click and display any menu I want (kinda like a hack).
Thanks in advance,
Nick D.
by the time you read this you will have already read it
|
|
|
|
|
I'm not sure how to do it. If you notice Winamp starting a really CPU stressed machine, you'll see (before it manages to paint it's skin) that it indeed does have a title bar. There's messages which are sent related to the non client area of the window (WM_NCCALCSIZE etc) that you can probably use to make the title bar zero height. Then, you can handle WM_SYSMENU and modify the menu before it is displayed (to have the custom menu).
Chris Richardson
|
|
|
|
|
I did a skinned dialog by handling WM_ERASEBKGND and WM_NCPAINT so i could still have the title bar, I just painted over it... It just seemed the easiest way to have all the menus there and have it looking groovy.
cheers
Adam.
www.beachwizard.com/travelogue[^]
"I spent a lot of my money on booze, birds and fast cars. The rest I just squandered"
George Best.
|
|
|
|
|
Can you please let me know how you did this?
I want to be able to skin a dialog so that the skin covers the menu. I want to be able to click the menu through the skin. Is this what you did?
I have not been able to find a way to skin over the menu.
Thank you for your help.
An Expert is somone who has previously made ALL the Mistakes, I dream of this day. - Lucky
www.mpic3.com - My PIC based MP3 player project
|
|
|
|
|
Hi,
I was trying to override menus and draw them in OnDrawItem. It worked fine till I tried to use it for pop-up menu items. For some reasons the same method doesn’t work well, and see the following effects:
1. An arrow is drawn on the right of every pop-up menu item even though I draw the menu item myself. How is it possible
2. Just as a child pop-up menu is displayed the parent pop-up window loses selection mark on the pop-up menu item (the parent item).
Does anybody know if there’s any specific to handling pop-up menu items as opposed to regular items
|
|
|
|
|
Have you searched the CodeProject menu article section for owner-drawn menus ?
Back to real work : D-27.
|
|
|
|
|
Hi .S.Rod,
Yes i have indeed, and may i then rephrase my question, in case you know something about windows menus:
Each pop-up menu item has an arrow on the right, even when we override the menu item to be ownerdrawn. Windows seems to pull drawing for the right pointing triangle outside drawing context for pop-up menu items. Then how to override this windows restriction and yet draw the triangle ourselves
I would appreciate your help on this one,
Thanx in advance,
Vitaly
|
|
|
|
|
I've got the data, and the format, but i can't find a function for drawing a bitmap on a static control...
Thanks all!
|
|
|
|
|
Why don't you use a PictureHolder control instead of a Static control ?
Back to real work : D-27.
|
|
|
|
|
What functions should i use on that then? It's NON-MFC my program.
|
|
|
|
|
A PictureHolder is one of the controls in the dialog editor. After you've dropped it on your dialog, you can set the properties adnset the bitmap attached to it.
Back to real work : D-27.
|
|
|
|
|
I remember reading about this you have to do is override one or two of the functions, it's easy to do all you have to do is declare them privatley in your class. Then it's fairly easy to obtain a dc, if you search the articles and find one about scaling images it's all covered in that and it was written by one of the founders of the website.
- Jason
|
|
|
|
|
I'm new to sockets and network programming and my qustion is
how should I change my client's code if the clien is behind a proxy
thanks in advance
|
|
|
|
|
Nothing particular, the target server your socket connects to is the proxy instead.
Back to real work : D-27.
|
|
|
|
|
Please, suggest me where I can find or purchase documentation or SDK for MS-Word 97 and 2000 DOC-file format. May be you can also suggest me where I can find or purchase any component, which can write data directly into DOC-file without using MS-Word OLE Automation Server functions, or which can directly convert MS-Word RTF-file into MS-Word DOC-file without using MS-Word OLE Automation Server functions.
|
|
|
|