Functions Nearly Identical, One Works, One Locks Up The Whole Form?

Feb 9, 2012

I've have found answers here frequently in the past just from browsing. But now I'm completely dumbfounded.

I'm using Visual Basic 2010 Express, on Win7 32bit. My application talks to an Arduino via a virtual com port provided by a cheap Bluetooth to serial adapter. I use a text based protocol that is working fairly well. BUT one method in my code, taht seems functionally equivvalent to the other methods is locking up my whole window.

It does this whether I'm debugging or running the exe.Below are the offending method, and a simmilar one defined above it that works with no problems.

[Code]...

If I comment out the cal to write, everything works fine. Aside from me setting some state bools and playing with button titles in the first method, I can't see the difference as to why one works fine and the other hangs.

I really hope someone has some experience in the SerialPort object and VB that can shed some light on this.I've tried everything I can think of. I thought maybe it was the inline concatenation, so I dim'd a local and assigned the string to it, and passed that to Write. But I have another method that uses inline concatenation that doesn't do this.

View 1 Replies


ADVERTISEMENT

Identical Code - One Works One Doesn't

Jan 19, 2012

I'm on Windows Vista Home Premium, using Visual Express 2010, working on a visual basic program.

View 2 Replies

[2008]same Identical Code That Works Only In 6 PC Out Of 10?

Mar 17, 2011

I have made a little Hotkeys utility for Poker Tables. I hook the keys and, depending from the key, I simulate a mouse click over the related table button.The Sub that make the job is this:

Private Sub DoMouse(ByVal flags As NativeMethods.MOUSEEVENTF, ByVal Wheel As Integer)
'wheel = +-120 if wheel event, 0 in other cases
'added hoping to improve the code, but nothing changes, Hwnd is a global variable

[code].....

View 19 Replies

[VB2008]same Identical Code That Works Only In 6 PC Out Of ?

Feb 19, 2011

The Sub that make the job is this:

Private Sub DoMouse(ByVal flags As NativeMethods.MOUSEEVENTF, ByVal Wheel As Integer)
'wheel = +-120 if wheel event, 0 in other cases
'added hoping to improve the code, but nothing changes, Hwnd is a global variable

[code].....

View 1 Replies

VS 2010 - How Does The API Functions Read / Write Process Works

Jul 18, 2010

need to know exactly how does the API functions Read/Whrite Process works. I'm so confused while working. I know that I have to work using something like sectors. But I don't know how. Can someone give me an example. I dont know hoe to do it. for an example, for you to give me. Create a basic programa with a button and a textbox the button searchs what is in the textbox in a process memory. Search the title of a program for example.

View 2 Replies

Put Permanent Cap Locks On A Form?

May 6, 2011

Put permanent Cap Locks on a Form?

View 18 Replies

Sending Email Via Form Button > Locks Up Until Sent?

Apr 25, 2010

I have a windows form. On it is a text box and send email button.When you click the Send Email, it sends the contents of the text box via the System.Net.Mail

Private Sub SendEmail()
Try
Dim MyMailMessage As New MailMessage()
MyMailMessage.From = New MailAddress("myemail@email.com")
MyMailMessage.To.Add("myemail@email.com")

[Code]...

View 12 Replies

Copy Form And Make Identical?

Jan 24, 2012

How can I copy form and make identical form

say want to copy the style of one form & coding and make identicel form 2

View 4 Replies

VS 2008 : Have A Class Where The Functions Of The Same Name Are Both Instance Functions And Shared Functions?

Dec 6, 2010

What I am trying to do is have a class where the functions of the same name are both instance functions and shared functions.

Public Shared Function Get...(byval xx as xx)

and

Public Function Get...

The Public Function uses a Property xx created in the constructor, whereas the Shared Function has the parameters (byval xx as xx).

View 1 Replies

Stop All The Functions On Parent Form While Child Form Is Still On Screen?

May 1, 2009

form1 has datagridview, when I click "add new", form2 appears(details view, allowing me to add new records into datagridview on form1). when I click "add new" again, form2 appears again, if I click x times, form2 will appear x times. How do I stop the add new button and all the functions on form1 from working until form2 is closed?

View 6 Replies

Build A Class That Works With A Form?

Sep 7, 2010

I am trying to build a class that works with a form, but I keep getting the dreaded "Object reference not set to an instance of an object" Error.The form basically collects test grades and assigns them to a collection.My class code is as follows:

Public Class Scores
Private colScoreCollection As New Collection
Public mintSum As Integer
Public mdecAverage As Decimal
Public mintMinimum As Integer

[Code]...

I had a similar project I was working on that had a collection in it, but now that one is giving me the same error. It there something with my version of Visual Studio that is causing this error possibly?

