|
Thanks again David.
Just one final question.
When ever I create a control variable, it takes about 4 minutes. I think all PCs on the network are being accessed. I cannot find a setting to limit this activity.
Many thanks,
Andy.
|
|
|
|
|
Andy202 wrote: When ever I create a control variable, it takes about 4 minutes.
Within the IDE?
Andy202 wrote: When ever I create a control variable...I think all PCs on the network are being accessed.
I'm not aware of any correlation between the two. Does unplugging the network cable have an effect?
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Yes, works OK with the cable unplugged.
and it is within the IDE.
|
|
|
|
|
I am using MM_TEXT mode during Ondraw(CDC *pDC) function & displayed a rectangle but during printing i am using MM_TWIPS mapmode now i want to use CoOrdinate used during Ondraw.I tried to convert Co-ordnate into correct pixels. Here is code:
// during On draw
pDC->MoveTo(p1);
pDC->LineTo(p2);
pDC->LineTo(p3);
pDC->LineTo(p4);
pDC->LineTo(p1);
// some macro
#define CalibPoint(p, HorPix,VerPix) CPoint(CALIBX(p.x,HorPix),CALIBY(p.y,VerPix))
#define CALIBX(point,HPIX) (point * HPIX )/PIXPERINCH
#define CALIBY(point,VPIX) (point * VPIX )/PIXPERINCH
#define PIXPERINCH 72
int nHorz = pDC->GetDeviceCaps(LOGPIXELSX);
int nVert = pDC->GetDeviceCaps(LOGPIXELSY);
//during printing
p1=CalibPoint(p1, nHorz,nVert);//CalibPoint is Macro
p2=CalibPoint(p2, nHorz,nVert);
p3=CalibPoint(p3, nHorz,nVert);
p4=CalibPoint(p4, nHorz,nVert);
pDC->MoveTo(p1.x,-p1.y);
pDC->LineTo(p2.x,-p2.y);
pDC->LineTo(p3.x,-p3.y);
pDC->LineTo(p4.x,-p4.y);
pDC->LineTo(p1.x,-p1.y);
Thanks & regards
priyank Dwivedi
priyank
|
|
|
|
|
Whats the difference between
Use Mfc in Static Library and
Use Mfc in Shared Dll.
what is achieved after specifing either of thses two?
Thanks in advance....
|
|
|
|
|
The shared dll option will use the existing mfc dlls on the machine on which execution is going on. If you don't have the dlls it wont' execute.
The static library option will attach the code of mfc dlls in you executable so you will not need the dlls.
But the drawback of static linking is that the overall size of executable will be increased.
|
|
|
|
|
While the static library name may be hard to understand, the "shared dll" bit should be easier!
An EXE is the program you're running. It can also use DLLs, which other EXEs can use - hence shared DLLs. If you're struggling with that idea, then this is not the right forum for you.
In this case, your program will reference the MFC DLL(s). This could be MFC42U.dll for example. But this may or may not be on a system, so you'd need to put it there - and what if a bad person overwrites it? And is it will contain every MFC class and code, it will be quite large.
The alternative is to link all the MFC functions into your EXE. It will now be larger than before, but more selfcontained. And not as large as the EXE and DLL were before.
Which you use is heaviliy dependent on other conditions. Ease of install, whether the DLLs already exist on the system (which is a given with older versions of MFC). Will this be downloaded over a slow internet connection? etc.
There is no black or white, good or bad answer. Welcome to programming - land of compromises and cost-benefit analysis.
Iain.
|
|
|
|
|
i would use shared DLL usually but the main problem which i faced as an AMATUER programmer was tht my program wont run on my friend system! so static DLL helped me out! though the size of the exe incresed to few MBytes but atleast i got STANDALONE application
|
|
|
|
|
How to convert double value to float value.
please look at the following code
double dDoubleValue = 200.55000000.
float fFloatValue = (float)dDoubleValue;
output will be 200.54999999, but i need exact value 200.55000000.
|
|
|
|
|
Sakthi_Vel wrote: but i need exact value 200.55000000
floating point numbers are never exact.
|
|
|
|
|
You can use FLT_EPSILON.
For more information visit here[^]
|
|
|
|
|
round it when you are showing the value.
Russell
|
|
|
|
|
As by drawing with a "big" point :P ??
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
|
|
|
|
|
Here[^] you will need a very BIG point!
Russell
|
|
|
|
|
What Every Computer Scientist Should Know About Floating-Point Arithmetic[^].
See also this post[^] of mine about rounding in SQL Server.
If you need an exact decimal, perhaps for currency values, use a scaled integer. These are harder to find in C++, there's no standard implementation as far as I know, but basically treating an integer as if it were in cents rather than dollars, or pence rather than pounds, generally works pretty well.
|
|
|
|
|
so there is no way to convert in c++ as of explanation ;)
|
|
|
|
|
Had you read up on how floating-point numbers are stored/represented on a binary computer, you'd already know the answer to your question.
"A good athlete is the result of a good and worthy opponent." - David Crow
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
I want to initialize my tree control with system directory tree in OnInitdialog function so that i can select my folder.
Remember I am working in mfc.
please help me.
Dhiraj
Dhiraj Kumar Saini
|
|
|
|
|
|
I have used the code with the link but it is giving error.
Can u give ne another link or code
i know its simple but not able to do it.
Thanks In advance.
Dhiraj
|
|
|
|
|
Dhiraj kumar Saini wrote: it is giving error
It is strange...What kynd of error?
alseway, in CP there are a section for articles related to custom tree contrlols:
All the articles on CP[^].
I can suggest
this[^]
this[^]
or this[^]
Russell
|
|
|
|
|
|
ACtually when i was trying to use the code of OnInitdialog function in my onititdialog function with InsertItem function it was giving two errors .
thet were related to linking error.
Remeber I am only using cod eof OnInitDialog funcion.
Dont know why.
Dhiraj
|
|
|
|
|
I think you have to study better the code given with the article...surely you have to copy something more than the code inside the function OnInitdialog
Russell
|
|
|
|
|
Hi,
Sorry to bother you I have gone through the code and implemented it also. Now the problem i am facing in my tree control is that it is showing all the drives and network neighbourhood but when i am selecting any one of them it is not expanding. I dont know why although i have added the event handlers for expanding.
please help me.
Dhiraj
|
|
|
|