|
I'm not sure what that means, other than it is most likely the Windows internal name for the first serial port on the machine. You might find it beneficial to spend some time researching device driver development on MSDN. I don't know how much information is available there, but MSDN often contains a lot of clues about internal workings of the Windows system. If you can find them, of course. Try Google first.
"A Journey of a Thousand Rest Stops Begins with a Single Movement"
|
|
|
|
|
I am creating a web service that will be called from a console application. I am having trouble creating objects in the console application in order to pass them to the web service.
I have Classes in the Web Site project that are similar to the following:
public class Product
{
//other product details
}
public class SubProduct : Product
{
//subproduct details
public innerObject io;
}
public class innerObject
{
//object details
}
The web service contains a function:
[WebMethod]
public string LoadProduct(Product[] p)
{
//does stuff here
if (p is SubProduct)
{
//do stuff specific to subproduct objects.
}
}
I want the console application to create an array of products and pass it to the web service. Each product in the array could be of type Product or SubProduct. The problem I am encountering is that SubProducts and the innerObject types are not a recognized or accessible in the console application. It seems like all that is imported from the web reference to the web service are the objects types that are listed in the parameter list of the web service methods.
Does anyone know how I can make the SubProduct and innerObject classes accessible from the web service code?
thanks.
|
|
|
|
|
Check the wsdl file to see if there are any additional attribute tags specified on SubProducts.
Note: A WSDL file can be viewed by entering the web service path followed by ? and wsdl (e.g. www.site.com/webmethod?wsdl).
There's nothing left in my right brain and nothing right in my left brain. |
|
|
|
|
|
Hey guys
I had this at the quick answers section but I'm moving it here cause this is more of a discussion than a particular problem.
I've only recently started looking at the .Net asynchronous programming model and I feel that I more or less get the concept. I've started throwing together a server & client that works more or less... But stress testing it yielded very strange results. I think there's something to this asynchronous model that I don't see
By stress testing I mean I have a single client(when this works I'll do the same with multiple clients) that sends plain text messages in an infinite loop. The loop has a counter so each message looks like this: 1: My plain text message \r\n[char 3] , [char 3] being the packet terminator.
I have a 2nd client that receives the messages and just appends them to a TextBox.
Notes:
0) I am using TCP so the packages are guaranteed, right?
1) The server, for now, is just an echo server... I takes a message and sends it to every
connected client except the one it originated from
2) All 3 apps are done using the asynchronous model
Now when I run all these apps I get very strange results as mentioned before. I see packet 1, 2, 3, 27, 127. Then much later on ill see packet 9 appearing after packet 20000 for example. Some packets are missing characters and some are repeated several times. Quite often the client moans that the server forcibly closed the connection...
Nagy Vilmos answered my quick answers question and said
Nagy Vilmos wrote: If you are expecting high volume then the first thing to do is make sure your receiver takes the data off the inbound queue PDQ and puts it onto a call stack that you manage on a different thread.
A regular mistake is to process data directly from the TCP/IP pipe and expext the world to be sunny.
I really hope he sees this cause I'd like to pick his brain! But if not perhaps someone else can clarify...
By make sure your receiver takes the data off the inbound queue PDQ and puts it onto a call stack that you manage on a different thread I think he means to NOT process the data in the DataReceivedCallBack... Which makes sense I guess, cause while im processing a piece of data, 20 other pieces arrived and somewhere along the line something HAS to give in... can someone confirm this assumption?
He also mentions to put it in a call stack and process it on a different thread... So I'm assuming he means to just dump it in some variable to get it out of the read buffers as not to clog them and process it later... can someone confirm this assumption? An example would be nice, and I'm after efficiency, this server and the client code needs to be very scalable so please bare that in mind.
Another thing I was pondering was the read buffer sizes... How big do i make them? As far as i can see a small buffer would maybe need to make 5 or 6 callbacks(for arguments sake) for a single packet and callbacks are expensive so performance is lost. A Big buffer wont be fully utilized so alot of ram will be wasted. So the sweet spot would be to figure out how big your largest packet might be and make the read buffer that size...Once again I'm assuming all of this so if someone could confirm it that would rock.
I've googled high load tcp servers & clients in C# but I cant seem to find an article that explains it completely... Most of the time it just explain the .Net asynchronous programming model.
If someone could share some knowledge, experiences, tips, links to good articles or anything i would be really greatful. I really want to understand this and not just copy and paste some code.
Thanks for taking the time to read this, if you read this far you r0ck \m/
Harvey Saayman - South Africa
Software Developer
.Net, C#, SQL
you.suck = (you.Occupation == jobTitles.Programmer && you.Passion != Programming)
1000100 1101111 1100101 1110011 100000 1110100 1101000 1101001 1110011 100000 1101101 1100101 1100001 1101110 100000 1101001 1101101 100000 1100001 100000 1100111 1100101 1100101 1101011 111111
|
|
|
|
|
I am new to C# and VS2008. I am trying to create a report with a subreport. I have searched Google not to find a good example of how to create a report with a subreport. Does anybody have a good link for showing an example of this?
Thanks!
sk
|
|
|
|
|
I have a form (form1.cs) that sends a transaction record variable (TranRec) to a program (Transporter.cs) by calling it using Transporter.ConnectToDMV(TranRec);.
Transporter.cs does what it needs to do and returns to form1.cs for the user to enter and submit another transaction. Here's part of the Transporter.cs code.
Transporter.cs
public partial class Transporter
{
public static void ConnectToDMV(string TranRec)
{ rest of code processing TranRec ...
What I also need Transporter.cs to do is return a variable (logLU) back to form1.cs. For this I am using the following code;
Transporter.cs
Form1 aForm = new Form1();
aForm.SetValue(logLU);
form1.cs
public void SetValue(string luValue)
{
logLU = luValue;
// for testing purposes
MessageBox.Show("Here's the value of (form1)luValue: " + luValue);
MessageBox.Show("Here's the value of (form1)logLU: " + logLU);
}
I can see both variables in the messageboxes so I know logLU gets to form1.cs but then it returns to null when I need it in other parts of form1.cs. What am I missing??? Similar code works in other parts of my program but not here. BTW, I'm a newbie to C# and this is my first application.
Any advise will be very much apprecaited. 
|
|
|
|
|
Form1 aForm = new Form1();
aForm.SetValue(logLU);
Looks like you are creating a new Form1 everytime you set this value.
The new form will have the value, but any existing form will not.
Try making aForm a field instead of a local variable and assigning the value to the field version of aForm.
|
|
|
|
|
Thank you for your reply. (Remember newbie)
I think I tried that but had syntax issues. What would the code you recommend look like?
Thanx again!
|
|
|
|
|
At the top of your code define the form.
private Form1 aForm ;
Where you are going to open the form:
aForm = new Form1 ( ) ;
Do some stuff here...
When you want to return the value to the form:
aForm.SetValue ( logLU ) ;
When you are done with the form, dispose of it.
|
|
|
|
|
I end up with the same result. Although I had to do the following because the use of private generated an invlaid expression term 'private' error.
namespace DMV_Test_1
{
public partial class Transporter
{
public static void ConnectToDMV(string TranRec)
{
Form1 aForm;
Thanx for the suggestion.
|
|
|
|
|
You need to put it here, outside of any method. Then it will be available anywhere in the class.
namespace DMV_Test_1
{
public partial class Transporter
{
Form1 aForm;
public static void ConnectToDMV(string TranRec)
{
|
|
|
|
|
When I did that I got the following error on the two instances of aForm
An object reference is required for the non-static field, method, or property
aForm = new Form1();
aForm.SetValue(logLU);
Thanx for the suggestion.
|
|
|
|
|
Hi,
Change your method to return the value directly
public static void ConnectToDMV(string TranRec)
public static string ConnectToDMV(string TranRec)
Alan.
|
|
|
|
|
Tried that but it caused other problems in the code.
I fixed the problem by doing the following in form1.cs
namespace DMV_Access_App
{
public partial class Form1 : Form
{
public static string logLU;
public Form1()
{ Rest of form1.cs code ...
This took care of the problem. Seems so simple. Of course, being a newbie, I am not sure what ramifications there are but it does work. This is great forum!

|
|
|
|
|
As an example I have two categories in a property grid. One is read-only and the other is editable.
I use a timer to automatically update the properties in the read-only category, approximately every 100msec. However for the updated values in the read-only category to be displayed properly I have to do a PropertyGrid.Refresh() call. This moves the focus inside the property grid, so if I'm editing an editable property I lose my focus anytime the timer fires.
Is there a simple way to work around this?
|
|
|
|
|
Have you tried using the respective ActiveControl and SetFocus methods?
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Won't the ActiveControl always return the property grid? I'm losing focus within the property grid, not from the property grid.
|
|
|
|
|
Yeah, you're right.
I'm sort of guessing here; I misunderstood your original question. How about the SelectedGridItem property?
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
Yeah tried that. Didn't seem to do what I want.
|
|
|
|
|
I want to know if its possible to automate the System.Windows.Forms.WebBrowser and make it running in multiple threads.
I mean I want to login to say mysite.com , using 5 different accounts, Is it possible to do that simultaneously with 5 web browsers in 5 threads maintaining seperate sessions with the server of mysite.com,
Wont the sessions overlap with each other?
|
|
|
|
|
No, it's not. The WebBrowser will only work on the UI thread.
You don't need 5 seperate threads for this. Just 5 seperate WebBrowser controls.
indianbill007 wrote: Wont the sessions overlap with each other?
No.
|
|
|
|
|
Hi,
I am executing my windows application in Windows 7.
When i change the size of text to 125% or more, Window screen dosnt display properly.
|
|
|
|
|
I'd get a monitor that's 125% bigger.
CQ de W5ALT
Walt Fair, Jr., P. E.
Comport Computing
Specializing in Technical Engineering Software
|
|
|
|
|
ohhh thanks for the reply
pavan
|
|
|
|
|