View 7 Replies

VS 2010 : Code Only Works In One Form?

Jun 16, 2012

It is a word scrambler in which the user must guess the word that is scrambled. It is not completed obviously but the code only works with one form. As soon as I include other forms for title screens and the likes, the code doesn't work at all.Here it is (This is the multiform version):

Imports System.Text
Public Class Form3
Public word As New List(Of String)

[code]...

View 3 Replies

Use The Same Form For Several Functions?

Jul 20, 2009

I am trying to use the same form for several functions which means I have to change the properties. In order to do this, I was trying to put a select case in a module that could be recalled anywhere in the project.

As soon as I start a select case in a module, I get an error message "Error1Statement cannot appear outside of a method body." Does that require that it be in a form only and cannot be used in a module?

View 2 Replies

.net - KeyEvents On Form Only Works In Combination With CTRL

Jan 8, 2011

Code:

Private Sub KeyHandling(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
Select Case e.KeyCode

[Code].....

This code won't do anything, except when I hold the control key.

View 4 Replies

Form Works Properly When Set As "StartUp Form" But Not When Access Through A Control?

Nov 25, 2009

I have created a calendar in VB which works fine when set to the startup form, but when I use the MdiParent form as the startup form and try to display the calendar by use of a control it just shows all the buttons and labels with no values assigned to them. Its almost as if the Calendar_Load event is not working, or not accessing the methods in my CalendarClass.

View 2 Replies

VS 2010 DataGridView - GetRowDisplayRectangle Only Works When Form Is Visible

Oct 20, 2010

I am running a website for a F1 racing game, where users can submit their laptimes and compete with each other for the fastest time.

I am now trying to have my website create an image of the top-5 users every... 5 minutes or something, and copy it to the webserver somewhere I can link to. This way the image under that link will update with the latest information every 5 minutes.

To layout the times (these also include the position (1 to 5), the username, the platform, the time of course, and some more details) I am using a DataGridView. I could take the long route and layout the specific 'columns' manually, but I thought using a grid was far easier. I simply set some properties of the grid to make it look nothing like a grid (basically hide the column and row headers and grid lines and give everything the same backcolor). Then I load the times into the grid, and take an image of it using the Control.DrawToBitmap method.

This works fine, but it returns the entire grid. This is a problem because I made the grid extremely large (5000x5000) so that it can always accommodate the times regardless of the length of the usernames. So, the image I get is 5000 pixels wide while it only contains data in the first 500 px orso.

I am currently using the GetRowDisplayRectangle and GetColumnDisplayRectangle methods to figure out the part of the grid that actually displays the times, and use that to cut the image down to the portion I need.

But here's a problem: these methods only return something when the grid is on a form that is currently being shown! I am already giving the grid a parent form (even though I am just creating it in memory and it doesn't need to be displayed anywhere) because otherwise the data wouldn't load, but I was never showing that form. Now it turns out I do need to show the form, very briefly, in order to figure out the area that I need to take a snapshot from.

Remember that this is all happening on a webserver, so I'm not absolutely sure if this is a problem. Is it ok for a webserver to have a form popping up and down every 5 minutes? Or will this cause problems? I honestly don't know but I don't think it's a good thing. Moreover, it also pops up on my own machine when I'm testing, and it's damn annoying.

So my question is basically twofold:

1. Maybe I should ask this in the ASP.NET forum, but is it a problem to show a form briefly every 5 minutes?

2. Is there any other way to get these Get...DisplayRectangle methods to work without having the grid on a physically visible form?

View 3 Replies

Access Functions In The Class Within Another Form

Feb 18, 2011

I am new to .NET 4 and VS 2010. I am using VB 2010 and have made a class and need to know how i can access those functions in the class within another form. So there is a function say of XYZ in the class named classes.vb and need to get to it from form1.vb

View 9 Replies

Creating Clear Form Functions?

Mar 2, 2010

I am trying to create a function to clear my form. The code is as follows:

Private Sub resetForm()
'Set an integer to loop through the controls
Dim x As Integer

[code]....

it works when I set the type of control as textbox but when I try to do the same thing with radioButton and make it's checked proporty = to false I get checked is not a member of 'system.windows.forms.control'

View 5 Replies

Culture Change Did Not Affecting The Control But It Works With Form Title?

Jun 5, 2011

I am here with the same Query but with a different look I want to apply the culture change to my program. I created a class library for culture change. and applied it . It is only working with the form name, i did it with two different languages and got the result. But the controls inside the form remains as it is.

View 4 Replies

Right Click Context Menu - Code Works On Form NOT Over Web Browser

Sep 4, 2009

