Stem_penguin's Q&A profile
.NET Development C# Com Interop problem - should be simple!
I have some trivial vb6 sample code that uses a com dll to interface to talk to some hardware but I can't seem to port it over to C# Interop successfully. I have tried many permutation of marshalling attributes but I get a "Attempted to read or write protected memory..." exception with types I believe will work and DataTypeError returned from the com interface function if I am deliberately incorrect with the types. The com interface declaration in OLE Viewer: long RpcCall(long iJobCode, VARIANT SendData, [in, out] VARIANT * RecvData); The sample in vb6: Dim n() as Byte Dim r() as Long n = StrConv("Time_s" & vbNullChar, vbFromUnicode) conn.RpcCall(10012, n, r) The intero ...Show All
.NET Development Wrting all XML data to txt file??
I have a listbox with some xml files listed instead of reading each one at a time and displaying the values i need in some textbox controls i wanted to know if someone could lead me in the direction so that i can loop though all the xml doc and write the data i need from each one...The data i need does not change from document to document...This is what i had so far but this is not correct....Any help string [] thefile = listBox2.SelectedItems; FileStream fs = new FileStream("c:\\maninfo.txt", FileMode.Create); StreamWriter sw = new StreamWriter(fs); if (thefile.Substring(thefile.Length-3,3).ToLower() == "man") { XmlDocument xd = new XmlDocument(); xd.Load(thefile); Messag ...Show All
SharePoint Products and Technologies How to build a custom list form with SharePoint Designer with attachment support
When I Build a custom list form through Sharepoint Designer 2007, I don't have any support for displaying attachments. Of course this list has been enabled for attachments. I am currently running WSS V3 FR + Sharepoint Designer 2007 FR. Regards, Hi, i'm having the same problem. so I cannot save the attachment. Anyone else has found a solution Thanks ...Show All
Visual Basic How do you make the enter key work like the tab key?
I have a simple application with a windows form that has multiple controls. I want the enter key to move the focus to the next control on the form (Just like if tab were pressed). How do I do this I can't find the override. Actually, to be more specific, I want the enter key to move to the next control on the form only if the current control is an edit control and is not empty. Oh, this is VB 2003/2005. Thanks for any help, Scott Is this a school assignment somewhere Asked already: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=907116&SiteID=1 ...Show All
Visual Basic Checking if drive exist
I got a few questions, maybe you might be able to help. I am needing to design a program that will check for a problem with another pc in my local network. We are not running a server type enviroment, but just a simple peer to peer platform. Any how on to the problem, We use one pc to act as a server, and the hard drives use a raid controller using 1(mirror). We ran into a snaffou yesterday, because no one in that building monitors thier pc's, they just use them, anyhow the raid broke and created 2 independent drives with the same shared folders, and the drive windows decided was bad wasnt the right drive, it renamed the volume and took everyone back to fridays data that resided on the drive that windows thought was bad. Anyhow ...Show All
.NET Development Socket.ShutDown
What i must do in order to send again data with socket after : clientSocket.Shutdown(Sockets.SocketShutdown.Send) How can i enable again sending Thank You Once you shutdown the send side of a TCP connection you have signalled to the other end you will not send anymore data on the connection. Thus, there is no way to reenable sending - this is a per the TCP protocol. ...Show All
Windows Forms Validating data in a bound datatable
I want to validate data for a datatable bound to a datagridview. To cancel an edit for bad data, from what I can tell from the MS docs, I can set the columnerror or throw an exception in the handler for the columnchanging (or rowchanging) event. I tried throwing an exception and that works fine when I do the edit programatically. Ie, try > add a row of bad data > catch exception. But where do I catch the exception when bad data is entered into the DGV The dataerror event of the DGV gets errors from ConstraintException, NoNullAllowedException, and ArgumentException - this works fine. Is this supposed to get the exception that I throw too I am throwing an ApplicationException. Is this right I can catch the exception right afte ...Show All
Visual FoxPro How can I get the ole_handle from an bmp image file?
In my application I need to call the method third party control, the method need pass in ole_handle of image file . I try to use h1=fopen("c:\test") and pass in h1. it did't work. In VB6 I can pass in img1.picture.handle and it work fine. Have Anybody has any idea THanks, CetinBasoz, Thank you very much . It work fine. ...Show All
Visual Studio Team System New to TeamSystem & need to share a document library to another site
Good morning all. This may be more of a Sharepoint related question, but I couldn't find any MSDN forums related to Sharepoint problems. The question I have does relate to Team System so I thought I'd start by posting here. If anyone can help with this problem I'm facing or knows of a great Sharepoint forum I'd appreciate it! First, some background information...My company supports multiple Sharepoint servers. Some of these servers are on different domains. One server, for instance, and all the WSS sites hosted on it, are dedicated to our clients. Whenever we create a new client project, a WSS site on this server (I'll call it ServerA for here) is created. ServerA is on Windows Active Directory DomainA. Each of our clients get a unique ...Show All
Visual Basic UserControl in StatusStrip
Hoping someone can help me figure out how to add a Usercontrol into StatusStrip. There seems no obvious way in which to add any controls other than the default ones allowed through the Items Collection Editor. Hi, the key here is to use the ToolStripHost class , which would host your user control. This MSDN's How To article will guide you through the process of generating a wrapper around your control, allowing you to put in on your status strip. Andrej ...Show All
Visual C# Help - folder's property dll
Hi.. In windows , when we right click on any folder or file, we get properties . In the properties we can see General/Security etc.. Is it possible to get the properties dll in c# please help This dialog is created by the Shell. To display the properties dialog for an arbitrary file you'll need to call to the Shell. The Shell function is SHObjectProperties . Use P/Invoke to point it to the file and it'll display the property dialog. Michael Taylor - 12/21/06 ...Show All
Windows Forms CPU usage
Hi, I am looking for a simple way to diaplay CPU usage and (if possible) memory usage on a windows form. Cameron. How know my proccess name Reading this genial thread, i'm monitoring the cpu and mem usage of my app, but i must put explicit name of my proccess in: private PerformanceCounter MEM = new PerformanceCounter ( "Proceso" , "Espacio de trabajo" , "MyApp" ); And when run like 'Release' runs Ok, but when run in 'Debug' crash because the proccess is called in another way. Regards. ...Show All
Visual C# Video and still image capturing with USB cams
Hello, how can I capture video and still images from a USB cam in C# All what I found is DirectShow, but here is only unmanaged C++ and no still image support. Any help BerW Hi take a look at windows image acquisition http://msdn2.microsoft.com/en-us/library/ms630368.aspx there was also a coding for fun example a while back: http://msdn.microsoft.com/coding4fun/hardware/article.aspx articleid=912546&title=Look+at+me!+Windows+Image+Acquisition Hope this helps you out, please close the thread if it does ...Show All
Windows Forms Databinding from Dataset to checkboxes
Hi all. I have a small problem. I am trying to bind a few textboxes and checkboxes to a dataset. The textboxes workes fine, but i can get the checkboxes to work. //Binding if (dsProduct.Tables[0].Rows.Count > 0) { productBindingSource.DataSource = dsProduct; productBindingSource.DataMember = "eProd" ; //eProd is the table in the dataset BindComponents(); } private void BindComponents() { this .textBox1.DataBindings.Add( new Binding ( "Text" , this .productBindingSource, "pd-desc1" , true )); this .textBox2.DataBindings.Add( new Binding ( "Text" , this .productBindingSource, "pd-desc2" , true )); this .textBox3.DataBindings.Add( new Binding ( "Text" , ...Show All
Visual Studio Express Editions relays...
Could someone point me towards some material on programing with the serial port or if someone saw a post on a site like hackaday that uses serial port programming. I am trying to be able to control 4 relays (or i can start with 1) over the serial port. or usb, you decide what the best thing would be to use. Thanks to all the people who post on msdn forums.. Average Joe how do you set the state of the pin what is the line of code you must place in a event . thanks alot for a reply Averagejoe ...Show All
