Click here to Skip to main content
15,885,278 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello to everybody I want to tell my problem with an examples :

There is no code I have just exe(For example: an exe includes all Products informations) and I want to see that informations when I click button1 (which is in other project).And Can I do this without writing codes .I mean just want to embed the exe into other project and when press button1 I want to see data.İs this possible ?

Same but other example :

I have program and I want to use calculator and someone made a calculator program and I got it's exe and there is no source code. At this point I may not want to write my own calculator program.So I add this calculator.exe that I found into my program.
And in my program there is button1 and when I clicked the button1 I want to show calculator.
Maybe you guys can offer better way to do?

thanks
Posted
Updated 17-Jul-12 20:24pm
v8
Comments
[no name] 16-Jul-12 9:12am    
It's going to be very difficult to answer any of this. First thing is that "Embedded" has very specific meaning in software and I am 99% sure that you are not using the term correctly. For example you say you "embedded login.exe in my ado.net project" which does not make any sense and then you go on to say "ado.net.exe" (not the codes only the exe) which make even less sense. Question 2 does not make any sense. You would know which button was clicked because you coded it.
y.baris 16-Jul-12 9:20am    
for your question2 answer : if I have just login.exe what can I do ?and how can I use button click event without any source code
[no name] 16-Jul-12 9:23am    
If you do not have the code then you would need to go back to whomever the author is and ask them. How are we to know what "login.exe" even does?
y.baris 16-Jul-12 9:21am    
ok I am explaining what I do : I add .exe file as a resource in visual studio IDE. i followed these steps i right click on my main project and then "properties" and then "Resources" and then "Add resource" isn't it how we embed an .exe file? isn't it embedding?
[no name] 16-Jul-12 9:23am    
No that is "adding a reference", hence the action "add a reference"

Attach a method to the button's Click event:
C#
private void Button1_Click( object sender, EventArgs e)
{
    Form1 newForm1Instance = new Form1();
    newForm1Instance.Show();
    this.Close();
}


That should create a new instance of class Form1, show it and close the form that contained the button.
 
Share this answer
 
Comments
y.baris 16-Jul-12 7:14am    
thanks for answer but I think you misunderstand me. I have embedded login.exe in my project and I can't see Button1 or another components.
lukeer 16-Jul-12 7:40am    
In this case, refer to login.exe's documentation to learn how to get knowledge of a button press.
y.baris 16-Jul-12 7:48am    
this is an example and I don't have documentation of them ...my question is can I do without any source code of login.exe
bbirajdar 16-Jul-12 8:31am    
Yes
y.baris 16-Jul-12 8:46am    
aspnet_regiis can you explain how to do ?
If you do not have the source code for this program then there is very little you can do. If you do have it then you need to modify it to do the following. Program1 (login.exe) will need to run independently and on press of a button should call System.Diagnostics.Process.Start()[^], to load whatever program you want loaded, and then terminate. The login.exe program will need to use some parameter or config file to get the name of the application that it wishes to run.
 
Share this answer
 
Comments
y.baris 17-Jul-12 5:05am    
Thanks for answer.but I managed to add the ado.exe into my login project using System.Diagnostics.Process.Start()but no data shows (when I pressed the button1 (which is in login project).
How can I see all my data ?
Richard MacCutchan 17-Jul-12 5:38am    
No idea, you really need to explain in more detail what is happening and show some of your code to demonstrate the problem. Please use the Improve question link above and add to your query.
y.baris 17-Jul-12 6:20am    
ok I am explaining what I did : I add .exe file as a resource in visual studio IDE. i followed these steps i right click on my main project and then "properties" and then "Resources" and then "Add resource" isn't it how we embed an .exe file? isn't it embedding.then I want to run when I pressed the button1 which is in my project.
now a little clear ?or not ?
Richard MacCutchan 17-Jul-12 6:32am    
You cannot add exe files as resources and somehow expect to be able to run them. As I said previously please go to your question, click on the "Improve Question" link, and explain there exactly what you are trying to do.
y.baris 17-Jul-12 6:56am    
For example this example can explain what I want to do :
I have program and I want to use calculator and someone made a calculator program and I got it's exe and there is no source code. At this point I may not want to write my own calculator program.So I add this calculator.exe that I found into my program.
And in my program there is button1 and when I clicked the button1 I want to show calculator.
Maybe you can offer better way to do?
i have 2 diffrent project on c# windows form i want to merge in single platform in c# form how can i do thos? please tell me fast
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900