|
No the integer version returns an integer that is then automatically casted to a double. With integers only the correct answer is 0.
John
|
|
|
|
|
Hi All,
I have Created a Font using the function:
CreateFont()method.
I want to get the width of the font here for a particular purpose,
So Iam creating a font first with the "CreateFont" function & giving '0' in the width parameter as I dont know the width of the font.
Then I get The font metrics of this font & from it I create a Logfont structute editing the width part.
Now I create the font again with the width .
Everything worked fine until I got into a problem:
I used the "SetWorldTransform" for scaling.Now When I scale the text with a particular font,the scaling is not happening in the horizontal direction(ie: widthwise).
I would like to have the scaling widthwise as well.
Could anyone Help.....
Thanks in Advance..
font.CreateFont(-height,0,rotVal.x ,rotVal.y,style,FALSE,FALSE,0,ANSI_CHARSET,
OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,DEFAULT_QUALITY,DEFAULT_PITCH|FF_SWISS,
reinterpret_cast<const unsigned="" short*="">(facename.c_str()));
TEXTMETRIC fontMetric;
m_deviceContext->GetTextMetrics(&fontMetric);
double averageCharWidth =(fontMetric.tmAveCharWidth);
//LogFont Structure
LOGFONT lf;
memset(&lf,0,sizeof(LOGFONT));
font.GetLogFont(&lf);
lf.lfWidth=(averageCharWidth/1.5)*ratio;
//Deleting the fontObject & Creating a New Font.
font.DeleteObject();
font.CreateFontIndirect(&lf);
CFont * pOldFont = m_deviceContext->SelectObject(&font);
The xForm structure is as follows:
XFORM xForm;
xForm.eM11 = 0.01 * m_iZoomFactor;
xForm.eM21 = 0;
xForm.eDx = 0;
xForm.eM12 = 0;
xForm.eM22 = 0.01 * m_iZoomFactor;
xForm.eDy = 0;
SetWorldTransform(pDC->GetSafeHdc(), &xForm);
|
|
|
|
|
I'd like to copy the content of a Flexgrid (MS FlexGrid Control version 6.0)to a Word or Excel document. I tried "InvokeHelper(0x37, DISPATCH_METHOD, VT_EMPTY, NULL, NULL);" hoping it would copy a picture to the clipboard but it doesn't.
Ideally, I would like to copy not a picture but the actual data as a table to Excel.
Many thanks in advance for your help.
|
|
|
|
|
Actually I am doing a project on face detection
Now i have got the output coordinates of facial features but there are too many of them and i need only a few of them to do analysis so as to achieve face expression detection.
So will the coordinates selected, like x,y (12,23)for neutral expression I want to compare will another x,y (45,76). If if it satisfy the happy criteria, then output will be happy
So how should I link two programmes together?
The first programme output a list of coordinates while the want I am doing will get some valuse and output the expression
i do hope someone will help me
|
|
|
|
|
i read your first message, but i don't understand what you mean by linking 2 progs together?
Я люблю русский язикь!
|
|
|
|
|
I want to make use of the output of the first programme and then use it to analysis. I am now writing the second programme. The output of the first programme, i will have to store it in some datasheet and then use some of the values for the second programme. Can the programme auto create this datasheet that stores the values in specific places aiting for call out?
U understand what i saying?
Thx alot
|
|
|
|
|
i hope i got that right: you want to save some data of program 1 and load it later on into program 2? if so you could use GetPrivateProfileString() & WritePrivateProfileString() to load & save data in .ini files
hope this helps
Я люблю русский язикь!
|
|
|
|
|
So with this, i use GetPrivateProfileString() to get the values i want then WritePrivateProfileString() to load it to the second programme. When i use the function get, where does the programme get the values from and will i be able to select the values i wan?
thx
|
|
|
|
|
char lpBuffer[256];
GetPrivateProfileString(
"MySection", // LPCTSTR lpAppName
"MyKey1", // LPCTSTR lpKeyName
"0", // LPCTSTR lpDefault - in case file does not exist this is default
lpBuffer, // LPCTSTR lpReturnedString
256, // DWORD nSize
"File.ini" // LPCTSTR lpFileName
);
WritePrivateProfileString(
"MySection", // LPCTSTR lpAppName
"MyKey1", // LPCTSTR lpKeyName
"0", // LPCTSTR lpString - whatever you want to save
"File.ini" // LPCTSTR lpFileName
);
you don't have to create a .ini file; it is created for you in the app's folder.
make sure both programs refer to the same .ini file.
Я люблю русский язикь!
|
|
|
|
|
I have array of R,G,B values of some bitmap.
How to display this in my dialog box ?
I've tried this, but this does not display anything :
m_bitmap.CreateBitmap(m_imgWidth,m_imgHeight,1,24,m_imgData);
CClientDC dc(this);
CDC bmDC;
bmDC.CreateCompatibleDC(&dc);
CBitmap *pOldbmp = bmDC.SelectObject(&m_bitmap);
dc.BitBlt(0,0,m_imgWidth,m_imgHeight,&bmDC,0,0,SRCCOPY);
What am I doing wrong ?
rrrado
|
|
|
|
|
(It seems that SelectObject() fails, because it returns NULL)
rrrado
|
|
|
|
|
I have recently followed creating the webbrowser control inside a standard C application window from the article: http://www.codeguru.com/ieprogram/cwebpage.html
I am stuck currently in the land of C.
What i want to acheive is creating standard win32 listbox, button, edit controls on top of the browser control. - Thus benefiting from all the nice to have's with html but running the important stuff from win32.
I have been able to create a button within the rgn of the browser control but 1: It is inactive (probably because it is just a transparent region of the browser control that has not been painted yet)
2: As soon as the browser control gets redraw in that area, it dissappears.
I know many applications use the edges of the client to add the win32 controls but i need it to at least appear as if it's all the same.
I have thought of creating multiple browser controls around my standard controls but my previous experience with the browser control has
I have struggled in vain with trying to set regions of the webbrowser control to transparent + creating the controls with TOPMOST priority.
Your help would be very much appreciated and my final endeavours will be posted back to this site.
Thanks
Carl
|
|
|
|
|
Whenever the text of a tree item changes how can i know it. Which notificacation is sent. The text is being changed programmatically
|
|
|
|
|
use the WM_NOTIFY msg TVN_BEGINLABELEDIT. you can cancel label edit by returning TRUE.
Я люблю русский язикь!
|
|
|
|
|
I am setting the text using SetItemText and not label edit. I want to know if any event triggers whenever a SetItemText is done on a Tree Item.
|
|
|
|
|
HI,
I know how to print a html file using Exec command by which all the prining is done internally . But i want to whether we can do it ourself.Actually i want to change the caption in my language(other than english)in the print dialog box.Since mfc is doing it internally i don't how to change it.So kindly help.Providing some source code would be more helpfull. Thanx in advance
lokesh.k
|
|
|
|
|
Hi,
suppose, I am onto threading
the sample code is as follows
void download(void *dummy)
{
while(1)
{
long retval=URLDownloadToFile(0,"http://www.anyurl.com/","C:\\htmpage.htm",0,0);
if(retval!=0)
{
::MessageBox(0,"Failed to grab news","Error in downloading...",0);
}
else
{
// LoadHtmlFile(); // download from google.com
}
Sleep(1600);
}
}
and i called it as
_beginthread(download,NULL,0);
Why does this function FAILS in threading in ATL based application, is there any other alternative to solve this problem, or how can i put threading in ATL???
regards
Balkrishna Talele
|
|
|
|
|
Hello to Everybody,
My name is Thomas, I am a student in computer science.
I need to implement in visual C++, a code that requests something to a PHP database server using a url (ex.: "http://192.168.1.110/csa/csasql.php?tipo=select&sql=SELECT Cali_CardPresent,Acc_Operator,Acc_IR FROM IR_ERRORS " ), and the server returns the answer thats can be:
+ an error or a success and in case of success, in some cases can be followed by data.
I first used to do this the function URLDownloadToFile(), but when the server is down, I have downloaded the file stored in the Internet cache.
Its a big problem because I don't want cached files to be stored and retrieved because its was an past answer of not my last request. I would like that for each request the server sends a new answer, and not taking the cached file.
I tried reconfigure IExplorer or bypass the problem using other ways but It is not so efficient...
I dont know if there is any way to bypass the caching of files but I see there is another function: the URLOpenStream().
Maybe with this function, all requests are straight for the server, and therefore bypass the cached stored files?
But there is another problem for me to use the URLOpenStream(): I am trying to understand how to implement the IBindStatusCallback interface, because I am not so experienced in C++ and if you would like to contribute with an example project in VC6++ that compile, I will be very thankful.
Regards, Thomas.
|
|
|
|
|
if u get the ans do let me know too,
try using this if i am not mistakento your question
long retval;
retval=URLDownloadToFile(0,"http://www.anyurl.com/","C:\\ddd.htm",0,0);
if(retval!=0)
{
::MessageBox(0,"Failed to grab page","Error in downloading...",0);
}
else
{
// do something
}
|
|
|
|
|
I need to set window size 1024 X 768,
or made them maximized - to not permit any move,
and not alow user to change window size by mose or else.
how to do it?
thanks.
|
|
|
|
|
Process the WM_GETMINMAXINFO message and limit the Window size in there.
Search MSDN for WM_GETMINMAXINFO and your get a dozen examples of how to do it.
|
|
|
|
|
Thanks.
It is very helpfull.
|
|
|
|
|
No problem
|
|
|
|
|
Hi,
this is bothering me for sometime time now and hope someone out there would help.
I've created a dialog project, in the the dialog there's an edit box. I need to write many lines of text to this box, to inform the user of the application status
How would I do this?
Kind Regards
Caoimh
|
|
|
|
|
Hello,
Edit->Properties -> Style check multiline properties.
With Regards,
R.Selvam
|
|
|
|
|