|
Yeah, I could translate or what I do is set the origin of the DC to 0,0 before calling Gdiplus::Region.GetHRGN(&graphics).
The problem though is I shouldn't have to do this. After doing the GetHRGN the CRgn.GetBounds() call should return a bounds that is identical to Gdiplus::GetBounds() (that is factoring in any fractional differences).
Andy
|
|
|
|
|
I wouldn't recommend you to use GDI+ in its current beta.
I tried to use it only to do a simple gradientfill, i got problems with that
sometimes it did not draw anything and sometimes it drew outside of the DC.
(it even drew over another windows DC!)
Very simple code so i dont think the bug was in my code.
(It works with no problem when i use the regular GDI API)
|
|
|
|
|
I wouldn't recommend you to use GDI+ in its current beta.
I tried to use it only to do a simple gradientfill, i got problems with that
sometimes it did not draw anything and sometimes it drew outside of the DC.
(it even drew over another windows DC!)
Very simple code so i dont think the bug was in my code.
(It works with no problem when i use the regular GDI API)
|
|
|
|
|
I need to create a Login Window for an application and am wondering if there is one already made somewhere that I can import or how would I use the default windows login screen resident in the Windows OS.
|
|
|
|
|
in our app i just made a 2 edit box dialog (the pw one has the password property set) and query our db for correct logons
to fire it off automatically when the app starts just send yourself a message at the end of the CApp::InitInstance() function
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
I have to create a "pricing tools" with Visual C++. For this application I have to use parameters which are kept in Excel worksheet and use them in functions which are implemented in c++. I don't know what is the better way for this kind of application. I don't know if I have to export C++ code to excel worksheet or import my parameters in C++ and use them.
So, I believe that I have to do a choice between EXE application or DLL.
It's the first time that I use VC++, before I worked under UNIX environment,so...
thanks for your help
Gerald
|
|
|
|
|
I'd create a C++ Exe and use COM Automation to access the excel worksheet.
See HOWTO: Use MFC to Automate Excel and Obtain an Array from a Range (Q186122)in the MSDN Library/ Microsoft Knowledge base for a starting point.
Michael
|
|
|
|
|
are you using a reuters tick feed to update the excel spreadsheet?
if so, the reuters dev kit has the libs u need to build a tick feed app that can query the price feed directly
just a thought
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
Do you know more about this libs? if so, do you think that I will be able to create an automation using reuters libs? And if it's possible, do you think that's better to create an executable program?
thanks for your help.
Gerald
PS:Think about this sentences:"C'est quand on est au pied du mur que l'on voit mieux le mur"
|
|
|
|
|
contact reuters in london as they have all the dev resources there ... they have a class lib that lets you talk to the ssl feeds directly and its fairly straightforward to build an activex that will embed in an excel spreadsheet or an exe that sits resident and executes in the bg to gets the price change ticks as they happen
we did a lot of work using reuters for banks here in south africa and its an ok dev kit to work with ... enough examples to get you up and running fairly quickly
one point though is they are changing over to tcp/ip for their protocol but i think they can wrap that stuff transparently in the class lib so it shouldn't affect you
you want to be asking for the ssl developers kit for version 4 or higher
---
"every year we invent better idiot proof systems and every year they invent better idiots"
|
|
|
|
|
I'm using Windows NT 4.0 and Visual C++...
Anyone knows how to verify if a process is running in a remote machine without using registry key handles ?
|
|
|
|
|
How to add, remove, change position about the icons on the desktop in my code.
|
|
|
|
|
You can get the location of your windows directory programatically, then the desktop is stored in a subdir called Desktop. Not sure how you position them though.
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
Hello,
Does someone know how to set the background and the text colors of the date/time picker?
I've tried to handle the WM_CTLCOLORXXX messages but none of them are sent to the parent...
Thanks
Serge
|
|
|
|
|
I need to disable/enable one or several pages on a CPropertysheet
It must have been asked a thousand times, but I can't find the solution (sorry for asking again)
301396668
|
|
|
|
|
The solution was published in C++ QA column in March'98 issue of Microsoft Systems Journal. You may have this article on your HD - check the 'Periodicals' section. It should be also online, unfortunately MS has revamped the MSDN Online and it totally sucks now. Try going to MSDN Magazine, then MSJ (small link on the left side), then backissues.
Tomasz Sowinski -- http://www.shooltz.com.pl
|
|
|
|
|
Hi,
Is there any API (windows API) which will return the subnet mask of the local machine?
Thank You.
Yamuna.E.
|
|
|
|
|
Does this function really exist in math.h ?
Or how can I set the number of decimals in my results ?
Thank in advance.
Leo.
|
|
|
|
|
I'm not sure - I also cast to int to get that result. You can use floor & ceil, which force rounding up or down, but I look forward to someone else filling in my ignorance on a function that actually rounds properly ( in the meantime, casting to int works fine ;0)
As to a number of decimal places, simply multiply by 10 ^ x, round off and divide again, or use fixed point in the first place ( where a certain number of figures in an int are regarded to be past the decimal point and calculated accordingly )
Christian
#include "std_disclaimer.h"
People who love sausage and respect the law should never watch either one being made.
The things that come to those who wait are usually the things left by those who got there first.
|
|
|
|
|
<br />
double Round(double dVal)<br />
{<br />
double dRemainder = fabs(fmod(dVal, 1) * (int)10);<br />
<br />
if (dVal > 0)<br />
{<br />
if (dRemainder >= (int)5)<br />
return ceil(dVal);<br />
<br />
return floor(dVal);<br />
}<br />
<br />
if (dRemainder >= (int)5)
return floor(dVal);<br />
<br />
return ceil(dVal);<br />
}<br />
<br />
<br />
double Round(double dVal, UINT nDecPlaces)<br />
{<br />
double dFactor = pow(10.0, (double)nDecPlaces);<br />
return ( Round( dVal * dFactor) / dFactor);<br />
}<br />
Andy Metcalfe - Sonardyne International Ltd (andy.metcalfe@lineone.net) http://www.resorg.co.uk
"I used to be a medieval re-enactor, but I'm (nearly) alright now..."
|
|
|
|
|
Here's some code for you. The first finction returns an int, and the second one returns a double rounded to the nearst number of decimal places. The last two functions are just in case you want a double rounded up or down to the nearest integer value. Merely adding or subtracting 0.5 to the original value and calling Rounder with that value will yield the desired result.
int Rounder(double dValue)
{
char sBuf[64];
sprintf(sBuf, "%0.lf", dValue);
return atoi(sBuf);
}
double Rounder(double dValue, int nDigits)
{
char sBuf[64];
sprintf(sBuf, "%0.*lf", nDigits, dValue);
return atof(sBuf);
}
int RoundUp(double dValue)
{
return Rounder(dValue + 0.5);
}
int RoundDown(dowble dValue)
{
return Rounder(dValue - 0.5);
}
|
|
|
|
|
Thanks a lot for this piece of useful code...
Leo.
|
|
|
|
|
Does this function really exist in <math.h> ?
Or how can set the number of decimals in my results ?
Thank in advance.
Leo.
|
|
|
|
|
I write a self_defined class "CBitmapBox" to display image.Then create a CArray object to
dynamically change CBitmapBox Object number in a dialog.But always error,error is "class CBitmapBox__thiscall CArray<class cbitmapbox,class="" cbitmapbox="">::GetAt(int) const "compile
fails.I cannot get rid of it,Please help me,Thanks.
Main code as follows:
heahfile:
CArray<cbitmapbox,cbitmapbox> *m_BmpArray;
cpp:
m_BmpArray->SetSize(TotalNum);
...
(m_BmpArray->GetAt(Num)).BLoadImgFile();//BLoadImgFile() is self_defined function.
|
|
|
|
|
GetAt() returns a copy of the object stored at index. Have you defined a copy constructor for CBitmapBox? Maybe you should use CArray::GetData() instead?
|
|
|
|