Call Other Files That Programmed To The Main Program?
Oct 8, 2010i want to know how can i call other files that i programmed to the main program?
View 1 Repliesi want to know how can i call other files that i programmed to the main program?
View 1 RepliesHow would you call a class from a main form? In VB6 you would call a module by just simply calling the module name.
View 2 RepliesWe know that the DLL function can be called from our mainprogram and return value. I would like to know, when we run DLL function, can we call a sub in our mainprogram (from DLL function) and return a value to DLL fucntion.
View 3 RepliesAs of the moment I have 24 buttons that are keys to a piano.24 of the button codes have a call method that calls the note to be played.24 of the private subs that are called have an .wav audio playback command within them. I was hoping I could move the .wav private subs into a separate class, and just call them from my main form, therefore cleaning up the lines of code I have at the moment. [code]That example only counts for one Button "The Key of C", and the audio file that is called with it. Multiply that by 24 and you get a big mess of repetitive junk.Can I move the audio subs into a class and call them from my main form?
View 16 RepliesI am using Compact Framework 3.5 on a Symbol MC50.In my Sub Main it first checks to see if a database exists. If it does, it shows a login screen using the following code:
Dim login As frmLogin = New frmLogin()
If login.ShowDialog() = DialogResult.OK Then
Application.Run(New frmMain())
End If
This all works correctly and, when I close frmMain, it exits the application as expected.However, if the database check in Sub Main fails, I call the ShowDialog() method of another form that is used to create and fill the database from a live server. Here is the code for calling this form:
If Not File.Exists(SETTINGS_LOCALDB) Then
databaseExists = False
MessageBox.Show("Local DB does not exist. The database must be created before using the application.")[code].....
All of this code is being hit and frmMain does indeed load. However, when I click the close button in the top right nothing happens, no event occurs. Its as though the Windows events are not occurring.
I have a VB .NET 2010 application. I added a C# project to my solution. I tried to call the form called 'main'. However, I could not figure out a way to do that. What is the best way to do that? I Goggled, and did not find anything. Actually I noticed that my Developer converted everything to VB .NET.
View 5 RepliesI have a function in a module that returns a datatable.I need to call that function asynchronously and get the results in the Main thread (Main Form) in vb.net.
View 2 RepliesI have a solution with more than one project and the main project contains buttons to open forms from different projects that are in the same solution. Say Project1 is the main project and Project2 is the different project that gives the following error when i compile it:
Error 3 'Sub Main' is declared more than once in 'SystemInformation': SystemInformation.Program.Main(), SystemInformation.My.MyApplication.Main(Args() As String) System Information II
I have already seen other threads with this question but it does not work for me because i have more than one project.For Project2: Application Framework is disabled and the startup object is "SubMain".
I have an ajax modal panel with a div on it that I access from the server and dynamically insert a table into, by showing the values of various controls on the calling form.My problem is this, it works fine if all my controls are doing auto postback, but it ruins the user experience, because tabbing through the controls, the controls lose focus during the automatic postback.Is there a way to have my target control perform a postback, before it puts up the modal, so I can retrieve not posted controls data in the modal?
View 2 RepliesPursuing the Microsoft Certified Professional Developer Certification and working through the training kit.I've programmed for a while and mainly used classes as my objects.The training certification book I'm working through has a section on structures. they look very similiar to classes so my question is: why use them? Do they offer something that creating a class doesn't? What's the difference between structures and classes?
View 8 RepliesI set the value in VBT as 1.205, but if i print that value in Immediate window it get changed to 1.20492553710938. I need to display the value, whatever i have set.
what is the problem here and the solution to get the value whatever i have set?
what methods use to update the main exe and related files in the app dir?
im using a seperate exe which runs with admin priviledge which downloads and replaces files as necessary.
my app downloads a text file and checks the version in that. if newer than settings.version then it runs the updator.exe and then closes.
the file downloaded also contains links to all new updates. the updator reads from this file then downloads as neccessary. then deletes the file and closes
I am presently working on a bluetooth appliance project using Rabbit's embedded blue RCM3100 microprocessor. The microprocessor is programmed using Rabbit's software dynamic C (Combines C and assembly language). The problem is, I would like to create a GUI (graphical user interface) using VB.net to communicate wirelessly via bluetooth with the microprocessor. How do I link VB code with dynamic C?[size=7]
View 6 RepliesAll of the sudden none of the pre programmed buttons on my form work anymore. The only buttons that do work are those i create in runtime.
I allready replaced all my buttons with new buttons.Beacuse i thought maby i've changed something in their settings. I've put breakers on the Private Button_click subs to see if anything happens. Nothing absolutly nothing happens if i click my pre programmed buttons.
Update: Well i figured out what was wrong. VS2010 had removed all the "handles button.click" behind the subs. And it won't create them when i dubble click a button i program time.
The instructions are as follows:
1. Write a Visual Basic Console Application.Inside the main procedure call a function procedure to input and return a value for a double variable called x, the width of a right triangle.Inside the main procedure call the same function procedure a second time to get a value for a double variable called y, the height of a right triangle.
2. From the main procedure call a function procedure which calculates and returns a value for the hypotenuse equal to the square root of (x squared + y squared).You will have to pass the values of x and y to this function procedure.The procedure should calculate and return a double type value.The value that is returned by this function procedure should be equal to the square root of (x squared + y squared).
3. Also from the main procedure call a sub procedure to display the values of x, y, and the hypotenuse.
I have a program that creates excel and word documents from another main Excel workbook. Essentially it opens excel checks data, posts data to appropriate forms. It then saves them as (number from main excel) & date/time stamp and corresponding extension. I want to be able to list the created documents according to the number from the main excel workbook.
[Code]...
I am trying to autoselect pre-programmed items in a listbox when a form opens with the control on it.but i cannot find a proper method to select all the items in the listbox and hold the resulting text as a string that will later be saved to a text file. i do not need help with saving the text to file but rather selecting the items in the listbox.so, after alot of trial and error and no luck I think I am supposed to use
ListBox.ObjectCollection
propriety. but i have no clue whats so ever in how to manage to select all the items in the listbox when this form opens...if this does not make sence then I will rephraze it.
Recently i bought the book by Troelsen about VB and the net and tried to run the programs e.g.:
Module Module1
Sub Main()
EntryPoint.Main()
[code]....
I had to add the first sub "Main" otherwise it would not run. Is it possible to do without that sub in the way member OLiver does in the examples he provides?
I made a Class Library project that contains the main classes that my Main Project needs because I don't want to main classes when I distribute my project. I've successfully called and used it in my Main Project. But when I started debugging and stepping through my code which involves calling and using the class I wrote in my Class Library, I noticed that the class' file in my Class Library opens up during debug mode.
how can I prevent the Class Library's files from being opened during my Main Project's debug mode?
Is there a way to start your program from the sub main() like you could with vb.net
View 4 RepliesI recently started learning how to use visual basic and whenever i try and make programs (aided by microsoft tutorials), it says in the error section: Sub Main missing from (my programs name).
View 4 RepliesIs it possible to use a sub Main() to start you're application rather than a form, if so how? Also how do you implement the cmd commands such as "[application path here]program.exe colourclicker" The above command would start the program but would only show a certain form.
EDIT Is there another way other than unchecking the 'Enable Application Framework' checkbox? (As this disables XP Styles and uses the ugly classic windows styles)
My software will simulate a few hundred hardware devices, each of which will send several thousand reports to a database server.Trying it without threading did not give very good results, so now it's time to thread.Since I am load testing the d/b server, some of those transactions will succeed and a few may fail. The GUI of the main program needs to reflect this. How should the threads communicate their results back to the main program? Update global variables? Send a message? Or something lese?
Now, if I update only at the end of each thread then the GUI is going to look rather boring (and I can't tell if the program hung). It might be nice to update the GUI periodically. But that might cause contention, with threads waiting for other threads to update (for instance, if I am writing to global variables, I need a mutex, which will block each thread which is waiting to write).
I'm new to threading. How is this normally done? Perhaps the main program could poll the threads, instead of the threads iforming the main program?
Im trying to make a program that has a main form(menu form) and when i click on the buttons another separate form will appear.
View 1 RepliesI have developed an application with a plugin architecture using interfaces. I realized that when I release the API for 3rd party plugin development, someone would be able to create a loader program to replace my main program quite easily. Is there any way I can make the plugin dependent on my main program? All my main program does is get an icon and a description of the plugin from the DLL plugin (using the interface) and then calls the dll's interface function to create and display the form.
View 2 RepliesI have an application I've written for some of the people at work and there is one bug that I have no idea how to solve. The application is multithreaded so that the main form can be updated with new information as it comes in. Throughout execution, several other forms come up as well (one at a time).Every so often I get reports that the program freezes. When I check out the program it looks like the main form is not being updated(checkboxes are see through, textboxes are blank) and the main form can't be moved around. This only seems to happen sometimes when the program is left for long periods of time (+30 min) and only on the released .exe and never in the debugger(as of yet). I've tried leaving the program running overnight and it had no problems.
View 5 RepliesMe.Focus() doesn't do the trick, my program is hereQuote:
Public Class Form1
Declare Auto Function mouse_event Lib "user32.dll" (ByVal dwflags As Integer, ByVal dx As Integer, ByVal dy As Integer, ByVal dwData As Integer, ByVal dwExtraInfo As Integer) As
[code]......
I want to launch a bunch of threads, each performing the same task, and know in main() when each finishs and it if it was successful or failed.The solution offered was to use a ConcurrentQueue, but other posts have recommended using a BackgroundWorker Class, or a thread pool.Is there a definitive answer?Again, all threads perform the same code and have a pass/fail result. I want to run more than there are available threads so as soon as one thread finishes I will launch another asap - I want tehm to stress a remote systems as much as possible (reather than stressing my local PC with too many threads, so I will need to experiment to determine the optimal number of threads).
View 4 RepliesI feel like the answers I seek are rather obvious so I feel silly for having to ask, but I just can't seem to figure this out (I'm new to threads, and am really only comfortable using them in Java at the moment). I have an Excel Addin application created with VB.NET, and I've noticed that occasionally while it's running some code (it's no one specific block of code) the program execution will just stop. This is especially problematic when I've set ScreenUpdating to False for Excel because the users then have to completely close out of Excel to get ScreenUpdating to true.
[Code]...
I'm having one basic aspx script that needs to load some "plugins". Every plugin has its own settings and it should perform different logics. What i'd do in php is create a class for each plugin, load that class, pass the settings file to it and call some method on that class that would give me some output. But is it even possible in vb.net? I'd need to have multiple files with multiple classes, load those files, depending on the plugin name and call some method on them to parse that plugin's settings.
View 2 Replies