|
Hi Eli,
Eli Nurman wrote: how is it possible to read the POST sent?
The only thing I can think of is that you'd have to have a server to receive responses from the clearing house.
Eli Nurman wrote: i think all clearing companies do so
I would've thought they send back some token as part of the response, allowing you to conduct an encrypted conversation in order to process the transaction. Much like a series of web service calls.
The "POST response" story seems odd to me, but that's just my opinion.
/ravi
|
|
|
|
|
Thanks Ravi
I guess so
but if there is a class that allows me to read the entire data that has send including headers and post data that can be useful to, no? and then analyze the post data into a dictionary
So if you know a tool that responses the entire received data from the "HTTP/1.1 200 OK" until the end of document please let me know.
Thanks
|
|
|
|
|
I think you want to use the Headers property of HttpWebResponse to get at the headers.
/ravi
|
|
|
|
|
Is it possible (probably by Windows Messages or API) to generate a Moving event for a form and get it's current rectangle so I can cancel the movement if outside the area I specify?
I've tried using the Move and LocationChanged events but they are only raised AFTER the move has taken place, not during.
I've had a browse around Google but with no success so far...
Dave
|
|
|
|
|
Hi,
there is a Form.LocationChanged event; its EventArgs does not offer a Cancel
property, so you would have to remember the old location and restore it, to undo
a move.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Thanks Luc, but I need to catch it whilst it's moving not afterwards. I'll do some more API investigating - there's gotta be a way hidden in there!
Dave
|
|
|
|
|
Hi,
if the available events don't suit your needs, you probably have to deal with
the actual Windows messages themselves, i.e. override the WndProc method,
and suppress all moves, as in
const int WM_MOVE = 0x0003;
protected override void WndProc(ref Message m) {
if (!m.Msg==WM_MOVE) base.WndProc(ref m);
}
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
WndProc is it - thanks. It's actually WM_MOVING (0x0216) that I need. Now, just gotta figure out how to cancel the move. I think I'm going to have to create a rectangle structure and use marshalling to overwrite the windows data. I think I can sort it from here.
Thanks Luc, I'll post back if I get stuck!
Dave
|
|
|
|
|
This code works (where LeftLimit, TopLimit etc... are ints that equal the limits that the form is allowed to move to).
private const int WM_MOVING = 0x0216;
[StructLayout(LayoutKind.Sequential)]
struct RectangleStructure
{
public int Left;
public int Top;
public int Right;
public int Bottom;
}
protected override void WndProc(ref Message m)
{
if (m.Msg == WM_MOVING)
{
RectangleStructure rectangle =
(RectangleStructure)Marshal.PtrToStructure(m.LParam, typeof(RectangleStructure));
if (rectangle.Left < LeftLimit)
{
rectangle.Right = LeftLimit + Width;
rectangle.Left = LeftLimit;
Marshal.StructureToPtr(rectangle, m.LParam, true);
}
if (rectangle.Top < TopLimit)
{
rectangle.Bottom = TopLimit + Height;
rectangle.Top = TopLimit;
Marshal.StructureToPtr(rectangle, m.LParam, true);
}
if (rectangle.Right > RightLimit)
{
rectangle.Left = RightLimit - Width;
rectangle.Right = RightLimit;
Marshal.StructureToPtr(rectangle, m.LParam, true);
}
if (rectangle.Bottom > BottomLimit)
{
rectangle.Top = BottomLimit - Height;
rectangle.Bottom = BottomLimit;
Marshal.StructureToPtr(rectangle, m.LParam, true);
}
}
base.WndProc(ref m);
Dave
modified on Monday, February 18, 2008 1:49 PM
|
|
|
|
|
Great. Thanks for posting the entire solution.
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
I thought this was a useful little excercise that i learnt a few things through (with your help) so I made a short article here[^] in case you want to have a look.
Many thanks,
Dave
|
|
|
|
|
Nice. I voted 5 lifting your average dramatically (I also reported a little bug [^]in
the average calculation, not showing any more since I casted my vote).
Luc Pattyn [Forum Guidelines] [My Articles]
This month's tips:
- before you ask a question here, search CodeProject, then Google;
- the quality and detail of your question reflects on the effectiveness of the help you are likely to get;
- use PRE tags to preserve formatting when showing multi-line code snippets.
|
|
|
|
|
Hi
I'm using CodeDom and I want it to generate code such as the following:
if (var is MyClass)
{
}
The code I am currently using to perform the generation is
CodeConditionStatement ifStatement = new CodeConditionStatement();
ifStatement.Condition = new CodeBinaryOperatorExpression(lhs,
CodeBinaryOperatorType.IdentityEquality, rhs);
this code will generate the below statement
if (var == MyClass)
{
}
All that needs to change is the ==, which needs to change to 'is'. Is this possible to do in CodeDom?
Also note that 'var' can also be a child class of MyClass (which is why I did not use var.GetType() == typeof(MyClass))
thanks
|
|
|
|
|
danielk_,
Dunno, why don't you type it and see what happens? Would be a lot quicker than waiting for an answer...
Regards,
Gareth.
|
|
|
|
|
AFAIK it's impossible to generate 'is' using CodeDom. You can try to use typeof(MyClass).IsInstanceOfType(var).
|
|
|
|
|
looks good. IsInstanceOfType should do the job
thanks
|
|
|
|
|
hi
is that anyWay to save html pages to database fully (with all images,styles,...) and retrieve & display it when we request it ?
thanks
|
|
|
|
|
Sure. You need to be able to store a zip or an arbitrary number of files, as you will have no idea how many images there will be.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
thanks for reply
no i don't make zip file, i want to search in it via FTS (full text search) or use Regular Expression in html text.
|
|
|
|
|
Press x-axis it (rotates around x-axis looks OK) // Button
Press y-axis it (rotates around y-axis looks OK) // button
Press z-axis it (rotates around z-axis looks OK) // Button
Press x-axis it (rotates around x-axis looks Bad) it is rotating on z-axis, Now you cannot predict how this is going to rotate it.
I checked the angles and I was unable to setValue in any sense. Please look the code.
Best regards
Agha Khan
<Window x:Class="Wpf3DTest.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="600" Width="600" WindowStartupLocation="CenterScreen">
<Window.Resources>
<MeshGeometry3D x:Key="UnitCube"
Positions="-0.5 0.5 0.5, 0.5 0.5 0.5,
-0.5 -0.5 0.5, 0.5 -0.5 0.5,
0.5 0.5 -0.5, -0.5 0.5 -0.5,
0.5 -0.5 -0.5, -0.5 -0.5 -0.5,
-0.5 0.5 -0.5, -0.5 0.5 0.5,
-0.5 -0.5 -0.5, -0.5 -0.5 0.5,
0.5 0.5 0.5, 0.5 0.5 -0.5,
0.5 -0.5 0.5, 0.5 -0.5 -0.5,
-0.5 0.5 -0.5, 0.5 0.5 -0.5,
-0.5 0.5 0.5, 0.5 0.5 0.5,
0.5 -0.5 -0.5, -0.5 -0.5 -0.5,
0.5 -0.5 0.5, -0.5 -0.5 0.5"
TriangleIndices=" 0 2 1, 1 2 3
4 6 5, 5 6 7,
8 10 9, 9 10 11,
12 14 13, 13 14 15
16 18 17, 17 18 19
20 22 21, 21 22 23"
TextureCoordinates=
"0.000 0, 0.167 0, 0.000 1, 0.167 1,
0.167 0, 0.333 0, 0.167 1, 0.333 1,
0.333 0, 0.500 0, 0.333 1, 0.500 1,
0.500 0, 0.667 0, 0.500 1, 0.667 1,
0.667 0, 0.833 0, 0.667 1, 0.833 1,
0.833 0, 1.000 0, 0.833 1, 1.000 1" />
<DiffuseMaterial x:Key="DMX0Y2Z0">
<DiffuseMaterial.Brush>
<VisualBrush RenderOptions.CachingHint="Cache">
<VisualBrush.Visual>
<UniformGrid Name="GNX0Y2Z0" Rows="1" Columns="6" Width="600" Height="100">
<Grid>
<!-- Front of the cube White -->
<Rectangle Fill="Gray" Stroke="Black"/>
<Rectangle Margin="5" RadiusX="5" RadiusY="5" Fill="Honeydew" />
</Grid>
<Grid>
<!-- Back hand side of the cube Yellow -->
<Rectangle Fill="Gray" Stroke="Black"/>
<Rectangle Margin="5" RadiusX="5" RadiusY="5" Fill="Yellow" />
</Grid>
<Grid>
<!-- Left hand side cube Blue -->
<Rectangle Fill="Gray" Stroke="Black"/>
<Rectangle Margin="5" RadiusX="5" RadiusY="5" Fill="Blue" />
</Grid>
<Grid>
<!-- Right side cube Green -->
<Rectangle Fill="Gray" Stroke="Black"/>
<Rectangle Margin="5" RadiusX="5" RadiusY="5" Fill="Chartreuse" />
</Grid>
<Grid>
<!-- Top side cube Red -->
<Rectangle Fill="Gray" Stroke="Black"/>
<Rectangle Margin="5" RadiusX="5" RadiusY="5" Fill="Red" />
</Grid>
<Grid>
<!-- Bottom side cube Cyan -->
<Rectangle Fill="Gray" Stroke="Black"/>
<Rectangle Margin="5" RadiusX="5" RadiusY="5" Fill="HotPink" />
</Grid>
</UniformGrid>
</VisualBrush.Visual>
</VisualBrush>
</DiffuseMaterial.Brush>
</DiffuseMaterial>
<GeometryModel3D x:Key="ReCubeX0Y2Z0"
Geometry="{StaticResource UnitCube}"
Material="{StaticResource DMX0Y2Z0}">
<GeometryModel3D.Transform>
<TranslateTransform3D OffsetX="-1.0" OffsetY="1.0" OffsetZ="-1.0" />
</GeometryModel3D.Transform>
</GeometryModel3D>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="100" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<DockPanel Grid.Column="0">
<StackPanel HorizontalAlignment="Stretch">
<StackPanel.Background>
<LinearGradientBrush>
<GradientStop Color="White" Offset="0"/>
<GradientStop Color="DarkKhaki" Offset=".3"/>
<GradientStop Color="DarkKhaki" Offset=".7"/>
<GradientStop Color="White" Offset="1"/>
</LinearGradientBrush>
</StackPanel.Background>
<Canvas >
<Button Name="simpleButton1" Canvas.Left="30" Canvas.Top="110" Click="RotateClickX">Rotate X</Button>
<Button Name="simpleButton2" Canvas.Left="30" Canvas.Top="150" Click="RotateClickY">Rotate Y</Button>
<Button Name="simpleButton3" Canvas.Left="30" Canvas.Top="190" Click="RotateClickZ">Rotate Z</Button>
</Canvas>
</StackPanel>
</DockPanel>
<DockPanel Grid.ColumnSpan="2">
<ScrollBar Name="horz" DockPanel.Dock="Bottom" Orientation="Horizontal"
Minimum="-180" Maximum="180"
LargeChange="10" SmallChange="1" />
<ScrollBar Name="vert" DockPanel.Dock="Right" Orientation="Vertical"
Minimum="-180" Maximum="180"
LargeChange="10" SmallChange="1" Width="17" />
<Viewport3D Name="viewport3d">
<ModelVisual3D x:Name="CUBEX0Y2Z0" Content="{StaticResource ReCubeX0Y2Z0}"/>
<!-- Light sources. -->
<ModelVisual3D>
<ModelVisual3D.Content>
<Model3DGroup>
<AmbientLight Color="White" />
<DirectionalLight Color="White" Direction="2, -3 -1" />
</Model3DGroup>
</ModelVisual3D.Content>
</ModelVisual3D>
<!-- Camera. -->
<Viewport3D.Camera>
<PerspectiveCamera Position="-3 3 8"
LookDirection="3 -3 -8"
UpDirection="0 1 0"
FieldOfView="60">
<PerspectiveCamera.Transform>
<Transform3DGroup>
<RotateTransform3D>
<RotateTransform3D.Rotation>
<AxisAngleRotation3D Axis="1,0,0" Angle="{Binding ElementName=vert, Path=Value}" />
</RotateTransform3D.Rotation>
</RotateTransform3D>
<RotateTransform3D>
<RotateTransform3D.Rotation>
<AxisAngleRotation3D Axis="0,1,0" Angle="{Binding ElementName=horz, Path=Value}" />
</RotateTransform3D.Rotation>
</RotateTransform3D>
</Transform3DGroup>
</PerspectiveCamera.Transform>
</PerspectiveCamera>
</Viewport3D.Camera>
</Viewport3D>
</DockPanel>
</Grid>
</Window>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using System.Windows.Media.Animation;
using System.Windows.Media.Media3D;
namespace Wpf3DTest
{
public partial class Window1 : Window
{
public Window1()
{
InitializeComponent();
AxisAngleRotation3D RotationX = new AxisAngleRotation3D();
RotationX.Axis = new Vector3D(1, 0, 0);
RotationX.Angle = 0;
Transform3D t3d = new RotateTransform3D(RotationX);
Transform3DGroup transformGroup = new Transform3DGroup();
transformGroup.Children.Add(t3d); //X
AxisAngleRotation3D RotationY = new AxisAngleRotation3D();
RotationY.Angle = 0;
RotationY.Axis = new Vector3D(0, 1, 0);
t3d = new RotateTransform3D(RotationY);
transformGroup.Children.Add(t3d); //Y
AxisAngleRotation3D RotationZ = new AxisAngleRotation3D();
RotationZ.Angle = 0;
RotationZ.Axis = new Vector3D(0, 0, 1);
t3d = new RotateTransform3D(RotationZ);
transformGroup.Children.Add(t3d); //Z
int c = transformGroup.Children.Count;
CUBEX0Y2Z0.Transform = transformGroup;
}
private void RotateClickX(object sender, RoutedEventArgs e)
{
DoubleAnimation da = new DoubleAnimation();
da.By = 90;
da.Duration = new Duration(new TimeSpan(0, 0, 0, 0, 500));
double CurrentValue = (double)((RotateTransform3D)((Transform3DGroup)CUBEX0Y2Z0.Transform).Children[0]).Rotation.GetValue(AxisAngleRotation3D.AngleProperty);
if (CurrentValue >= 360.0)
{
CurrentValue %= 360;
((RotateTransform3D)((Transform3DGroup)CUBEX0Y2Z0.Transform).Children[0]).Rotation.SetValue(AxisAngleRotation3D.AngleProperty, CurrentValue);
}
AxisAngleRotation3D Rotation = (AxisAngleRotation3D)((RotateTransform3D)((Transform3DGroup)CUBEX0Y2Z0.Transform).Children[0]).Rotation;
if (Rotation.Angle >= 360)
Rotation.Angle = CurrentValue;
Rotation.BeginAnimation(AxisAngleRotation3D.AngleProperty, da);
}
private void RotateClickY(object sender, RoutedEventArgs e)
{
DoubleAnimation da = new DoubleAnimation();
da.By = 90;
da.Duration = new Duration(new TimeSpan(0, 0, 0, 0, 500));
double CurrentValue = (double)((RotateTransform3D)((Transform3DGroup)CUBEX0Y2Z0.Transform).Children[1]).Rotation.GetValue(AxisAngleRotation3D.AngleProperty);
if (CurrentValue >= 360.0)
((RotateTransform3D)((Transform3DGroup)CUBEX0Y2Z0.Transform).Children[1]).Rotation.SetValue(AxisAngleRotation3D.AngleProperty, 0.0);
AxisAngleRotation3D Rotation = (AxisAngleRotation3D)((RotateTransform3D)((Transform3DGroup)CUBEX0Y2Z0.Transform).Children[1]).Rotation;
Rotation.BeginAnimation(AxisAngleRotation3D.AngleProperty, da);
}
private void RotateClickZ(object sender, RoutedEventArgs e)
{
DoubleAnimation da = new DoubleAnimation();
da.By = 90;
da.Duration = new Duration(new TimeSpan(0, 0, 0, 0, 500));
double CurrentValue = (double)((RotateTransform3D)((Transform3DGroup)CUBEX0Y2Z0.Transform).Children[2]).Rotation.GetValue(AxisAngleRotation3D.AngleProperty);
if (CurrentValue >= 360.0)
((RotateTransform3D)((Transform3DGroup)CUBEX0Y2Z0.Transform).Children[2]).Rotation.SetValue(AxisAngleRotation3D.AngleProperty, 0.0);
AxisAngleRotation3D Rotation = (AxisAngleRotation3D)((RotateTransform3D)((Transform3DGroup)CUBEX0Y2Z0.Transform).Children[2]).Rotation;
Rotation.BeginAnimation(AxisAngleRotation3D.AngleProperty, da);
}
}
}
|
|
|
|
|
When you rotate an object, all the axis move. So, when you rotate around the X again, the X is not where it was.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Dear Christian Graus:
Forgive me my ignorance; I am rotating only one axis Not all (As I see it) . I think change is very small in code. Is this possible for you to guide me how to fix this problem? I would like to rotate only on desire axis about 90 degree from previous location. You help will be very much appreciated. It is blocking issue for me.
Best regards
|
|
|
|
|
Graphics g = Graphics.FromHwnd(listView.Handle);
...???
how to make a Bitmap object to copy from g?
chesnokov
|
|
|
|
|
There are many articles on doing screenshots, but I thought controls had a general method you could call that draws them onto a graphics object you provide.
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
Hi Guy
why u r try get from the graphics?
try like this
Bitmap s = Bitmap.FromResource(listview.Handle);
i hope this is help to u.
|
|
|
|
|