Answer Questions
AlanKohl Read and Modify the Registry
i am new to adding and modifing stuff. so if any one ca n help me storing stuff like numbers inside the registry and retriveing it that would be greatly appreacitaed Ok. To write a key in the registry: Dim key As Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.CreateSubKey("MyName") key.SetValue("MyName", "Jeff") I put the key in the HKEY_CURRENT_USER. Now, if i want to read this key, even more easy: Dim key As Microsoft.Win32.RegistryKey key = Microsoft.Win32.Registry.CurrentUser.OpenSubKey("MyName") Dim name As String = CType(key.GetValue("MyName"), String) That's it Jeff ...Show All
GR101 How could I replace double quotes with single quotes in a string?
Thanks in advance for that, I'm stuck with it. I vb6 I used to have a function on demand which did such stuff: For i = 1 To Len(cad) If Mid(cad, i, 1) = Chr$(39) Then Mid(cad, i, 1) = "`" ' End If Next thanks, finally i've choosen this line: sSqlLimpia = Replace(sSql2, Chr(34), Chr(39)) cad = cad.Replace("""", "'") ...Show All
Robin E Davies RTS and DTR serial port control
Hi I'm back on VB after a long while. I'm having problem controlling the RTS and DTR signals of the serial port. I'm trying to use RTS (maybe DTR as an alternative) to control an RS485 comms data direction. I have set up 2 buttons as a test with the following code: Private Sub Functionkey4_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Functionkey4.Click SerialPort1.RtsEnable = True End Sub Private Sub Functionkey5_Click( ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Functionkey5.Click SerialPort1.RtsEnable = False End Sub the program gets to both routines when the buttons are clicked but the RTS pin does not change, the port is wor ...Show All
Chris Lively back up brogram
I am trying to write a back up program that will back up a folder in the current user's my Documents folder so I would like it to read the current user registry string on load and I would like it to generate a log of all files processed I have mainly used code snippets Here's something to get you started: Public Sub Backup() Dim logBuilder As New System.Text.StringBuilder() Dim folder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) For Each file As String In System.IO.Directory.GetFiles(folder) ' put some file copy code in here... 'log logBuilder.AppendFormat( "{0}: Copied file {1}" , DateTime.N ...Show All
Horst Klein Do Loops ?
I'm afraid I'm having a little bit of a brain fart here. I have a form where I am expecting a user to enter data and then press the add button to add it to the database. Before I add the record I want to ensure that they have entered data into all the fields. When they press the add button I'm calling an Edit() routine. My question is, what kind of loop do I need to use to check this I am displaying a message box telling the user that he/she has not entered certain data, then when they press OK it is checking it again and again . This should be so simple but I've been at it all night and my head isn't co-operating. Where should the loop be and which type should I be using. Thanks in advance. Tattoo ...Show All
robdken Receiving strings from Serial Port
Dear reader, I want to read a string from a serial port. I found the sample code in Help, to do this, with the following code: Using com1 as IO.Ports.SerialPort = My.Computer.Ports.OpenSerialPort("COM1") do Dim Incoming as String = com1.Readline() If Incoming is NOthing then exit do Else returnStr &+ Incoming & vbCrLf end if loop end using The problem is that if the return string does not end with LineFeed, the com1.ReadLine command does not return to the application, and as a result doesn not return any value to Incoming, to check it contents. The application give the impression that it is just hanging, untill I stop the application. Also how does the Read ...Show All
prk backgroundworker
Hi All, First, I am not sure if I have posted in the proper forum. If not I apoligize. My issue is , regarding the background worker, if I call the reportprogress method I get the following error below from the form that contains the backgroundworker control. Anyone have any ideas System.Reflection.TargetInvocationException was unhandled Message="Exception has been thrown by the target of an invocation." Source="mscorlib" StackTrace: at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner) at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, ...Show All
MackDaddy OFSTRUCT Structure - Exception
Hi, When I use OFSTRUCT Structure in VB.Net without Marshalling the szPathName field throws the following error "An unhandled exception of type 'System.ExecutionEngineException' occurred" while opening a file with LZOpenFile. Is there any way that this could be solved without Marshalling Pls find Piece of code used. Public Structure OFSTRUCT Dim cBytes As Byte Dim fFixedDisk As Byte Dim nErrCode As Byte Dim Reserved As Byte '<MarshalAs(System.Runtime.InteropServices.UnmanagedType.ByValTStr, SizeConst:=OFS_MAXPATHNAME)> Dim szPathName As String Dim szPathName() As Byte Public Sub Initialize() ReDim szPathName(OFS_MAXPATHNAME) End S ...Show All
cbeasle1 Add permissions to exe
I want to add permissions to an vb.net exe. I don't want them in a separate file. What i want is for a user to click on a link in there browser, select run, and have the program run, instead of saying don't have permissions to display window. and no i don't want to use click once, its buggy, and don't work in firefox by default. I think that it is not a bug, but rather is by design. The reason it runs when you click save and does not run when you just click run is because you are running it from the 'Internet Zone'. When I suggested that you check the firewall, i'm not refering to packet filtering, i'm refering to an application firewall like Symantec Firewall that will monitor all applications th ...Show All
Enniobozzetti Q: Persistent Graphics on Form or PicBox: a real pain!!!
Hi all, this is kind of a follow up on 2 earlier threads I started. This time the question is a bit more fundamental. It concerns replacement of the persistent graphic methods in VB6 with the Picbox_paint persistent graphics in VB.net. Whatever I try, and whatever help I ask I simply cannot perform the following task: (heavily simplified) I have a VB6 program that reads inputvalues (X and Y) from an A/D convertor. It continuously reads values at ~5 per second and plots them as vectors. Aim is to visualize outliers and get a quick view of grouping of the outliers. I definitely need to implement exacly this functionality in VB.net. After a number of days, millions or even billions of vectors are drawn, with only a few outliers. ...Show All
Javier_Uy coding charts with data in datagrid: is there a good way?
I have actualy posted something like this before but i think i asked the wrong questions....here the scenario: i have managed to make my app draw out data from an access file based on user input. my lecuturer have ask me to make the app able to generate charts on that data based on further user input. I realised that the data is now in the datagrid and no longer in access. There were some suggestions from this forum (thanks guys ) that the best way to go ahead with making charts is using the pivot table (note: i fully intend to use/intergrate axcel or execel features with my app) with some input from the user. is there any way of doing this without any complications my vb.net skills are quite rudimentary at best. From where i am ...Show All
Daveko AxMSChart20Lib.AxMSChart
Can anyone provide me the usage details or documents or code related to this AxMSChart20Lib.AxMSChart control using C# Hi, You don’t need to post the same issue again. We will focus on one thread. Thank you Here I find a thread in vb about it: http://forums.microsoft.com/MSDN/ShowPost.aspx PostID=639800&SiteID=1 It seems a vb control, so you'd ask it in the vb forum. Thank you for understand. Thanks figo, but i have to create my own chart control. Not any third party control. And this control is present in C-sharp 2005 also, not only in VB. This is the code i wrote, in Csharp 2005, it gives me an exception. AxMSChart20Lib.AxMSChart chart = new AxMSChart20Lib.AxMS ...Show All
akeiii Office component?
Imports Excel = Microsoft.Office.Interop.Excel i have add the reference but its still cannot work.meanwhile i try another developer pc but its work the error is invalid namespace, it is mean the sys lack of some kind of office component im using vs 2003 enterprise developer and micosoft office 2003 standard edition Looks like you might be running into a known issue with the office interop libraries. Try reading the following article and see if it helps you with your problem. http://support.microsoft.com/ scid=kb;en-us;827476&spid=2488&sid=50 ...Show All
hr0nix Serial Port
Hi, I am new to VB, but need some help with serial communication. I have a simple program which reads information from the serial port and displays it in a simple text box and another box so I can send information. BACKGROUND The VB serial port program I have written reads information sent via a microprocessor I have programmed, the microprocessor sends a 12bit hexadecimal value after which a UART carriage return is sent and thus the data automatically updates my text box like so :- FFFF FFFF FFFF Note the microprocessor sends 250 results and stops PROBLEM/Question I am using the serialport.readexisting() command, but I would like to some how collect the data se ...Show All
MrBradford Application has failed to start
Hello, I was hoping someone could help me out with an error message that I am getting in the following scenario: We use Syncfusion controls and I upgraded from an old version of Syncfusion to the latest and greatest version. Was a long process because I had to go into each of the 11 projects comprising my application and delete the old references to the old Syncfusion assemblies, and add new references to the new Syncfusion assemblies. That being done, I created a Wise Installer for my application, which I have done successfully many times before, but after the application is installed, I get the following message when I double click on the .exe to launch the application: The application has failed to start because the applicati ...Show All
