|
thanks for your suggestions.
Let me give you broader view of what Im trying to do..
Im developing an application that needs to send xml files to a mac system. A similar app on mac should be able to open and interpret the files.
Now the xml file has a header and a data parts.
The Data part will contain multiple node hierarchies as the one that follows:
<item>
<id> 123 </id>
....
....
<note> some notes</note>
<image>
<bitmap>
<height></height>
<width> </width>
...
</bitmap>
</image>
</item>
So I can use zlib on such multipe xml files.
what say..
Please suggest.
|
|
|
|
|
I am using the following code to choose the font from font dialog box . now after popup the font dialog box ,I select the font type size color and other properties .Now after clicking the ok button ,I want to display the all information in different comboboxes . my query is how can I get this information out from the font dialog box . I used the following code .
CHOOSEFONT cf; // common dialog box structure
static LOGFONT lf; // logical font structure
static DWORD rgbCurrent; // current text color
HFONT hfont, hfontPrev;
DWORD rgbPrev;
//Initialize CHOOSEFONT
ZeroMemory(&cf, sizeof(CHOOSEFONT));
cf.lStructSize = sizeof (CHOOSEFONT);
cf.hwndOwner = hdWnd;
cf.lpLogFont = &lf;
cf.rgbColors = rgbCurrent;
cf.Flags = CF_SCREENFONTS | CF_EFFECTS;
if (ChooseFont(&cf)==TRUE) {
hfont = CreateFontIndirect(cf.lpLogFont);
Trioum
|
|
|
|
|
What about documentation [^]?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Still I am not able to get the 1. font size
2.style regular bold and bold italic
Trioum
|
|
|
|
|
Because you didn't read carefully the documentation.
For instance, LOGFONT 's lfHeight member looks promising when searching for font size.
lfItalic also maybe useful piece of info and so on...
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
|
lf.lfFaceName giving the right font name that I select but lf.lfHeight giving the arbitrary wrong negative values. how can I solve it
Trioum
|
|
|
|
|
trioum wrote: lf.lfHeight giving the arbitrary wrong negative values
As MSDN tells you, you can use the following formula to specify a height for a font with a specified point size:
lfHeight = -MulDiv(PointSize, GetDeviceCaps(hDC, LOGPIXELSY), 72);
So you can use a simple function like the following to get the (positive) point size (which is what the font dialog displays) from the LOGFONT height:
int GetFontPointSize(int nHeight)
{
HDC hdc = ::CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
ASSERT(hdc);
int cyPixelsPerInch = ::GetDeviceCaps(hdc, LOGPIXELSY);
::DeleteDC(hdc);
int nPointSize = MulDiv(nHeight, 72, cyPixelsPerInch);
if (nPointSize < 0)
nPointSize = -nPointSize;
return nPointSize;
}
Note that you must use logical units for the lfHeight parameter in the LOGFONT struct. To get logical units from point size, you can use following function:
int GetFontHeight(int nPointSize)
{
HDC hdc = ::CreateDC(_T("DISPLAY"), NULL, NULL, NULL);
ASSERT(hdc);
int cyPixelsPerInch = ::GetDeviceCaps(hdc, LOGPIXELSY);
::DeleteDC(hdc);
int nHeight = -MulDiv(nPointSize, cyPixelsPerInch, 72);
return nHeight;
}
|
|
|
|
|
Hi. Why my progress bar ctrl doesn't apply smooth style although I set it's 'Smooth' property to TRUE???
I'm working in VS2008.
Thanks.
|
|
|
|
|
Load the resource file in a text editor, and look for the progress control there - make sure the styles are as you expect.
You can also use Spy++ to find the control, and look at its styles.
This is assuming the control is part of a dialog, and created automatically. If you use CreateWindow(Ex) yourself, then look at your code.
Also, many control styles are only valid at creation - using SetWindowLong (xxx_STYLE, blah)[*] won;t affect them.
Iain.
[*] too lazy to look it up, but I hope it makes the point.
|
|
|
|
|
Thanks Iain.
I've looked up using Spy++ and PBS_SMOOTH is present!?
The control is part of dialog, added on from toolbox on the dialog.
I don't use any code like 'CreateWindow...' or setting any style with 'SetWindowLong...'
Strange?
Also, forget to mention I'm on XP.
|
|
|
|
|
josip cagalj wrote: Also, forget to mention I'm on HP.
I saw your original post! I'm more of a fan of Heinz myself...
Not sure what to recommend really. I'd suggest starting an empty project with a dialog and progress bar.
Build up from there - see what you're doing differently.
Iain.
|
|
|
|
|
Once again thanks.
I'll do that, relay nothing else to try.
|
|
|
|
|
OK.
I've tried opening new project (dialog based) and put progress ctrl on dialog with smooth property and still nothing. I've did some surfing on net and found similar questions, they suggested (over at MSDN) to change windows theme to classic. After doing so, my progress ctrl did work with smooth style applied but come on that can't be solution!?
I don't wont to do that!
|
|
|
|
|
hello all. I am reading some data from xml file. I memcpy it to a BITMAP structure variable. Now I need to convert this to HBITMAP. how do I do this?
|
|
|
|
|
By using CreateBitmapIndirect...
|
|
|
|
|
|
Welcome... Don't forget to call DeleteObject to delete it when it is no longer needed.
|
|
|
|
|
Hi,
I have an UI developed using VC++. This UI identifies the com port in the system, upon selecting the com port and clicking OK button, the main application opens where commands is sent using com for communication with target. A usb to serial RS232 convertor for COM is being used. This UI is woking fine in some XP system.
When this UI executed in newly installed XP machine, it identified the com port but on cliking OK the application is getting closed.Before clicking OK button the com port would be opened and connected using another button. Is any dll is missing?
Thanks
|
|
|
|
|
Did you get an error message? If yes, please give details.
BTW try also to insert some debugging info (for instance logs) in your application.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
No i didn't get any error message.
|
|
|
|
|
Since you cannot possibly use the debugger on the failing machine, provide some trace info in you application.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Hi All,
I am creating a client server project .
My server is multithreaded, One thread is created for each request
from client.
Now my problem is:
As i send the 10 reuests at a time to the server Some of the receive
gets fail even after successful accepting, and give the 10038 error
number.
I have set the 15 sec time out for rece on client and server side.
But my server returns the error with in a second.
kindly help
|
|
|
|
|
Would help if you were to show some of your code too.
10038 is. btw, WSAENOTSOCK, so you specified something that's not a socket to a call which takes a valid socket. At the first run, without knowing much of what your code does, i'd say this is a thread synch problem.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
|
|
|
|
|
Anyone know if it's possible to create a shell extension that will change the text shown in the file type column in the same way as the IExtractIcon shell extension allows you to display a custom icon according to file content?
|
|
|
|