Click here to Skip to main content
15,892,199 members
Home / Discussions / C#
   

C#

 
AnswerRe: dll loading? Pin
Christian Graus11-Oct-09 10:28
protectorChristian Graus11-Oct-09 10:28 
AnswerRe: dll loading? Pin
freakyit11-Oct-09 22:22
freakyit11-Oct-09 22:22 
QuestionData Structure Pin
phobberman11-Oct-09 8:05
phobberman11-Oct-09 8:05 
AnswerRe: Data Structure Pin
riced12-Oct-09 6:21
riced12-Oct-09 6:21 
GeneralRe: Data Structure Pin
phobberman13-Oct-09 0:01
phobberman13-Oct-09 0:01 
QuestionTextbox Enter Event Pin
jonneale11-Oct-09 7:26
jonneale11-Oct-09 7:26 
AnswerRe: Textbox Enter Event Pin
N a v a n e e t h11-Oct-09 7:43
N a v a n e e t h11-Oct-09 7:43 
QuestionCreate dll and use it on runtime Pin
bonzaiholding11-Oct-09 7:11
bonzaiholding11-Oct-09 7:11 
Hello,
I have a compiled dll that contain class "MyClasses.dll".
One of the class is called "class1".
In runtime i need to compile a code that used "class1" and i need to used to compile code as dll in the runtime code. How can i do it?

Example:

1. MyClasses.dll contain class1.
class1 look like this:

delegate double GetRank(class1 c1);
public class1
{
public double Num1;
public double Num2;
public event GetMyRank;
}


2. I want to get a string and build a function in rumtime for sorting. for example the user can write n Textbox "Num1*Num2" and then i want to create this function:

public double GetRank1(class1 c1)
{
return c1.Num1*c1.Num2;
}


3. Compile and Create dll that contain this function.(GetRank1)
4. In runtime load the dll for exmple "MyDll.dll"
5. Initialize each instance of class1 with the event "GetRank1" for "GetMyRank" event. :
class1 c1 = new class1();
...
..
c1.GetMyRank= new GetRank(MyDll.GetRank1);
....


6. And then i want to compare 2 instance of 'class1' by this function.


I Allready try to use CodeDomProvider and CompilerParameters but i need the use the dll "MyClasses.dll" in the CompilerParameters and it does not recognize him:

ErrorText: "The type or namespace name 'MyClasses.dll' could not be found (are you missing a using directive or an assembly reference?)"

The second problem is how to use to compiled code in my code at runtime.
for example:
Assembly a = Assembly.GetAssembly(Type.GetType("GetRank1Class"));
and then try to call the function GetRank1.
How can i solve those problems?
AnswerRe: Create dll and use it on runtime Pin
Luc Pattyn11-Oct-09 8:05
sitebuilderLuc Pattyn11-Oct-09 8:05 
QuestionIS there a different in WebService programming in 32bit and 64bit ? Pin
E_Gold11-Oct-09 6:54
E_Gold11-Oct-09 6:54 
AnswerRe: IS there a different in WebService programming in 32bit and 64bit ? Pin
dan!sh 11-Oct-09 7:34
professional dan!sh 11-Oct-09 7:34 
QuestionWindow Address Pin
curtuy11-Oct-09 5:48
curtuy11-Oct-09 5:48 
AnswerRe: Window Address Pin
Luc Pattyn11-Oct-09 5:55
sitebuilderLuc Pattyn11-Oct-09 5:55 
GeneralRe: Window Address Pin
curtuy11-Oct-09 6:03
curtuy11-Oct-09 6:03 
QuestionRe: Window Address Pin
harold aptroot11-Oct-09 5:55
harold aptroot11-Oct-09 5:55 
JokeRe: Window Address Pin
Eddy Vluggen11-Oct-09 6:03
professionalEddy Vluggen11-Oct-09 6:03 
GeneralRe: Window Address Pin
curtuy11-Oct-09 6:05
curtuy11-Oct-09 6:05 
AnswerRe: Window Address Pin
dan!sh 11-Oct-09 7:31
professional dan!sh 11-Oct-09 7:31 
GeneralRe: Window Address Pin
curtuy12-Oct-09 1:14
curtuy12-Oct-09 1:14 
QuestionThreadpool help [modified] Pin
OptiPlex11-Oct-09 5:45
OptiPlex11-Oct-09 5:45 
AnswerRe: Threadpool help Pin
Luc Pattyn11-Oct-09 5:53
sitebuilderLuc Pattyn11-Oct-09 5:53 
GeneralRe: Threadpool help Pin
OptiPlex11-Oct-09 7:04
OptiPlex11-Oct-09 7:04 
GeneralRe: Threadpool help Pin
Luc Pattyn11-Oct-09 7:50
sitebuilderLuc Pattyn11-Oct-09 7:50 
QuestionCall a method using Windows forms Pin
Tamara Clifton11-Oct-09 5:43
Tamara Clifton11-Oct-09 5:43 
AnswerRe: Call a method using Windows forms Pin
dan!sh 11-Oct-09 5:57
professional dan!sh 11-Oct-09 5:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.