|
Try modifying the parent window style to include WS_CLIPCHILDREN. If the parent is a FormView, you can do this in the dialog editor; otherwise, override PreCreateWindow.
|
|
|
|
|
Hi all,
There are fonts that define characters in the C1 region, namely 0x80 thru 0x9F. (Windows CP1252 does have characters defined in C1 as well.) The problem is that these characters show up as empty square boxes when I use TextOut() and DrawText() to draw characters in these fonts. It appears that TextOut and DrawText filter out these characters. But Notepad2000 can display these characters as any other ASCII characters.
My question is: What character drawing function can display characters in the C1 region? Definitely there must be a way to display them. Otherwise, these characters don't show up in Notepad2000 either.
Thank you very much in advance for your help.
Hoc Ngo
hoc_ngo@yahoo.com
|
|
|
|
|
There are no problems displaying any character with TextOut() etc. that I am aware of. If you are seeing square boxes then you aren't using a font that includes the particular characters you want. You can use the Windows Character Map app to see the character sets for all installed fonts.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Thanks for your respose.
FYI, the font does have these characters. It was designed for Windows 3.1 and all characters show up very well. I tested the same font with Notepad2000 and DrawText() and TextOut() on Win2000. Notepad can't display 4 chars at slots 0x80, 0x8e, 0x9e, and 0xb7. But DrawText(), TextOut(), and Character Map app do not show over 25 characters. So I just wonder what API to use, or what parameters to set, to display them. I am working on an application that needs to display all characters available in a font.
Thanks a lot for any insight.
Hoc
|
|
|
|
|
It sounds very strange that Character Map doesn't display these characters. I would focus on the font itself. Maybe it needs to be updated or recreated to work properly with W2K etc.
Neville Franks, Author of ED for Windows. Free Trial at www.getsoft.com
|
|
|
|
|
Hi,
In my MFC app,i create controls dynamically in a view.I try to popup a MessageBox when user enters wrong data in any of Edit field.What happens is when i click "OK" button in MessageBox,it doesn't disappear instead it loses focus and again when clicked on "OK" button it disappears very slowly..Why this happens..pls help.Also the messagebox routine is called only once since i had doubt if it called twice..
Pls help..I am struggling.
Thnks in advance
ram
|
|
|
|
|
hi...
can you write your's code here?
|
|
|
|
|
Hello Everybody,
what is the difference between using AfxMessageBox(" ");
and MessageBox(" ");. Both of them are used to display message only then why two versions.
Neelesh Jain
|
|
|
|
|
CWnd::MessageBox will call the MessageBox API using the HWND of the CWnd (the m_hWnd member) as parent window. And can only be used from CWnd derived classes.
AfxMessageBox is an MFC global function and internally call CWinApp::DoMessageBox which calls the MessageBox API and uses the main window of the application as the parent window. AfxMessageBox can be called from anywhere in the MFC program. If you dont have a main window it will use NULL as the parent window
I use CWnd::MessageBox cause it lets you set a title, whereas AfxMessageBox will show the app-name string as the title.
Regards
Nish
Extending MFC Applications with the .NET Framework [NW] (coming soon...)
Summer Love and Some more Cricket [NW] (My first novel)
Shog's review of SLASMC [NW]
Come with me if you want to live
|
|
|
|
|
Hi
I'm in the processof converting a VC.net 2002 project to vc.net 2003 and suddenly got and error with this statement
catch (CException &e)
{
TCHAR szMsg[1000];
e.GetErrorMessage(szMsg, 1000);
ShowErrorMessage(szMsg, "CException", MB_OK, _T(""), GetActiveView());
return FALSE;
}
Can anyone tell me what I should change to get this compile with .net 2003 ? (I'ts probably obvious but I've been awake for 28 hours and am getting a bit tired)
/Thomas
|
|
|
|
|
I want to place a bitmap in the centre of the screen.Now it is in left possition of the screen.
|
|
|
|
|
centerX = (screen_width / 2)-(bitmap_width / 2)
I'm drinking triples, seeing double and acting single
|
|
|
|
|
I'm sure this has been asked before, but I need a no-BS assessment from anyone who has used both the BCG and CodeJock libraries as to their perceptions of both.
It appears that both offer about the same set of features so the remaining question is which one a) is more stable, b) fits more seemlessly into VC++ and VS.NET 2003? Perhaps more importantly, which company is more responsive to customers?
|
|
|
|
|
Here's half an answer.
I use BCG for Awasu since they offered a cheaper version for shareware/freeware/etc. developers. Their sales department seemed reasonably responsive. I emailed CodeJock several times and didn't get any response.
I've found BCG ControlBar to be pretty good. It just works. I had tried some other toolkits whose controls were better (i.e. more features) but I had trouble getting the framework as a whole to work so I ditched them.
BCG works pretty well with VS6. They have a little app that takes care of building the library itself. There is also a project wizard so it's easy to create new BCG-based apps. I believe they work with VS.NET but I haven't tried it.
BCG has a bunch of forums where you can go if you have problems. Their support department is not terribly responsive - I got a cheaper shareware licence which may have something to do with it - but I've never had much need to use them which says a lot in itself. A lot of the time, workarounds and fixes are provided by other users anyway.
All in all, I've been very happy with it.
HTH
"Sucks less" isn't progress - Kent Beck [^]
Awasu 1.1.2 [^]: A free RSS reader with support for Code Project.
|
|
|
|
|
Sir,
Can anybody send simple UDP Program for sending and receiving messages using Sockets.
Thanks in Advance,
Ilamparithi.
|
|
|
|
|
Hey! Know about Google?
Rickard Andersson
Here is my card, contact me later!
UIN: 50302279
Sonork: 37318
Interests: C++, ADO, SQL, Winsock, 0s and 1s
|
|
|
|
|
Hi All!
I am developing application like Instant Messenger(Chat application) in VC++ using CSocket class. The problem I found is when I send the data continuosly using for loop(For example 10 packets), only 2 packets are received in client.
It means that the socket is still processing the data. So the next packet can not be transferred untill the previous transction comes to end. If I use sleep function between every data transmission, it is perfect, but it is so slow in network application
Code (Data lossing)
for(int i=0;i<10;i++)
Socket.Send(Data,sizeof(Data));
Code (Working,but slow)
for(int i=0;i<10;i++)
{
Socket.Send(Data,sizeof(Data));
Sleeep(200);
}
Please understand that I do not know size of sending data. becuase in chat application, size of data depends on the text the user typed.
Send() does not return number of bytes sent actually
OnReceive() will not return error value. It recieves only two packets for 10 packets sending
OnReceive() is executed 2 times not 10 times to check the return value ok.
Multithreading conecpt will come only if you want to accept one more client, not receiving data from one client
If you have idea about this topic please send the mail to mailto:itjegan@sify.com
|
|
|
|
|
Jegan Sasi wrote:
OnReceive() will not return error value. It recieves only two packets for 10 packets sending
OnReceive() is executed 2 times not 10 times to check the return value ok.
That maybe caused by the Nagle algorithm. It is not an error. In fact is efficient and all your data is being sent and received. In very simple terms, the Nagle algorithm consolidates several packets of information sent in a short amount of time into just one send. It is completely transparent to your application.
Even if you disable Nagle you have no control over how the data is received on the other end, the other system may be busy to respond to a receive right away when another chunk of data comes, it will consolidate the whole thing and by the time a receive is processed it will receive both chunks as one.
So, the problem here is that you are assuming that each receive is an individual piece of text.
If all you are doing is sending text back and forth, I suggest you buffer your receives until you reach an end of string (let's say a NULL char) and then do whatever with it.
Remember that there is no guarantee that a receive will contain a whole string, so you have to buffer it until you reach your NULL char, probably on a subsequent receive. Then extract your string from your buffer and keep the rest of the buffer which can contain the beginning of another string to be terminated on another receive.
As a matter of fact, your buffer may very well contain 3 complete strings and a portion of a 4th one. So code accordingly.
Hope this helps,
-Luis
|
|
|
|
|
Hey All,
I've written a hotkey app, but I've noticed that there seems to be a bit of a problem handling certain combinations of modifiers. If I stick to Win + some key (or combo of other modifiers), it works almost all the time. If I try ALT + some key (or combo of modifiers), it doesn't seem to work all that often (if ever).
Is there something I have to do to make my app accept ALT and CTRL hotkeys?
Thanx!
|
|
|
|
|
That acommand was the one which rescued me last night but today im entrapped with this .
actually i wanted to access a URL so I used shellExecute() but my final task was to cvall the url not to open that during execution of the programme
Anyon there to help me i have 2 hrs left with me to do so
PLLLEEEEAAASSSEEE
hdsjdhsjdakldhs lkdhaskdjlahsjkdhaskfhaskjfhasdf
|
|
|
|
|
Ive been working on a program that creates a window and adds a ReBar with two bands, each one for a different Toolbar.
Im using the following code:
INT SetNewBand(HWND hwndOwner, HWND hwndRB, HWND hTool, RECT *rRC)
{
RECT rc ;
RECT hToolRC ;
RECT hwndRBrc ;
REBARBANDINFO rbBand ;
BOOL FirstToolbar = FALSE ;
RECT hToolRC_new ;
/* Fill rbBand structure */
rbBand.cbSize = sizeof(REBARBANDINFO) ;
rbBand.fMask = RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE |
RBBIM_SIZE;
rbBand.fStyle = RBBS_CHILDEDGE | RBBS_USECHEVRON |
RBBS_VARIABLEHEIGHT | RBBS_GRIPPERALWAYS |
RBBS_BREAK ;
GetWindowRect(hwndRB, &hwndRBrc) ;
/* This is the first toolbar */
if (hwndRBrc.top == hwndRBrc.bottom)
FirstToolbar = TRUE ;
GetWindowRect((HWND) hTool, &hToolRC) ;
rbBand.hwndChild = hTool ;
rbBand.cxMinChild = 0 ;
rbBand.cyMinChild = hToolRC.bottom - hToolRC.top ;
rbBand.cx = 200 ;
if (!SendMessage(hwndRB, RB_INSERTBAND, (WPARAM) -1, (LPARAM) &rbBand))
{
dbgprint(("RB_INSERTBAND failed.\n")) ;
return -1 ;
}
// If this is the first toolbar, we dont need to
// fix any sizes.
if (FirstToolbar == TRUE)
{
GetWindowRect((HWND) hTool, &hToolRC) ;
// Leave a space between the gripper and the first button
SetWindowPos(hTool, NULL, 10, 0, 0, 0, SWP_NOSIZE);
GetWindowRect(hwndRB, &hwndRBrc) ;
memcpy(rRC, &hwndRBrc, sizeof(RECT)) ;
return 0 ;
}
// The Tool Bar will be at the bottom of the rest of
// the present windows.
GetWindowRect((HWND) hTool, &hToolRC) ;
if (SetWindowPos(hTool, NULL, 0, hwndRBrc.bottom-hwndRBrc.top, 0, 0, SWP_NOSIZE) == 0)
return -1 ;
GetWindowRect((HWND) hTool, &hToolRC) ;
// The rectangle will include the new Tool Bar.
GetWindowRect((HWND) hwndRB, &hwndRBrc) ;
rc.left = hwndRBrc.left ;
rc.right = hwndRBrc.right ;
rc.top = hwndRBrc.top ;
rc.bottom = hwndRBrc.bottom + rbBand.cyMinChild ;
SendMessage(hwndRB, RB_SIZETORECT, 0, (LPARAM) (LPRECT) &rc) ;
GetWindowRect(hwndRB, &hwndRBrc) ;
GetWindowRect(hTool, &hToolRC_new) ;
SetWindowPos(hTool, NULL, 10, hToolRC.top - hToolRC_new.top,
0, 0, SWP_NOSIZE) ;
return 0 ;
}
If the toolbar is the first, then i add it without doing a RB_SIZETORECT because it is not needed. Else i do so.
What i saw when working with this is
1) If i send RB_SIZETORECT, the second toolbar changes it position and returns to the values before the SetWindowPos.
2) If i do a SetWindowPos after resizing the rectangle of the ReBar window for the second toolbar, then i see it in a right position.
My questions are:
1) If i want to add n toolbars, i will have to set the sizes for each window ? Is there any message or function in Windows API that arranges all of them automatically ?
2) When i modify manually (with the grip) the position of a Toolbar, the buttons dissapear. I have to handle the messages for the ReBar and Toolbar to set the positions of the bands/toolbars every time the users changes it ?
3) If i have to implement the chevron, i will have to handle all the chevron MSGS and also do the TrackPopupMenu with all my buttons ?
Thank you very much for reading this message.
Bye,
Fernando.
Fernando Gabrieli
|
|
|
|
|
Ok, so I want to be able to select a section of text and modify its properties. Well, the CFontDialog class only offers BOOLs for most of the options (underscore, bold, italic, etc. are either TRUE or FALSE). That doesn't allow me to have a third value to set the dialog to if, say, two different parts of the selected text had different properties. The idea would be to check all properties, and set the ones that differ to some third value. Then, on '...DoModal() == OnOK;' Check the values again to see whether they'd been changed to either TRUE or FALSE, and change the entire selection to that. If it's still the third value, then do not change the selection and leave each character just as it was for that property.
So, there's the problem: There's no third state which means to keep the differences intact. And since they're BOOLs, I can't even set the underlying value to some third state to compare with the value after the user's done.
My attempts: So, I tried to do a callback function to somehow try and figure out when the user has made a selection in the font dialog, then I can hopefully ONLY use the selected value(s) to modify the text, NOT the other properties that were not specified. This is still annoying, since it wouldn't show the user an acceptable third (greyed out, but still selectable, like in Word) state, but at least the functionality could be accomplished.
Result: Assertion errors on my attempts at the callback function. I can't seem to make them work.
So, help on the callbacks, or suggestions on showing the user this third state would be greatly appreciated. I'm not good enough to make my own font dialog, I don't think.
halblonious
|
|
|
|
|
I have an image routine that uses bi-linear interpolation to smoothly scale a bitmap from one size to another. Works fine...just to see if I could still do it, I decided to code the same algorithm in inline assembler to determine if I could speed it up. (yeah, I'm a geek)
It did speed it up, but not as much as expected...it was only 15-29% faster, depending on bitmap size, in assembler. (determined using GetTickCount)
Now the question. Is this performance gain what I should expect or is it more likely the curse of a slow algorithm? I know it is hard to answer fully without seeing code...but in general.
Does anyone know where I can get super fast image scaler source code? I would sacrifice some quality for speed.
Gary Kirkham
A working Program is one that has only unobserved bugs
I thought I wanted a career, turns out I just wanted paychecks
|
|
|
|
|
Doesn't surprise me. I did the same thing with a similar algorithm several years ago and saw less of a gain. My biggest gain was by using GDI+ instead.
|
|
|
|
|
It is a question that can't be answered. The problem is that you can get a 15-20% speed increase with assembler on either a good or bad algorithm.
Post the algorithm.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|