|
Looks like our Fax Server is not working. I will let you know once it's back up.
Thanks again for your help!
|
|
|
|
|
Ok, The server is up and working. Here's my code:
private void GenerateFax(string outputDirectory, string subject, string faxServer, string account, string files, string phone)
{
StringBuilder executeString = new StringBuilder();
executeString.Append("SubmitFax /S " + faxServer);
executeString.Append(" /U " + account);
executeString.Append(" /R " + phone);
executeString.Append(" /O " + outputDirectory);
executeString.Append(" /B " + subject);
executeString.Append(" /A" + files);
executeString.Append(" /C NO COVER PAGE");
Process process = new Process();
process.StartInfo.FileName = @"C:\FaxPressExe\SubmitFax.exe";
process.StartInfo.Arguments = executeString.ToString();
process.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
process.Start();
}
Now when I run it I receive this error:
The instruction at "0x73dd442d" referenced memory at "0x00c99805". The memory could not be "read"
Any ideas?
-- modified at 11:27 Thursday 6th April, 2006
|
|
|
|
|
You forget to replace:
executeString.Append("SubmitFax /S " + faxServer);
with this:
executeString.Append("/S " + faxServer);
"SubmitFax" is being submitted as a parameter, so it need removing (as above).
Anyway, it sounds like it's running the process as it returned an error.
Graham
|
|
|
|
|
Hi everybody!
I'm new on C# programming. I have a main form in my Windows applications that contains other form as a Explorer of folders. I don't want to allow to drag the Explorer form (FrmExplorer). FrmExplorer has a TreeView. I have been looking for information about it and have written the following code:
public partial class FrmExplorer : Form
{
public FrmExplorer(string fileName)
{
InitializeComponent();
this.QueryContinueDrag += new System.Windows.Forms.QueryContinueDragEventHandler(this.FrmExplorer_CancelDrag);
}
private void FrmExplorer_CancelDrag(object sender, QueryContinueDragEventArgs e)
{
e.Action = DragAction.Cancel;
}
}
I have set the method FrmExplorer_CancelDrag in FrmExplorer Properties in the event QueryContinueDrag. But I still cannot reach the method FrmExplorer_CancelDrag when dragging the form to cancel that action.
Does anybody can help me to know what I'm doing wrong or what is it missing?
Thanks a lot in advance,
Elvia
|
|
|
|
|
Hi,
How can i recognise/detect barcode type ?
I see alot of posts about creating barcode image and so on but I havent seen any code that recognise barcode type, any help?
Thanks.
|
|
|
|
|
Usually the barcode reader converts the barcode into either keypresses or serial (RS232) data.
Gary
Flickr Photos[^]
|
|
|
|
|
Yes but how to recognise string that i got from barcode reader
lets say we have string that says: 0075678164125, but what type of barcode is this is it code 39 ean or upc ... ?
|
|
|
|
|
I'm reading a value from an ini file, ultimately by pinvoking GetPrivateProfileString from kernal32.dll. THe issue is that I want to be able to read a multiline value from one setting. I tried entering the value in the ini like this "multilineValue = line1 \n line2 \n line3", but when I read it from the file and look at it in debug I get '@"line1 \n line2 \n line3"' and the \n's are treated as string literals instead of control chars when I write the value out.
|
|
|
|
|
You can replace that character combination with a newline:
str = str.Replace("\\n", Environment.NewLine);
---
b { font-weight: normal; }
|
|
|
|
|
I have an xml file and I am trying to use selectnodes with an xpath expression which is not working. After trial and error I found that the xml file has this rootnode <batchRequest onError="exit" xmlns="urn:oasis:names:tc:DSML:2 :core"> and it is getting thrown off with the attribute xmlns. If I remove the xmlns attribute the xpath works fine. The xml file is a DSML message that I am receiving from another application.
Is this a bug or some limitation of the xpath? Does xpath has any limitations when it sees an xmlns attribute? Can any one suggest a workaround with this problem.
|
|
|
|
|
Please don't cross post.
BanjaraBoy wrote: Is this a bug or some limitation of the xpath?
Neither.
You either have to specify the namespace prefix in the xpath expression, or use an XmlNamespaceManager, to access the nodes in the namespace.
---
b { font-weight: normal; }
|
|
|
|
|
|
I have no problems sending a soap header in my call but how do i read the soap header response. This is using the proxy generated class I modified it to send the header info.
Heres an excerpt of what i have:
<br />
private SessionInfo objHeader = null;<br />
<br />
[System.Web.Services.Protocols.SoapHeader "sessionObject",Direction=SoapHeaderDirection.Out)]<br />
[System.Web.Services.Protocols.SoapRpcMethodAttribute("execute", RequestNamespace=_RequestNS, ResponseNamespace=_RequestNS)]<br />
[return: System.Xml.Serialization.SoapElementAttribute("result")]<br />
public string execute(string sql) <br />
{ <br />
object[] results = this.Invoke("execute", new object[] {sql});<br />
return ((string)(results[0]));<br />
}<br />
The sessionObject is a property that set's the private objHeader. How in the world do i read the header coming back from the soap call
This is what the header object looks like:
<br />
[XmlRoot("SessionInfo")]<br />
public class SessionInfo : SoapHeader<br />
{<br />
<br />
[XmlAttribute("xmlns")]<br />
public string xmlns=@"http://www.aspconverters.com/SessionInfoHeader";<br />
<br />
[XmlElement(ElementName="SESSION_USER")]<br />
public string SESSION_USER = "";<br />
<br />
[XmlElement(ElementName="SESSION_ID")]<br />
public string SESSION_ID = "";<br />
<br />
[XmlElement(ElementName="SESSION_SIGNATURE")]<br />
public string SESSION_SIGNATURE = "";<br />
<br />
[XmlElement(ElementName="messageID")]<br />
public string messageID = "";<br />
<br />
[XmlElement(ElementName="id")]<br />
public string id = "";<br />
}<br />
|
|
|
|
|
Is there some way anyone knows to clear out the handlers for an event? An object I've created needs to clear all handlers to it at a point in the code where it is unknown what is attached to it.
You can't just set the event to null , the compiler complains about that. I've also tried the following to no effect:
...
if (MyEvent != null)
{
Delegate[] delegateList = MyEvent.GetInvocationList();
foreach (MyEventHandler meh in delegateList)
{
MyEvent -= meh;
}
}
...
I thought it showed promise (the compiler didn't complain, and it did run fine) - unfortunately it simply didn't do anything.
I've also tried some variations to the above, using the normal way of decoupling from an event, but by trying some of the values of the delegate to get the method:
...
if (MyEvent != null)
{
Delegate[] delegateList = MyEvent.GetInvocationList();
foreach (MyEventHandler meh in delegateList)
{
MyEvent -= new MyEventHandler(meh.Method);
}
}
...
- but the Delegate.Method property (as well as it's properties) don't seem to contain the right value wanted (the compiler makes noise about the fact that a property is being passed in to the handler instead of a method).
I think I'm on the right track, but seem to be missing some key element to make it work. Anyone have any ideas?
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
Vineas wrote: ...
if (MyEvent != null)
{
Delegate[] delegateList = MyEvent.GetInvocationList();
foreach (MyEventHandler meh in delegateList)
{
MyEvent -= new MyEventHandler(meh.Method);
}
}
Try using:
if (MyEvent != null)
{
Delegate[] delegateList = MyEvent.GetInvocationList();
foreach (MyEventHandler meh in delegateList)
{
MyEvent -= meh;
}
]
Basically your trying to remove a delegate that you've only just created, me thinks, what you need is a reference to the actual delegate as the above code demonstrates.
Ed
|
|
|
|
|
Ed.Poore wrote: Try using:
if (MyEvent != null)
{
Delegate[] delegateList = MyEvent.GetInvocationList();
foreach (MyEventHandler meh in delegateList)
{
MyEvent -= meh;
}
}
Basically your trying to remove a delegate that you've only just created, me thinks, what you need is a reference to the actual delegate as the above code demonstrates.
Ed
uh - did you read my initial post?!?!?!? That is exactly the first code snippet I listed (which does not work BTW - which then prompted me to continue to the other snippet, which also didn't work).
I still haven't found a solution to this. Some of the things I've found when searching around seem to indicate that others have tried and failed - so in the interest of brevity (and better code), for my own purposes, I re-did the section in question so am no longer facing this issue.*
I am still interested in a solution though - there have been other times I've wanted to do this, but haven't had the time to go much further - and from my searches I know others have wanted a solution as well.
* in case anyone was wondering why this was needed to begin with - some code I wrote a while ago was doing a deep copy on some different objects by doing a MemberwiseClone(), then selectively doing deep copies on reference types in that object. This worked OK until I recently found that during the MemberwiseClone() call, an event from a base object was bringing all it's handlers with it when copied. D'oh! I wanted a way to clear out the event after copying - but it was better to rewrite the copy code to work correctly than to continue with a bad idea implemented because of a time crunch.
-----
In the land of the blind, the one eyed man is king.
|
|
|
|
|
Sorry I was a bit quick in reading your post
I've had a brief look into this (which I neglected to do earlier and it seems that there is no easy or at least obvious way around this).
I'll take a look later because you have me intrigued now.
Ed
|
|
|
|
|
I have an MDI Parent form with some toolbars docked to all four sides. I found the MDIClient control in its Controls collections, then I removed it and replaced it with a SplitContainer, placing the MDIClient control in Panel1. In Panel2, I placed another control. The SplitContainer is oriented so that Panel1 is above Panel2, so it appears as though the MDIClient control is now above the control in Panel2 (just like VS2005 appears with one form docked at the bottom).
My problem is this:
The SplitContainer appears to be partially hidden by the toolbars that were already on the MDI Parent form.
Any suggestions/ideas???
|
|
|
|
|
I have several labels on a panel that I am using the MouseDown event to start drag and drop processes. this is fine, but I also need to have a DoubleClick event on the labels. the problem is that the mousedown event prevents the doubleclick from firing. The double click is an overloaded panel DoubleClick event. Something like this:
private void lbItems_MouseDown(object sender, MouseEventArgs e)
{
lbItems.DoDragDrop(lbItems.Items[lbItems.SelectedIndex].ToString(), DragDropEffects.Copy | DragDropEffects.Move);
}
private void pnlImageBorder_DragEnter(object sender, DragEventArgs e)
{
e.Effect = DragDropEffects.Move;
}
private void pnlImageBorder_DragDrop(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(typeof(Label)))
{
Label label = (Label)e.Data.GetData(typeof(Label));
label.Location = pnlImageBorder.PointToClient(new Point(e.X, e.Y));
}
else
{
Point locPoint = pnlImageBorder.PointToClient(new Point(e.X, e.Y));
placeLabel(locPoint);
}
}
void Form1_MouseDown(object sender, MouseEventArgs e)
{
if (sender is Label)
{
Label label = (Label)sender;
pnlImageBorder.DoDragDrop(label, DragDropEffects.Move);
}
}
private void pnlImageBorder_DragOver(object sender, DragEventArgs e)
{
if (e.Data.GetDataPresent(typeof(Label)))
{
Label label = (Label)e.Data.GetData(typeof(Label));
label.Location = pnlImageBorder.PointToClient(new Point(e.X, e.Y));
}
}
private void pnlImageBorder_Paint(object sender, PaintEventArgs e)
{
DoPage(e.Graphics, ForeColor, pnlImageBorder.ClientSize.Width, pnlImageBorder.ClientSize.Height);
base.OnPaint(e);
}
protected void pnlImageBorder_DoubleClick(object sender, EventArgs e)
{
if (sender is Label)
{
MessageBox.Show("label");
}
else
{
MessageBox.Show("not label");
}
}
So as you can imagine mousedown event superceeds the double click.
Thanks in advance
cbeasle1
|
|
|
|
|
Don't start a drag and drop sequence (via DoDragDrop) until the user has mouse down and has moved the mouse position a certain number of pixels in either direction.
Tech, life, family, faith: Give me a visit.
I'm currently blogging about: How 'bout a little guitar now?
The apostle Paul, modernly speaking: Epistles of Paul
Judah Himango
|
|
|
|
|
How can I get the number of pixils the mouse has moved? The only thing I have found relative to this is SystemInformation.DragSize, but I do not think that is exactly it. I am assuming you mean that I should have a drag distance conditional inside the mousedown event before calling the DoDragDrop call.
Thanks again.
cbeasle1
|
|
|
|
|
DragSize is the constant value maintained by the operating system indicating how many pixels the mouse must move before it is considered a drag operation.
Set a flag in your mouse down event that the mouse is down, and log the location of the mouse. Inside the MouseMove event, check and see if the mouse is still down. If it is, compare its position to the original mouse down location. If that distance between the current mouse location and the original mouse down location constitutes a move, then you can call DoDragDrop.
|
|
|
|
|
hi every body
we can use very simple way for soulution:by(e.Clicks = 1)
Private Sub pbBook_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles pbBook.MouseDown
If e.Button = Windows.Forms.MouseButtons.Left AndAlso e.Clicks = 1 then
Me.DoDragDrop(str, DragDropEffects.Copy)
End If
|
|
|
|
|
Hi.
I am wondering how one goes about letting a user of a Windows forms app select a certain file at a certain location and then the application does whatever with the file.
What I am refering to is similar to what we see when we are attaching files in an email, one presses a button and then a dialog box opens that enables the user to browse to a certain location and select a file that is then attached to the email. I would like to know how one can get the app to work with the file chosen by the user at some location on his/her computer?
Thanks,
F
|
|
|
|
|
Look into the OpenFileDialog class on MSDN.
When you call the ShowDialog function, a browse dialog appears. You can set filters, default directory, ...
Hope this helps.
Coulda, woulda, shoulda doesn't matter if you don't.
|
|
|
|