|
can't stay away for more than 8 minutes, can you?
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc Pattyn wrote: can't stay away for more than 8 minutes, can you?
Hey Luc,
See here[^]
and here[^]
So long dude.
|
|
|
|
|
Exactly, that[^] and your above message are 8 minutes apart.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Luc Pattyn wrote: and your above message are 8 minutes apart.
That time is the original post, I modified it twice, see where I say "I just changed my mind".
|
|
|
|
|
I see. I never mind the "modified at..." message that gets added automatically, it uses Bujumbura local time or something similar, doesn't tell me much.
In the mean time, you're still here. Which is great.
BTW: if and when the new be-really-kind rules would really cripple you, you can always put a leaded answer in one of the soapboxes/back rooms, and just reply with a link to it.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Well, "it works" would mean that the unit test does the following:
* Write a value to the registry via the wrapper
* Read a value from the registry via the wrapper
* Assert that the value read is equal to the value written
So the fact that these values don't appear in the registry confuses me too and I'm inclined to agree that it appears to be not working, hence i posted here. :P
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Hi,
I would guess you're running on Vista or higher, which virtualizes all registry hives but current_user when running below elevated admin level, whereas your installer (and your unit tests?) probably runs as elevated admin and creates and uses the proper keys.
A regular user is not supposed to modify local_machine keys, since they extend beyond his realm.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
Yes, I'm on vista.
What effect will this have if i shutdown and re-start? Does the registry for my local machine get burned?
Is there any way around this without admin rights?
-------------------------------
Carrier Bags - 21st Century Tumbleweed.
|
|
|
|
|
Tristan Rhodes wrote: without admin rights?
use current_user.
Luc Pattyn [Forum Guidelines] [My Articles]
The quality and detail of your question reflects on the effectiveness of the help you are likely to get.
Show formatted code inside PRE tags, and give clear symptoms when describing a problem.
|
|
|
|
|
|
Hello Mahesh,
Before I forget, "waana" is not an english word.
ksss_maheshece wrote: include that file in my webfrom
Not sure what that means but perhaps you want to have an XML Data Island.
|
|
|
|
|
led mike wrote: Not sure what that means but perhaps you want to have an XML Data Island.
Shouldn't that be "waana have an XML Data Island"?
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
What up!
Hey while I have your attention, what's the deal with the HOW TO ANSWER A QUESTION? Does it mean the monkeys have taken control of this site and I am no longer welcome?
|
|
|
|
|
led mike wrote: what's the deal with the HOW TO ANSWER A QUESTION?
Beats me. I voted to have it removed
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
Mark Salsbery wrote: I voted to have it removed
No you didn't, in this forum anyway. I just did!
So I guess I'll see how it goes but I may have to stop using CP because I'm not inclined to put up with any monkeyshit.
No I just changed my mind, stuff it, I'm outahere. Good luck dude, it's been fun.
modified on Wednesday, July 22, 2009 12:58 PM
|
|
|
|
|
Hi,
I use the XmlSerializer and I'm looking for a way to set the default XML namespace on the top level Element. The correct way to do this, I hoped, was to specify this in an XmlType attribibute on the top level class. However, the namespace is only applied to the children of this class. For example, see the C# code below that serializes a simple nested structure:
public class Circle
{
}
[XmlType(Namespace="http://mbshapes.com")]
public class Shapes
{
private Circle _circle = new Circle();
public Circle Circle
{
get
{
return _circle;
}
set
{
_circle = value;
}
}
}
public class SerializeTest
{
public static void Serialize()
{
Shapes shapes = new Shapes();
using (TextWriter textWriter = new StreamWriter("Shapes.xml"))
{
XmlSerializer xmlSerializer = new XmlSerializer(typeof(Shapes));
xmlSerializer.Serialize(textWriter, shapes);
}
}
}
The output is this:
<?xml version="1.0" encoding="utf-8"?>
<Shapes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Circle xmlns="http://mbshapes.com" />
</Shapes>
What I expected (and what I need), is something like this:
<?xml version="1.0" encoding="utf-8"?>
<Shapes xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://mbshapes.com">
<Circle />
</Shapes>
Am I doing something wrong? Or are there any work-arounds?
Thanks.
|
|
|
|
|
Try
[<code>XmlRoot</code>(Namespace = "http://mbshapes.com")]
public class Shapes
{
private Circle _circle = new Circle();
public Circle Circle
{
get
{
return _circle;
}
set
{
_circle = value;
}
}
}
Mark Salsbery
Microsoft MVP - Visual C++
|
|
|
|
|
That worked, thank you very much !
|
|
|
|
|
actually i am making a website,i have a problem with break point.
Following solution is not suitable for me because i am not gatting project menu.
project-> property->build
tell me the solu tion if u have please.
|
|
|
|
|
Check it here ![^]
Education is not a way to escape poverty — it is a way of fighting it.
|
|
|
|
|
I have datagridview control and one of its column I hav added DataGridViewLinkColumn.
If I click DataGridViewLink of any particular row of datagridview I want to change dynamicaly the Text property of DataGridViewLinkColumn for that Row only.
my code is like this
//I have set DataGridViewLinkColumn.Text="view" in design property
DataGridViewLinkColumn.Text="view"
//after clicking the link I want to change the text of link for that row only
DataGridViewLinkColumn.CurrentRow.Cells[2].Value="hide"
but problem is that text remain unchanged.
I dont want "view" ,I want "hide"
can any one guide me plz in c# and window application
regards
tarak
|
|
|
|
|
Try using the Value property of the cell instead of the Text property of the column. Maybe not the best answer, but it produces the behaviour I think you're after.
Like so...
private void Form1_Load(object sender, EventArgs e)
{
DataGridViewLinkColumn col = new DataGridViewLinkColumn();
dataGridView1.Columns.Add(col);
for (int i = 0; i < 4; i++)
{
DataGridViewRow dr = new DataGridViewRow();
dataGridView1.Rows.Add(dr);
}
for (int i = 0; i < 4; i++)
dataGridView1.Rows[i].Cells[0].Value = "view";
}
private void dataGridView1_CellClick(object sender, DataGridViewCellEventArgs e)
{
dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex].Value = "hide";
}
|
|
|
|
|
Hi ,
I have a problem with print in crystal report using VS2003.
[CODE]
CrystalRpt rptdoc = new CrystalRpt();
System.Drawing.Printing.PrintDocument printDocument = new System.Drawing.Printing.PrintDocument);
rptdoc.PrintOptions.PrinterName = printDocument.PrinterSettings.PrinterName;
rptdoc.PrintToPrinter(1, true, 0, 0);
[/CODE]
CrystalRpt is the crystalreport that I use.
when user clicks cancel in the print dialogbox that appears, it throws the error.
Please find the stack trace below:
************** Exception Text **************
CrystalDecisions.CrystalReports.Engine.InternalException: Error in File C:\DOCUME~1\RAKESH~1.RED\LOCALS~1\Temp\temp_d047ddc7-9297-4a24-a03f-11f21917120a.rpt:
Request cancelled by the user.
at .I(String , EngineExceptionErrorID )
at .D(Int16 , Int32 )
at .C(Int16 )
at CrystalDecisions.CrystalReports.Engine.FormatEngine.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)
at CrystalDecisions.CrystalReports.Engine.ReportDocument.PrintToPrinter(Int32 nCopies, Boolean collated, Int32 startPageN, Int32 endPageN)
at SampleCrystal.Form1.btnPrint_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr
********************************************************************************
**********
When I implement the same code using VS2008, i dont get the error.I found it specific in VS2003.
Thanks in advance.
Rakesh Reddy
|
|
|
|
|
Most people use 96 DPI, but occasionally people set this to 120 DPI (or even higher), especially with high resolution monitors that display at greater than 100 DPI. This number is easy to get under Win32 ("LogPixels") and I've done it for years. But I'm relatively new to .NET and haven't been able to find out what .NET API delivers this number. This is such an important parameter that there must be a simple API to get it under .NET. Does anyone know what it is? This is especially important from Vista onward which doesn't believe in physical pixels, but merely device independent units.
Matthew MacDonald's Pro WPF in C# 2008, chapter 1, has a good discussion of device independent DPI scaling but nowhere does he say how to obtain this crucial number. I need the number because I have to scale the numbers that come back from the monitor enumeration, which specifies, x,y, height, and width, to fill the screen with a bitmap. All these numbers have to be scaled back by a factor 96/x, where x is the DPI Scaling number.
If worse comes to worse, I'll use Interop services to get the number, but I cringe every time I do that, thinking that I've just missed something in .NET.
Addendum: I can also get this number from the Registry: [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontDPI]"LogPixels" but that's even more of a hack than Interop Services. The cleanest way would be through a .NET API.
modified on Monday, July 20, 2009 12:36 PM
|
|
|
|
|
Graphics g = this.CreateGraphics();
MessageBox.Show(g.DpiX.ToString() + Environment.NewLine + g.DpiY.ToString());
g.Dispose();
g = null;
this is a Form in the above snippet
|
|
|
|