|
-
Jul 27th, 2004, 01:15 PM
#1
Thread Starter
Frenzied Member
forms across projects in the same solution
hi all,
I have made a new solution, with two projects inside it,
1 - A Windows Application
2 - a class library, i use to store routines so that i can use them in the next projects.
now , look .
i have the main midi form in the project no. 1 , but the routines in project no. 2 needs to have access to the instance of the main form from project no.1 so that it can show dialogues on it and so on.
if i make the main form as a separate class in a new project , then the main form will lose connection to it's childs ( Same Problem Again).
I tried to make a refernce of the project 1 but the compiler said that you can only reference DLL file / Projects.
I just need a technique to expose the type of the main midi form to other project in the same solution
THx i Advance
BST RGDS
-
Jul 27th, 2004, 02:39 PM
#2
Frenzied Member
All you can do is pass a reference into the functions in Project 2. For instance:
VB Code:
Public Sub EatPasta(ByRef frmDisplay as Form)
~Peter

-
Jul 27th, 2004, 06:19 PM
#3
PowerPoster
Originally posted by MrGTI
All you can do is pass a reference into the functions in Project 2. For instance:
VB Code:
Public Sub EatPasta(ByRef frmDisplay as Form)
Please excuse my lack of understanding but could you explain with exact code please?
What do you put in form1 of Project1 and form2 of Project2.?
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
-
Jul 27th, 2004, 08:23 PM
#4
Frenzied Member
since it's in the same solution, a reference should already be made to project x from project y i believe, shouldn't he be able to create an instance of that class (assuming it's public) and call it's methods (the function)?
-
Jul 28th, 2004, 01:52 AM
#5
Thread Starter
Frenzied Member
well fellows, the problem is like that
in the library project
[vb/code]
public sub tryx ( xx as form)
{
' Some Code Here
}
[/Highlight]
The problem when executing that i pass a specific kind of form
like this
VB Code:
dim x as new frmmain
tryx (x) '''''''ERROR Appears HEre - Type is not the same (Form <> frmmain) , and of course i cant see the frmmain type from the library project and i will not make two identical copies of the main form as it is very stupid.
THX in advance for your interests
-
Jul 28th, 2004, 04:40 AM
#6
PowerPoster
Originally posted by Andy
since it's in the same solution, a reference should already be made to project x from project y i believe, shouldn't he be able to create an instance of that class (assuming it's public) and call it's methods (the function)?
Have you tried to do that yourself?
Taxes
The more I learn about VB.NET the more I like dBaseIII Plus
The foregoing, whilst believed to be correct, is given without guarantee as to it's accuracy and entirely without recourse. You are required to decide for yourself whether or not it is suitable for your purposes and no liability for loss of any nature can be entertained.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|