i have a form with a webbrowser in it, now below is the code i use to generate my context menu, however it only works on the form NOT over the web browser, that has its own right click menu. is there a way to disable the browsers right click and have my own work over the whole form? [Code]

View 4 Replies

Excel Maths Functions And Calls To All DLL Functions Documentation?

Jan 29, 2007

1) Is it possible to access the Excel mathematical functions without actually opening Excel?

I was thinking of through a DLL WinAPI call or maybe a delegate function or smaller program?

2) Does anyone know of a MS link or area that gives instruction on "how to" use every function of every Windows DLL at all?

Or for all those that Microsoft have chosen to document online at least.

View 1 Replies

Combining Adding And Viewing Form Functions

Sep 29, 2010

Im banging my head against the wall with this one...If anyone can give me some pointers on how to combine the following two code snippets,[code]

View 5 Replies

Forms :: Functions Work Only If Form Is Run Directly (non-MDI)?

Dec 14, 2010

I have this weird issue:I developed an application with a sequence like this login form -> mainform (=mdi parent) --> some functionform (mdi-child)--> report form

The reportform contains a reportviewer and will display different dataset queries depending on the state of some radio buttons which are located on the previous form ('some function form'). When I run the project directly from the 'some function form' (set startup form for project) things work great. The report shows the correct data depending on choices made on the previous form.But....when I run the project all the way from login and mainform it doesn't work. Seems like the choices made on the "some function form' are not coming through to the report form.

View 5 Replies

Write Functions In Form And Link To Database?

Feb 14, 2011

is it possible to create a form in vb, functions able to create, update or delete records?

View 2 Replies

Form Validation - User Does Not Input Valid Text, EXIT Button Also Does Not Works?

Apr 15, 2012

I am doing form validation in VB, I validate the text field data by using txtName_LostFocus function, and on wrong input I used txtName.Focus(). It works well for me. But problem is that as for as, user does not input valid text, my EXIT button also does not works.

View 1 Replies

.NET App Locks File

Feb 2, 2010

I;m really new to VB.NET and desktop application development. Simplified this is what is happening in my application: [code]The last line will throw an Exception saying that img1 cannot be moved because it is in use. So my application is still using it, but how to make my application stop locking the file? There is nothing keeping a refrence to it (as far as I see)

View 2 Replies

C# - ASP.NET Locks Up Only In A Single Browser?

Apr 28, 2009

I have a complex application running on IIS7 and Vista. It usually works ok but sometimes during longer processing threads/pages it seems to block(appear like there is no more wp's), but it blocks only on a single browser. Eg I have firefox open and go to a page which sleeps for 10 mins, then I hit other normal pages and these pages also seem to block. But in internet explorer the pages run really fast. This only happens for 2 minutes at then they are back to normal, the original page is still loading in the background but now those other pages are working ok.

Note, I have changed, network.http.max-connections, network.http.max-connections-per-server, network.http.max-persistent-connections-per-proxy, network.http.max-persistent-connections-per-server all to 100. Maybe I have missed some?

View 2 Replies

Open Files Without Locks?

Apr 20, 2010

I am opening a bunch of excel files to read them line by line into sql at the moment - but ran into a small problem. When using something like this[code]...

if I then open the file manually, it will error the code. I put in some error protection, a try...catch block and if it errored, it will keep trying to open the file. If it opens the file, that means I closed it manually and the program will pick up from where it left off.

This isn't very successful, as other errors won't be trapped right, and the program will crash if I don't catch the errors (they cause an infinite error looping).

Is there a way to have the app/file open somehow, so if I open any other excel file, it won't open, or it will open but not error out in the program cause it's now physically open?

View 4 Replies

Call Windows Form Functions From Webpage (which Is Displayed Through Webbrowser Control In Win App)?

Mar 25, 2009

I have implemented webbrowser control in my windows application. I have some functions inthe class file. i want to use those functions from the webpage which is displayed in my windows app through webbrowser control..For example say... I have an standalone windows software. Which has a webbrowser control in the some form. Now i would like to create a webpage that can be displayed in the webbrowser control in win app which has some buttons and textboxes. When i click on button in the webpage it should get the version number of that software. I have some other functions that are in the class file aswell.. but dont no how to call those functions from that webpage when a button is clicked or something like that.

View 4 Replies

C# - Determine When A User Locks / Unlocks Their PC?

Jan 30, 2012

Possible Duplicate: How can I programmatically determine if my workstation is locked? Checking for workstation lock/unlock change with c#

I would like to determine when a Windows (XP, or 7) machine is locked, and unlocked.I would like to create a timesheet activity logging app, and pre-filling times in, with lunch, breaks taken, etc, would be very useful.Is it possible to pick up an event that fires when the Windows Operating System is locked and unlocked ?

View 3 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved