Pat Murphy's Q&A profile
Visual Basic Type conversion problem
I'm using the .NET framework v1.1 and dominantly C#, but am having a problem with some VB code. First of all, I have a type: public class Field { object _fieldValue; private object FieldValue { get { return _fieldValue; } set { _fieldValue = value; } } public static implicit operator Field(string fromRawString) { Field untypedField = new Field(); untypedField.FieldValue = fromRawString; return untypedField; } } (Compiled using "csc /target:library MyType.cs") I then write a program to use this type: public class Klass { public static void Main() { string s = "Hello World"; Field f = s; } } (Compiled using "csc /r:MyType.dll MyProg.cs") I then write a similar program to use thi ...Show All
Visual C++ Two programs using one DLL
I hope this is the forum. I have two program that use the same DLL. I want to launch both program and debug one of the programs as it uses this DLL. I want a single copy of the DLL in memory so that when I debug into the DLL I can see the footprints both program left behind. How do I setup Visual Studio 2005 to do this Jeff Stout I have two programs (each running their own thread) using the same DLL. Right now, I have two solutions. The first program is a monitor program which watches the state of the DLL. The second program runs a state maching inside of the DLL. I lunch the first program from the desktop. I launch the second program from Visual C++ in debug mode. When I debug into the DL ...Show All
Microsoft ISV Community Center Forums WSD (Web Service For Device) code Generation Tool
Hi, I am currently involved in a project for implementing WSD on printers.WSD talks about a code generation tool. Where can I find that WSDCODEGEN.exe tool Thanks Biswanath ...Show All
SQL Server Is it reasonable that a table has 240 fields
Hi, I have 240 sensors to sample one time per second,then store the data in sql server. Is it reasonable that the table has 240 fields If do,it will generate about 70,000 records every day.One month records will be 2,100,000. If I divide the 240 sampling data into 10 records,every record has 24 fields.Then every day 700,000 records will generate.One month the record number is 21,000,000.It is terrible. Which method is better,or who can give me another better method or some suggestions. I need your help.Thank a lot. Yes,most of fields should be filled. I store these records just for query history records and display every sensor's line. But I have heard that many fields will lead the database system low efficiency ...Show All
Windows Forms inserting rownumbers in the Rowheader
Hello, Hopefully someone can help me out. I want to have rownumbers in my datagridView rowheader. I searched the internet already. A lot of people talk about handling the paint event but I can't find a good example in Visual C++ . Can somebody help me out with a good example or where I can find an example how to do it. I am working with DataGridView1 in my program. Thanks, Rodger private : System::Void dataGridView1_CellPainting(System::Object^ sender, System::Windows::Forms::DataGridViewCellPaintingEventArgs^ e) { if ((e->ColumnIndex==-1) && (e->RowIndex!=-1)) { StringFormat^ sf = gcnew StringFormat(); sf->Alignment = StringAlignment: ...Show All
Windows Search Technologies no UNC/Network support in WDS 3.01 X64?
Hi I've just installed the update to WDS on Windows XP X64 and to my horror/dissappointment I notice that UNC/Network support doesn't appear to be there for this version, so it appears X86 32bit only. Is this correct and if so is X64 UNC/network support planned and when Thanks Janson You are correct, there is currently no version of the UNC add-in for the 64-bit platform and will not be supported for the WDS 3.x product version. This functionality will be supported on the 64-bit platform in future versions of WDS. ...Show All
Visual Studio Rules in DSL Tools V1
Hello I tried to implement a mechanism to do some action when I add an element on the diagram. In an older thread, I read about Rules. I created a Rule which inherits from AddRule and added some code in the overwritten ElementAdded(...) method. To register this rule, I created a partial class named "GeneratedMetaModelTypes" and added the corresponding type. But it doesn't work, I also couldnt find any other partial class GeneratedMetaModelTypes... Is this not supported anymore in Version 1 Are there other possibilities to intercept the adding of an element Thanks for your reply! Best regards Christian Here is a sample from my model. I have two Rules [RuleOn(typeof(Connector), FireTime = TimeToFire.TopLevelCommit)] ...Show All
Visual Studio 2008 (Pre-release) video example not working
public Scene1() { this.InitializeComponent(); MediaPlayer player = new MediaPlayer(); player.Open(new Uri("pack://application:,,/rock.wmv")); VideoDrawing aVideoDrawing = new VideoDrawing(); aVideoDrawing.Rect = new Rect(100, 100, 100, 100); aVideoDrawing.Player = player; player.Play(); I took this from the msdn page but changed the Uri as I had added a .wmv to the project. All I get is a blank screen. Any help would be great - thanks Thank you PataraK the source for the MediaElement is not pack but just the rock.wmv as its and added resource. Even though its added I cannot just use rock.wmv from c# (when I tried I just got errors) so I used pack. Thank you for the reply I will n ...Show All
.NET Development Whats best Updateagram or Stored Procedure on passed XML dataset?
Hi, i have writen a webservice to accept a passed xml dataset from our clients server. The webservice will be called every X minutes and data passed. The clients server uses the Jade database and is remote to our servers. The dataset passed contains multiple tables I need to incoropate this to our SQL server, inserting, updating and deleted records as needed. as far as i can see there is a couple of ways to do it: method1: take the uploaded dataset insert into temporary tables run a stored procedure on temporary tables that will insert,update or delete into live tables as needed delete data from temporary tables wait for next dataset to be passed method2: take the uploaded dataset step thru dataset and live tables buil ...Show All
Windows Forms Using user control
Hi all, I built a keyboard user control that behaves like the windows calculator. I want to use my keyboard control when a textbox event happen in a certain form. The problem is : How to tell the user control to put the number I did to the textBox that called my keyboard control. How to make the communicatiob between the user control and the textbox. Best regards... 1. If the parent container has to communicate with the user control then the user control has to expose a property or a method for the parent container to set/call. 2. If the user control has to communicate something to the parent container or the class that instatiate the user control. You implement an event de ...Show All
Architecture OOP Design Question - Need an opinion...
I know there is no "100% correct" way to design the following but any suggestions or shared opinions would be appreciated: I want to create a Customer business entity. Should this Customer class only contain properties and simple validation or should it also contain all the business logic and CRUD functions Should I create a separate class called CustomerService that handles logic by passing around and working with the Customer entity Example: How to add a new Customer 1) All domain logic in one Customer object . Customer.Name = "Bla" Customer.Save OR 2) Customer object to hold properties and Service object to perform business logic. Customer.Name = "Bla" CustomerFactory.AddCu ...Show All
.NET Development send POST with certificates for ssl
Hi, I want to send a POST request to a webserver. I want to attach a certificate to the request so that it can be posted on a https site. After this POST the server will send a response, I want to be able to view that response. Any idea how to do it http://support.microsoft.com/Default.aspx kbid=895971 There are a lot of threads about this and what can go wrong. ...Show All
SQL Server What happens at midnight ?
Everyday at just gone midnight, my MSSQL server won't accept connections. About 25 minutes later, it seems to be OK. There's no third party backup software running on this machine which is MSSQL server aware. Has anyone any suggestions as to why this might be happening The client app trying to use the db reports 17/10/2006 00:02:04 Email2DBServer Cannot open database "Email2DB" requested by the login. The login failed. From OpenLocalDatabase and there's an entry in the event log Event Type: Failure Audit Event Source: MSSQL$EMAIL2DB Event Category: (4) Event ID: 18456 Date: 17/10/2006 Time: 00:02:04 User: NAVIGATOR-BATH\navigator-service Computer: NAVIGAT2A Description: Login failed for user 'NAVIGATOR-BATH\navigator ...Show All
Visual C# How to make global data thread safe ? Please Help...
Hi friends, I seem to be stuck in a peculiar problem. I have a public static class with public static members (different array lists). The members are thus global in nature and accessible across the namespace. I have a worker function which is called asynchronously (so that there are several instances running per second) and which reads the different global members at different points of execution (not the entire set at any one point). I have a writer function which is used to set the global members and this is the only one in the application writing to these variables. It will write the entire set of globals when given control through a GUI event. I need a mechanism where if one instance of worker function is accessing any ...Show All
Visual C# Is it possible to find the time taken to run the project file?
How can I find an exact timing taken for run the project files I am using devenv.exe to run the application. I need to hold the till the project gets run. Here is the code I had tried. Please help. foreach ( FileInfo file in d.GetFiles ( “*.csproj” ) ) { string Arg = string .Format ( "\"{0}\" /run /out \"{1}\"" , file.FullName, d.FullName + "\devenv.log" ); Process p = new Process(); p.StartInfo = new ProcessStartInfo( devLoc + @"\devenv.exe" ); p.StartInfo.Arguments = Arg; p.StartInfo.CreateNoWindow = true ; p.StartInfo.ErrorDialog = true ; ...Show All
