473,383 Members | 1,832 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

Display form from string - 2nd post

want to be able to pass a formname as a string and have the form displayed.
I have read about using the Type and Assembly or Activator .CreateInstance
and have tried several things but none of it works. Here is my situation. I
have a dll called BaseClasses and it has a class called BaseForm. I then
have another dll called Test and a 3rd dll called Insured. When a button is
pressed I want to have a method in the Test.dll call a method in the BaseForm
that accepts the formname and then the BaseForm will display the form passed
in, such as Insured.InsuredSearch (in Insured.dll). I try to get the
assembly, but it never sees the Insured.InsuredSearch. The Insured.dll and
Test.dll have reference to BaseClasses but BaseClasses doesn't reference the
other dlls. Here is some code:
BaseClasses.Navigate(String formName)
{
Assembly aCurAssembly = Assembly.GetExecutingAssembly();
CybeReBaseForm oform = aCurAssembly.CreateInstance(sFormName,true);
}
Test.cmd_click()

{
base.Navigate("Insured.InsuredSearch");
}
Let me know if this doesn't make sense or if more info is needed.

--
Thanks,
Leslie
Jul 21 '05 #1
5 1573
Leslie <Le****@discussions.microsoft.com> wrote:
want to be able to pass a formname as a string and have the form displayed.
I have read about using the Type and Assembly or Activator .CreateInstance
and have tried several things but none of it works. Here is my situation. I
have a dll called BaseClasses and it has a class called BaseForm. I then
have another dll called Test and a 3rd dll called Insured. When a button is
pressed I want to have a method in the Test.dll call a method in the BaseForm
that accepts the formname and then the BaseForm will display the form passed
in, such as Insured.InsuredSearch (in Insured.dll). I try to get the
assembly, but it never sees the Insured.InsuredSearch. The Insured.dll and
Test.dll have reference to BaseClasses but BaseClasses doesn't reference the
other dlls.


Having references does basically nothing when it comes to reflection.
You're still looking for the form name within the currently executing
assembly, which probably *isn't* what you're after. It sounds like you
actually want to use Insured.dll.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #2
What is the solution... If what I am looking for is in the reference library
and createinstance wont work? I am trying to keep each type of business in
its own dll and avoid circular dependence when screens in different modules
navigate to other screens.

Thanks,
Leslie

"Jon Skeet [C# MVP]" wrote:
Leslie <Le****@discussions.microsoft.com> wrote:
want to be able to pass a formname as a string and have the form displayed.
I have read about using the Type and Assembly or Activator .CreateInstance
and have tried several things but none of it works. Here is my situation. I
have a dll called BaseClasses and it has a class called BaseForm. I then
have another dll called Test and a 3rd dll called Insured. When a button is
pressed I want to have a method in the Test.dll call a method in the BaseForm
that accepts the formname and then the BaseForm will display the form passed
in, such as Insured.InsuredSearch (in Insured.dll). I try to get the
assembly, but it never sees the Insured.InsuredSearch. The Insured.dll and
Test.dll have reference to BaseClasses but BaseClasses doesn't reference the
other dlls.


Having references does basically nothing when it comes to reflection.
You're still looking for the form name within the currently executing
assembly, which probably *isn't* what you're after. It sounds like you
actually want to use Insured.dll.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #3
Leslie <Le****@discussions.microsoft.com> wrote:
What is the solution... If what I am looking for is in the reference library
and createinstance wont work? I am trying to keep each type of business in
its own dll and avoid circular dependence when screens in different modules
navigate to other screens.


You need *something* to know which assembly to look in. You could pass
that information in, or BaseClasses could know it, but something
certainly has to.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #4
I have searched to find out how to pass the assembly information and can't
find anything. Can you point me to another thread that addresses this issue
or let me know how this can be done?

Thanks

"Jon Skeet [C# MVP]" wrote:
Leslie <Le****@discussions.microsoft.com> wrote:
What is the solution... If what I am looking for is in the reference library
and createinstance wont work? I am trying to keep each type of business in
its own dll and avoid circular dependence when screens in different modules
navigate to other screens.


You need *something* to know which assembly to look in. You could pass
that information in, or BaseClasses could know it, but something
certainly has to.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Jul 21 '05 #5
Leslie <Le****@discussions.microsoft.com> wrote:
I have searched to find out how to pass the assembly information and can't
find anything. Can you point me to another thread that addresses this issue
or let me know how this can be done?


Well, you could either pass the name of the assembly, or if you know a
type in it, you could just do typeof(Foo).Assembly.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Jul 21 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: cgplays.com | last post by:
I have a select-pulldown at http://computergroupplays.com/fb-pres2.asp that changes the 3rd pulldown (Dbase) depending on what the user enters in the 2nd (Wk). My associate wants the values inside...
19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
1
by: bborden | last post by:
Novice Access programmer here. I would like to display an image using the Toolbox Image object by calling the images file name using: =fPictureFiles(!!,1) in the Picture control. Below...
1
by: Adam | last post by:
I am having difficulty retrieving images from a SQL database. Here is the code I use to UPLOAD the image to the database: <form id="Form1" method="post" enctype="multipart/form-data"...
5
by: David Elliott | last post by:
I need a control on a Web Page that can accept an HTML Document and will display it. Any help would be appreciated. Thanks, Dave Here is what I was trying...
3
by: Bob Sanderson | last post by:
I am trying to create a form for a MySQL database similar to a spreadsheet. The idea is to display a list of records, with the last line of the list being an input form. When the user enters data...
14
by: lmttag | last post by:
Hello. We're developing an ASP.NET 2.0 (C#) application and we're trying to AJAX-enable it. We're having problem with a page not showing the page while a long-running process is executing. So,...
3
by: remya1000 | last post by:
i'm using ASP with MSAccess as database. i have two buttons and two textbox in my page. when i press my first button (First month) i need to display the current month in one textbox and last one...
1
by: amritranjan | last post by:
How to retrive image file from MS access database and display this in another JSPpage -------------------------------------------------------------------------------- This is my Jsp code for...
4
by: giandeo | last post by:
Hello experts. I wish to post a string and display the output in the same page. The Scenario: Table name: importer Field name: imp_code, imp_sname, imp_address, imp_tel I have a page...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.