|
-
Jun 26th, 2009, 08:17 AM
#1
Thread Starter
Addicted Member
[RESOLVED] I can't merge two projects into one
Sorry I'm new to C#
I'm trying to implement a Wizard from http://www.codeproject.com/KB/dialog/tswizard.aspx
That solution comprises two projects, one of which is wizard class library and another one is demo window application.
Somehow I can't merge those two projects into one. I get all kinds of errors.
Any help would be appreciated.
Thanks in advance
Last edited by winterslam; Jun 29th, 2009 at 08:30 PM.
-
Jun 26th, 2009, 11:57 PM
#2
Re: I can't merge two projects into one
Noone ever said you were supposed to be able to merge two projects into one. You should just keep the wizard control or whatever in a DLL project and then reference that from your application, which is exactly what the demo does. If you put all the wizard code into your application then how will you use it again in the next application? You'd have to copy all the code into every application you wanted to use it in, which is silly. The whole point of DLLs is that they contain reuable components so you don't have to write the same code over and over.
-
Jun 27th, 2009, 12:33 AM
#3
Thread Starter
Addicted Member
Re: I can't merge two projects into one
Thanks for reply
So is there absolutely no way to combine the wizard class and the application?
I just have some problems with the reference names and namespaces. I hope someone could help me out.
I want to combine just to reduce the complexity of my whole project
-
Jun 27th, 2009, 12:45 AM
#4
Re: I can't merge two projects into one
 Originally Posted by winterslam
So is there absolutely no way to combine the wizard class and the application?
No automatic way, no. You can certainly do it by hand.
 Originally Posted by winterslam
I just have some problems with the reference names and namespaces. I hope someone could help me out.
Maybe that's the issue you should have asked us about in the first place. Given that still haven't told us what those problems actually are, help on that front is unlikely at this point.
 Originally Posted by winterslam
I want to combine just to reduce the complexity of my whole project
Combining those two projects is not going to achieve that. You reference all the DLLs from the Framework already. Is that complex? Referencing a library and importing a namespace is a few mouse clicks:
1. Click the Add button on the References page of the project properties.
2. Navigate to the DLL or project you want to reference and click OK.
3. Check the namespace you want import.
Like I said, even if you did combine those two projects, what happens next time you want a wizard? Will you combine projects again, or would referencing a DLL be less complex?
-
Jun 27th, 2009, 07:06 AM
#5
Thread Starter
Addicted Member
Re: I can't merge two projects into one
Of course I'm aware that it can't be done automatically.
I was trying to do manually but to no avail
I changed the wizard project type from class library to windows app.
Then I imported the forms and resources from the windows app project.
What else does it need to be done?
-
Jun 27th, 2009, 09:25 AM
#6
Thread Starter
Addicted Member
Re: I can't merge two projects into one
Code:
public class DemoWizard : TSWizards.BaseWizard
{
private System.ComponentModel.IContainer components = null;
public DemoWizard()
{
// This call is required by the Windows Form Designer.
InitializeComponent();
// TODO: Add any initialization after the InitializeComponent call
Logo = new Bitmap(typeof(DemoWizard), "customLogo.jpg");
}
This line is causing the problem
Logo = new Bitmap(typeof(DemoWizard), "customLogo.jpg");
The debugger says "Resource 'customLogo.jpg' cannot be found in class TSWizards.DemoWizard
-
Jun 27th, 2009, 09:17 PM
#7
Re: I can't merge two projects into one
 Originally Posted by winterslam
Of course I'm aware that it can't be done automatically.
I was trying to do manually but to no avail
That's the exact opposite of what I said. I said that is can't be done AUTOMATICALLY. The only way it CAN be done is manually. You're just not doing it correctly.
This line is causing the problem
Logo = new Bitmap(typeof(DemoWizard), "customLogo.jpg");
The debugger says "Resource 'customLogo.jpg' cannot be found in class TSWizards.DemoWizard
So you need to add the resource. If that code was in the original DLL project and that project contained that resource and now you want to use that code in a different project then you need to add that resource to the new project.
I still say that what you're doing is a very bad idea and you should simply keep it as two projects. That is a better way to go for several reasons that I'm not going to repeat.
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
|