|
Its an undocumented function. Try using one of the documented Win32
fucntions for semaphores. Or there are a few books on undocumented
stuff (one from the Systems Internals guys and another from someone
I can't remember).
Stephen Kellett
--
C++/Java/Win NT/Unix variants
Memory leaks/corruptions/performance/system problems. UK based.
Problems with RSI/WRULD? Contact me for advice.
|
|
|
|
|
I am trying to incorporate the pre-release version of GDI+ into a Win2000 app and am having a few problems.
1) LinearGradientBrush.SetWrapMode(WrapModeClamp) returns an Invalid Parameter (this call works fine with linear brushes and any of the tile wrap modes, and also works with the path gradient).
2) I need to be able to create gradients (both path and linear) that have more then two colors. To do this I call SetInterpolationColors and pass the array of colors and there positions. The problem is I also want to set the midpoint between colors at places other then 50%. To do this I'm trying to use SetBlend but I can't figure out how to set up the factors & positions to do this. When just using two colors I can do:
REAL factors[3] {0.0, 0.5, 1.0};
REAL positions[3] {0.0, 0.3, 1.0};
to set the mid-point to 30% but what do I need to do for more then two colors?
If you can help on either of these questions I would greatly appreciate it.
Thanks
Andy Brace
|
|
|
|
|
This is really interesting. Bearing in mind that GDI+ is still in beta, it would appear that LinGradBrush does not support WrapModeClamp ( you can get the same effect by clamping the area you draw to the rect you pass the constructor ), but what is more interesting is that when I try SetBlend after setting up a brush with three colours, ( hard red, green & blue ), I get a blend between scales of grey. Have you thought about specifying the midpoint colours as colours in your call to SetInterpolationColors ? Then by specifying their positions, you'd be specifying your midpoints.
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.
|
|
|
|
|
Thanks for the response.
I ended up masking off the regions I didn't want tiled with gradients. I have to do this anyway as I need to draw the start and end colors in these areas. As far as the blending, that was to be my fallback position if I can't get the SetBlend to work for me.
I've found another problem though and it has to do with the regions. I'm trying to implement GDIPlus as much as possible and I have cases where I need to switch back and forth between the GDIPlus Region and CRgn. What I've found is that when switch from the Region to CRgn I am using the Region.FromHandle(&graphic) call. The problem comes about because the CDC that I use to create the graphic has an origin not at 0,0. This causes the CRgn to be created offset by the origin (i.e. you create a Region from a rectangular path whose origin is 0,0, but the DC you are drawing into is offset to 150, 150, when you try to create a Region from the path and then try to create a CRgn from the Region, you end up with a CRgn whose bounds start at 150, 150).
Andy
|
|
|
|
|
Does the GDI+ Region not have a translate method ? Or it may be effected by calling translate on the Graphics object that holds it ?
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.
|
|
|
|
|
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..."
|
|
|
|