|
How can I get a simple line onto my dialog? I want a line just like HTML's [hr] tag.
Also, any links to tutorials on using the VS.NET dialog editor would be much appreciated.
Thanks,
Adam
My code isn't buggy. Those are all fleatures.
|
|
|
|
|
One way I've found is to create a button that's one dialog unit in height. Normally the dialog editor won't let you create a button this small, but you can press Alt while dragging to override its minimum size requirements (VC 6, eVC 3 - not attempted in VS.NET).
|
|
|
|
|
That did the trick! Thanks!
My code isn't buggy. Those are all fleatures.
|
|
|
|
|
I want to update a list control (that already contain images) and change the image from x to y.
Can I do that without delete the item and insert new with the y image.
Can someone help with this?
CanopenR
CanopenR@dtu.cc
|
|
|
|
|
LVITEM lvi;
lvi.mask = LVIF_IMAGE;
lvi.iImage = ?????;
SetItem(&lvi);
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Thank you, it worked liek a charm, after i filled it...
CanopenR
|
|
|
|
|
Hi everybody
I found an expression to print the real height of a font
-MulDiv(font.GetHeight(),GetDeviceCaps(GetDC()->GetSafeHdc(),LOGPIXELSY),72));
but when I print a text, the font height is not the real height, is smaller. I compare it with microsoft word height font.
The question is, What can I do to print the real height font?
|
|
|
|
|
This is a method in a CWnd derived class, I guess.
The call to GetDC() is getting the DC of the window, not the DC of the printer, so you need to use that HDC instead.
If you're using MFC Document/View, then a CDC* is passed into OnBeginPrinting(), and you can plug that in, in place of GetDC() in your code.
Incidentally, are you doing a corresponding call to ReleaseDC() somewhere?
Steve S
|
|
|
|
|
Yes, I use MFC document/view, and I use the CDC* passed into OnPrint(), GetDeviceCaps(pDC->GetSafeHdc(),LOGPIXELSY), but doesn't work.
|
|
|
|
|
OK, then in that case, when you say it's the wrong height, what exactly does that mean?
Here are some examples;
(a) the text is slightly smaller than the same text in Word
(b) The text is slightly larger than the same text in Word
(c) the text is way too small to read
(d) /* other option here! */
If (c), it's a mapping mode/device resolution issue.
If (a) or (b), then the definition of height is important.
Height = ascent+descent, with leading added between subsequent lines.
Steve S
|
|
|
|
|
for example in arial facefont
Word 12 points = 3mm height
My application 12 points = less than 1mm height
word 28 points = 7mm height
my application 28 points = 2mm height
I use MM_TEXT mapmode, so if you tell me
MulDiv(fh,72,GetDeviceCaps(pDC->GetSafeHdc(),LOGPIXELSY));
this function is the way to print the real height font, then I try found an error in my source code, I just want be sure about this function.
Thankyou!!
|
|
|
|
|
Ah. That explains it.
try
-MulDiv( fh, pDC->GetDeviceCaps(LOGPIXELSY), 72)
instead. I realised while I was driving home from the office that you have the params to MulDiv in the wrong order.
MulDiv(x,y,z) = (x*y)/z,
and font height in points is
(ht * dpi) / pts_per_inch
not
(ht * pts_per_inch) / dpi
Steve S
|
|
|
|
|
Can someone help me using function "IsDestinationReachable".
When I try to build my application, I got folowing error message:
OPFB error LNK2019: unresolved external symbol _IsDestinationReachableA@8 referenced in function "public: virtual int __thiscall MYPRGApp::InitInstance(void)" (?InitInstance@COPFBApp@@UAEHXZ)
If someone have some code examle how to use this function, please send me.
I include "Sensapi.h" and use library "Sensapi.lib".
Thank yoou !
|
|
|
|
|
u need have dll linked.
from help to find which dll file associated with the function.
includeh10
|
|
|
|
|
It's as simple as that. I don't know what else you've got in place that is causing this linker error. If I omit the Sensapi.lib, I get an LNK2001 error.
I was unable to find LNK2019. Is this a .NET project?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Can you show me how (few lines) including how to create some LPQOCINFO ?
This is my source part that generate this error.
if ( IsDestinationReachable("www.google.com", NULL) == TRUE)
AfxMessageBox("Google ok !");
|
|
|
|
|
QOCINFO oci;
oci.dwSize = sizeof(QOCINFO);
IsDestinationReachable("www.google.com", &oci);
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Still doesn't working...thank you for your effort, but please help me one more time .. I'm gona crazy wit this...
This is part of my code. As you may see that I include Sensapi.h, and in properties of application I include library SensAPI.Lib (/IMPLIB:"SensAPI.Lib").
Do you have any earthly Idea what might be wrong with this ?
#include "stdafx.h"
#include "MYPRG.h"
#include "MYPRGDlg.h"
#include "Sensapi.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#endif
......
BOOL MYPRGApp::InitInstance()
{
...
QOCINFO oci;
oci.dwSize = sizeof(QOCINFO);
IsDestinationReachable("www.google.com", &oci);
....
|
|
|
|
|
So you have "sensapi.lib" in the Object/library modules: box on the Link tab of the Project Settings dialog?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
|
So where is the /IMPLIB operative being used?
Five birds are sitting on a fence.
Three of them decide to fly off.
How many are left?
|
|
|
|
|
Sorry...misunderstanding
From options you may see that /IMPLIB:"Sensapi.lib" is there.
/OUT:"Debug/MYPRG.exe" /INCREMENTAL /NOLOGO /DEBUG /PDB:"Debug/MYPRG.pdb" /SUBSYSTEM:WINDOWS
/IMPLIB:"Sensapi.lib" /MACHINE:IX86
I also try to include Sensapi.DLL file in this .cpp source, but still get same error.
Do you think that I have to configure, or setup, or.... I don't know what else should I and where to...
Should I put #include "Sensapi.h" directive on some particula place, should I include this library somwhere else except this (MYPROG Property Pages --> Configuration Properties --> Linker --> Advanced --> Import Library --> Sensapi.lib) ?
I try to find some source code (or project file) that use this function on Internet, but it wasn't successfully.
Do you have any other idea what might be wrong ?
|
|
|
|
|
/IMPLIB is for telling the linker to generate an import library with that name, based on the exports from your binary.
To use an import library, you include it in the list of files to link. In the Visual Studio .NET IDE, this is found under Configuration Properties > Linker > Input > Additional Dependencies.
If you've already been using /IMPLIB , your output directory will likely contain a file sensapi.lib , which could cause the linker to pick that file. If so, delete it.
|
|
|
|
|
Thank you !!!!!!!!!!!!!!!!!!!!!!!
It's working !!!
I can't believe it !!!!
Thank you !!!
|
|
|
|
|
Interesting thing is that, if I omit the Sensapi.lib, I get the same error as I get it with included library ?!
|
|
|
|