Add A DLL Dynamically?
Oct 17, 2009
How can I dynamically add DLL files to a application?
I made an application that searches for DLLs in a folder. I want the app to run the "GetVersion()" function in the "StartModule" module in the every DLL that it finds. How can I do it?
Could I make it, so the DLL would run in a separate thread?
View 2 Replies
ADVERTISEMENT
Mar 15, 2011
I have this code.
Code:
Public Class Form1
Dim NPB As Button
Dim x As Integer
[code]....
As you can see, when I open a program from my menu, a new button will be created with text similar to this, "C:Program ". The button it self will not do anything. How can I create the method at the same time the button it is for is created? Also how can I change the text do that it gives me, for example, CCleaner.exe instead of the whole target path?
View 14 Replies
Dec 5, 2011
I can usually find the answers to most of my questions via the Google Gods, but not this time.I have a form that has a TabPageControl and on that page a collection of labels and text boxes via a usercontrol.
On the form I have a button that allows the user to create a new tabpage, when the code adds a new page, it automatically adds the UserControl collection. I can't get my head around how to access the objects on the newly created tabpage.
What I need to be able todo is take the index of the tabpage that has focus and translate that against the UerContol name, but I havn't a clue how to do it!
[Code]...
View 4 Replies
Dec 16, 2011
I am adding a grid of buttons to a form at run-time, and all of then use the same Handler.My question is : Is there any way I canadd the TextBox at run-time ?I know how to but without it on the form, the IDE isn't very happy about the "MyClick" Sub - TextBox1 is not declared......
' some logic here to make nice rows and Columns of buttons
' with different .Text and .Name
Me.Controls.Add(btn)
[code]....
View 4 Replies
Jul 16, 2009
I have an application that dynamically creates winforms.
Dim NewS As New Form
Dim NewT as new Timer
NewT.Interval = 5000
[Code].....
View 3 Replies
Jul 16, 2009
I have an application that dynamically creates winforms.
Dim NewS As New Form
Dim NewT as new Timer
NewT.Interval = 5000
[code]......
View 4 Replies
Mar 1, 2010
I am trying to write some code that will allow me to dynamically load DLLs into my application, depending on an application setting. The idea is that the database to be accessed is set in the application settings and then this loads the appropriate DLL and assigns it to an instance of an interface for my application to access.
This is my code at the moment:
Dim SQLDataSource As ICRDataLayer
Dim ass As Assembly = Assembly. _
LoadFrom("M:MyProgsWebServiceDynamicAssemblyLoadingSQLServerinDebugSQLServer.dll")
[code]....
View 3 Replies
Dec 23, 2009
I'm trying to add rows dynamically to a System.Web.UI.WebControls.Table control in ASP.NET. I found some sample code that does what I'm seeking, but it only adds a single row. It seems like the table row count does not carry from one page load to the next. The user should be able to add as many rows as desired, and I need to capture the data from each row.
What am I missing? Code below.
<%@ Page Language="VB" %>
<script runat="server">
Sub btnAddEmail_Click(ByVal Sender As Object, ByVal e As EventArgs)
Dim tr As New TableRow
Dim tcLabel As New TableCell
[Code]...
View 1 Replies
Jun 15, 2011
I'm dynamically adding an event handler on a link button, first when the page is load o create a link button with product category. On clicking the product category it fires an event and passes the product-id IN sender object.
Here is my problem: when i readd the event handler on page load it's giving an error cannot cast sender object
[Code]...
View 1 Replies
Jun 2, 2011
I have a GUI that is processing data from our shop floor.In order to communicate with external programs, we are using MSMQ to process messages. Each interface we have to an external program, we are currently creating a class file with only properties,calling the class in the GUI, setting the properties, then sending the class object to MSMQ for processing.The class is serialized as an XML file, and the queue watcher can pick up the class, deserialize it process the messages without any problem.Currently we have identified three interfaces, developed the classes for them and this is working great.As more interfaces are identified moving forward, I would like to avoid having to add the classes to the GUI front end for each interface.I would like to create a DLL for each interface (again only with properties) that could be dynamically loaded and discover the properties for the class.The GUI could then set the properties for the class and process the message.One property each class will have is the name of the interface.This will be a readonly property that will the queue watcher know which interface to use. In order to make this dynamic, I could create some tables in our database that would contain the name of the interface and cross reference the properties in the DLL with parameters in the GUI. This way the GUI would only call one DLL that would be embedded in the GUI, it would call the database to get the parameters needed for the interface, match them from the GUI and create the message.
1.What is the best way to dynamically load DLL's using VB 2008?
2.Does this sound like a good proposal?
3.My intent is to have the GUI re-compiled as little as possible to minimize the impact on the shop floor when new interfaces are created.
View 2 Replies
Jan 11, 2012
I'm just starting to learn VB and Visual Studio and I've run across a problem. I've spent the best part of a day trying to find the answer and I have a horrible feeling that it's going to be something very simple that I've over looked.I'm working on a WPF in Visual Studio 2010 and am trying to dynamically create a button on the main window when a button is clicked (I know, everything I've read tells me this is pretty basic!) Here's an edited snippet of the code I've written:
Imports System.Data.OleDb
Imports System.Windows.Forms
Imports Excel = Microsoft.Office.Interop.Excel
[code].....
View 3 Replies
Nov 19, 2011
I wanted to make an executable file from my program. I already know that compiling your project creates an executable, but I wanted to know how to make an exe with my program.
View 4 Replies
Aug 7, 2009
Back in form1, how can I wire up the Click event for each MenuItem present in the contextmenu? I want to do this as abstract as possible, meaning I don't want to implement the OnClick code inside Form1.
Code:
Public Class Form1
Me.ContextMenu = MenuFactory.BuildMeAContextMenu()
End Class
[code].....
View 13 Replies
Nov 20, 2009
i've read this somewhere before and was able to make it work, unfortunatelyi lost my sample codes and couldn't recall some parts, anyway, here's what i'm trying to doi have a couple of DLL with same methods and properties, instead of referencing them directlyto my main program i have a common interface which i have reference to in both main program and DLLs (implements), the main program is suppose to load whichever DLL it requires (so i was thinking of making it more like plug able), here's what i have so farINTERFACE CLASS
Code:
Imports System.Reflection
Public Interface MyInterface
[code]......
View 1 Replies
Aug 9, 2011
I am working on a weboage that will display questions and answers (maybe 5 at one time, maybe 7 at another time) returned from a database table. The questions will each be displayed in a div and the related answers displayed in another div. The question will have an icon "Show Answer / Hide Answer"
How can I go about creating a div and then populating it with values from a table?
View 2 Replies
Mar 30, 2012
I am building a GridView which can download songs. So I use a hyperlink fileld and use DateNavigateUrlFormatString.
E.G.
DataNavigateUrlFormatString="~/uploads/{0}"
Now, I need to combine Page.User.Identity.Name into DateNavigateUrlFormatString For example,
DataNavigateUrlFormatString="~/uploads/UserName/{0}" which Page.User.Identity.Name depending on the user login.
I tried to access DataNavigateUrlFormatString from the code behind but I couldn't.I tried to use Eval such as
'~/uploads/" <%# Eval("Page.User.Identity.Name") %> /{0}'
this doesn't work as well.
<asp:TemplateField HeaderText="Play">
<ItemTemplate>
<asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl = '<%# String.Format("~/UserUploads/{0}/",Page.User.Identity.Name)+ "/" + Eval("Song_Name") %>' Text="Play" >
[code]....
View 1 Replies
Dec 10, 2009
Is it at all possible to declare variables dynamically? Something like Dim Answers & i As ArrayList. What I'm trying to achieve is putting one or more answers to a question into an array. Or should I really be looking at a mult-dimensional array to store the question number and answer? How would I add to and access a multi-dimentional array? Anyway, here's the section of code:[code].......
View 4 Replies
Aug 18, 2010
I have a bunch of string variables, string1, string2, string3 etc.At the end of my program I want to write these strings to a file, but I don't want to have to laboriously type out string1, string2, string3 etc.
It would be much easier to use a loop to dynamically refer to (string & loopcounter), ie reference the variable by dynamically concatenating its name from a string and a number. Python can do this with eval(). How does VB do it? I can think of loads of examples where it'd be useful. Otherwise I have to type out all the different conditions and that's not efficient.
View 1 Replies
Feb 15, 2010
i am creating check box's dynamically and assigning them names like "chk_1" and "chk_2".now if later in my code i want to check if they have been checked how can i do that.if i do something like if chk_1.checked is True then i am getting error that chk_1 is not declared.Which is true.i am using VB.net 2.0 i can post my code if needed.
View 1 Replies
Sep 9, 2010
I have in vb a selector
Dim ver =101
Select Case ver
Case 101
upd101()
Case 102
[Code]...
How can I make this select better by calling function in more dynamically in this form: with the prefix "upd" followed by a ver integer.
View 3 Replies
Jan 13, 2010
i m trying to load the tabs dynamically.(Using AjaxToolKit). Firstly, when i hit button1 on pageload, it loads tab1() (works good) and when i hit button2, itloads up tab2() All these tabs are ascx pages. In tab1 i m loading WebUserControl.ascx. it works okay.
Issues:
1) When you runthe code, first click on button2, it doesn't load tab2 dynamicaly but it does when u hit button1 for the first time.
2) Repetitive clicking on button1 or button2 should load the same tabs next to eachother again and again but it doesn't
3) Thirdly, the main issue is that I m tryin to load another .ascx on loadtab2() which should have webparts in it. I should be able to load an another custom usercontrol into these web parts dynamically. But i m not able to do so.
Here is my code:
Default.aspx
<p>
<asp:PlaceHolder ID="PlaceHolder1" runat="server"></asp:PlaceHolder>
</p>
[code]....
View 1 Replies
Mar 21, 2010
I have a gridview which is created dynamically by adding columns and rows from a database.this is the code which is used to fill the gridview
sqlQuery = "select distinct ID,FullName,Address,[Home Tel],[mobile tel],[work tel],Email,[Birth date],Rate,Notice,Created,Modified,[last cv],Deleted,[q comments],[last typed],Recruiter from [dbo].[vItrisRepository] where email like '%" & email.Text & "%'"
adapter1 =[code]....
now i wanted to add extra column in to the gridview with a name skills in the existing gridview .is this possible?
View 8 Replies
Sep 25, 2010
How to add textbox dynamically(as per some conditions) to WPF usercontrol. .?
WPF usercontrol will be used in Winforms application...!
View 1 Replies
Apr 29, 2011
I'm trying to add a "panel" with controls dynamicaly. Something like the code below, Clicking "Add" button, displays a "Panel" with the controls(which are within a table), the number of "Education" someone can enter is unlimited. I know how to capture the data, but i can't figure out how to implement/code this,
[Code]....
View 1 Replies
Jan 15, 2010
I understand the page lifecycle and how i need to add the dynamic controls on page_init if I want to take advantage of viewstate. Also I know that I should try to avoid dynamic controls when possible. The dynamic controls are created depending on an object that is created from custom event arguments sent from a custom treeview. Problem is I need viewstate so I need to create them in page_init but I don't have the event args to create the object that tell me what controls to add until later in the lifecycle.
Private Function GetEventArgs() As npTreeViewEventArgs
Dim control As Control = Nothing
Dim e As npTreeViewEventArgs = Nothing
[code]....
I use this in page_init to create my object and controls.
View 2 Replies
Jun 27, 2011
I am working on a site where the meta tags are set in a Masterpage in a section using runat="server". I can update the title, description, keywords, etc... through properties in the Masterpage code-behind, but how would I add or edit non-basic ones such as
I have tried the following, but it always returns 0 for the count.
Dim header As Web.UI.HtmlControls.HtmlHead
header = TryCast(Me.Master.FindControl("headerIdName"), Web.UI.HtmlControls.HtmlHead)
Dim count As Integer = header.Controls.Count
View 1 Replies
Dec 28, 2009
I need to dynamically call web service! For this I made simple web service Service1.asmx
Then I created the proxy class for the Service1 Web Service, I use the WSDL.exe utility and following command at the command prompt: wsdl /language:VB /out:myclass.vb http://localhost:3245/Service1.asmx?WSDL
This command create class myclass.vb. That class I include in my Windows Application project, but when I do this I get lot of errors.
This is the how created class look like:
Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Web.Services
[Code]....
View 2 Replies
Mar 20, 2010
I need to dynamically create textbox. This is my code, but with this I create only one textbox:
Public Sub CreateTextBox()
Dim I As Integer
Dim niz As Array
[Code]....
So how i can dynamically create textbox?
View 3 Replies
May 25, 2009
I am writing a program and I want the program to support plugins. I created an interface that the program must implement. I am using the following code from my main program to call the plugin:
Dim asm As Assembly = Assembly.LoadFrom(ff.FullName)
' Get the type
Dim myType As System.Type = asm.GetType(asm.GetName.Name + "." + asm.GetName.Name)
' If the type is null then we try again without the root namespace name
[code]....
I set this property from my main program and everything works. Except, after a while, m_PanelObject gets set to Nothing for some odd reason. I'm not setting it to Nothing anywhere in my program and there is no place in the plugin code that sets it to Nothing.
View 1 Replies
May 24, 2010
We've built a small component which takes an Id, looks up an entry in the database for an assembly/namespace/class, and dynamically loads an instance of the class that we're after. It has been working fine up until now, but when running this code in VS 2010, it's failing.
Private Function AssemblyLoaded(ByVal assemblyFile As String) As Assembly
Dim assemblies() As Assembly = AppDomain.CurrentDomain.GetAssemblies
For Each asmb As Assembly In assemblies
[Code]....
But it feels dirty. Is there a better way of checking if an assembly is already loaded, and handing that back to the caller? Are the issues above specific to .NET 4.0 or Visual Studio 2010? I haven't tried this outside the IDE as it requires fairly significant configuration.
View 2 Replies