|
Hey, I think I got it.
pm_DH_Data = new struct DH_Tag;
Can I put thes in constructor?
|
|
|
|
|
Vaclav_Sal wrote: the elements initialization works fine and I have set the pointer to NULL
in the default constructor and it still gives me "Access violation".
If a pointer is null, you can't use it, you need to use the code I gave you to deal with this. So, use new if you want to use it. You can also lazy initialize ( call new when you need it and not before ).
Don't forget to call delete in your destructor
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Is there any simple way to take graphics.... drawn in either GDI+, DirectX, OpenGL, etc...and hook that executable process to a running or existing application or process....and if so can I use the SetWindowsHookEx to do so....?
Or more clearly, what are all the functions that I definitely need to use to accomplish this...?
Any help will be greatly appreciated!!
Thanks...
|
|
|
|
|
I'm sorry but I dont understand what you said
|
|
|
|
|
I'm trying to use hooks to hook a program written in C#, using GDI+ specifically to draw, to another existing/already running application/process. Do I need to use SetWindowsHookEx() or is there another way to hook?
Also, how do I go about the whole process of "hooking a process to another process"?
I hope this explains it a little better.
Thanks...
|
|
|
|
|
hi
i wanna open a MSWORD DOC such as double click on it but by my application call and pdf too.
WinExec(file path) is only for .EXE files and can not be used for .DOC or .PDF !
can u help me ?
|
|
|
|
|
ShellExecute will do this for you
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
tell more about ShellExecute plz
|
|
|
|
|
See here or here.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
tanx a lot
|
|
|
|
|
I want to know how to set the first parameter?
a beginner
|
|
|
|
|
|
|
I have a bitmap image representing a button. I would like to use this same bitmap to represent different states of the button, in particular the default, mouseover and clicked states. Default is the bitmap as it is, but for the other two states I need to make the bitmap slightly lighter and darker. I am doing this by looping through the pixels and manipulating the RGB values.
To make it darker I use this simple formula
crPixel = RGB(
GetRValue(crPixel) * 0.8,
GetGValue(crPixel) * 0.8,
GetBValue(crPixel) * 0.8 );
Multiplying by 0.8 gives the desired effect. But for a lighter bitmap, I try multiplying by 1.2 which doesn't work. The bitmap appears green rather than lighter. Does anybody know the correct formula for adding white to a pixel?
|
|
|
|
|
The issue is that the human eye percieves different colors differently, if you google for a greyscale filter ( or read my C# image processing articles ), you'll get the ratios you need.
I'm not sure if you're using a DIBSECTION, if you aren't, you should.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
Sorry, I tend to stay clear of the C# articles. I already had the grayscale filter in place for the disabled button style. As for the DIB's, not yet. Most of the code is in place for it, as soon as it's working, then I will add the tweaks.
|
|
|
|
|
waldermort wrote: Sorry, I tend to stay clear of the C# articles.
*grin* Yeah, if you touch that stuff, the stains are murder to get out.
waldermort wrote: As for the DIB's, not yet. Most of the code is in place for it, as soon as it's working, then I will add the tweaks.
You'll use DIBs ? A DIBSection is a magical DIB that can still be selected into a DC and drawn that way.
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
waldermort wrote: But for a lighter bitmap, I try multiplying by 1.2 which doesn't work. The bitmap appears green rather than lighter.
Are you making sure the RGB values don't go over 255?
Mark
|
|
|
|
|
That was probably the problem. I changed the formula so that it alphablends a white pixel, works fine now
crPixel = RGB(
GetRValue(crPixel) * dBlend + (1-dBlend) * 0xff,
GetGValue(crPixel) * dBlend + (1-dBlend) * 0xff,
GetBValue(crPixel) * dBlend + (1-dBlend) * 0xff );
|
|
|
|
|
convert the RGB to HLS ( or the other one ) and just play with the lightness value.
|
|
|
|
|
It is relatively easy to accomplish this if you calculate a HSL (Hue, Saturation and Luminosity) value based on the RGB value. Then modify the L-value, and convert back to RGB. There are tonnes of algorithms on the web for doing this. The only drawback is that it is quite slow, since all the algorithms I've seen so far, use floating point numbers for HSL values.
In any case, it's not equivalent to applying a linear factor on each RGB color component. Been there, done that. It works well on some color nuances, but will look like crap most of the time.
--
For External Use Only
|
|
|
|
|
Thanks for the info, but in the case of my app it's a little of an overkill. I just need a very simple way to extend on a default image in the case a user did not specify one.
|
|
|
|
|
Just make sure you look at all the processed bitmaps before you commit. You may be surprised at the result in some cases (I was!)
--
Verletzen zerfetzen zersetzen zerstören
Doch es darf nicht mir gehören
Ich muss zerstören
|
|
|
|
|
// Simulation of the Dynamics of a 2-Link Pan-Tilt Robotic Manipulator
/* This programme calculates the Velocity, Acceleration and the angles of inclination
of the two links of the Spherical Pointing Motor, which is essentially a Two-Link Robotic
Manipulator*/
//#include <basis.h>
//#include <assert.h>
//#include <string.h>
//#include <iostream.h>
//#include <iomanip.h>
//#include <fstream.h>
// Precompiler Directives
#include <math.h>
#include <stdlib.h>
/*
n = Number of Links = 2
m1 = Mass of the First Link (The Annulus)
m2 = Mass of the Second Link
r1 = Inner Radius of Link 1 (The Annulus)
r2 = Outer Radius of Link 1 (The Annulus)
ra = Outer Radius of the Annulus
rb = Inner Radius of the Annulus
l = Half the Lenght of Link 1
d = Displacement from the Centre of Mass
g = Acceleration due to gravity = 9.81
t = time in seconds
*/
// Constants Declaration
#define n (int) 2
#define m1 (float) 0.05
#define m2 (float) 0.03
#define r1 (float) 0.04
#define r2 (float) 0.06
#define ra (float) 0.04
#define rb (float) 0.06
#define l (float) 0.05
#define d (float) 0.02
#define acc_due_gravity (float) 9.81
#define h (double) 0.01;
// The Classes - Four in all.
class AngVel1 // For the first equation dQ1/dt
{
public:
AngVel1(); // Default Constructor
AngVel1(double om1); // The second and main constructor
double fn1 (double om1);
double RK1 (double y); // prototype for Runge-Kutta equation
private:
double InitialValue1;
};
// Function Definitions
double AngVel1 :: fn1 (double om1)
{
return om1;
}
double AngVel1 :: RK1(double y)
{
double k1,k2,k3,k4;
k1 = h*fn1(y);
k2 = h*fn1(y+(k1/2.0));
k3 = h*fn1(y+(k2/2.0));
k4 = h*fn1(y+k3);
return y+(k1/6.0)+(k2/3.0)+(k3/3.0)+(k4/6.0);
};
I am having this error (error C2100: illegal indirection) from lines 73,74,75 and 76 which are the four lines before the last line of code. Please, why am i getting this and how can I get it resolved?
Thanks for your answer.
SKG!
skg
|
|
|
|
|
first, change your #define to const float/int/ ( or better const double )
second, your #define h ends with a ; is that on purpose ?
|
|
|
|