|
I started working on one, but phew it's gonna take some time still....
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
leppie wrote:
I started working on one, but phew it's gonna take some time still....
Open Source it already!
*->>Always working on my game, teach me
*->>something new.
cout << "dav1d\n";
|
|
|
|
|
I pocket a class in a dll.And the class implement a interface.
and then I load the dll with these code:
Assembly a = Assembly.Load("mydll");
Type t = a.GetType("mydll.myClass");
object obj = Activator.CreateInstance(t);
MyInterface Imyclass=(MyInterface)obj;//this line will cause runtime error;
The biggest problem is that when I use it as below,it can work.
import the dll to my project first.
MyInterface Imyclass=new myClass();
What is the problem??? Anyone can help???
lost my way
|
|
|
|
|
fftongzhi wrote:
Type t = a.GetType("mydll.myClass");
object obj = Activator.CreateInstance(t);
Type t2 = a.GetType("mydll.myClass");
Type t = t2.GetInterface("MyInterface");
MyInterface obj = (MyInterface) Activator.CreateInstance(t);
Does that work?
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
Are you fun me???Interface can not be create a instance.
Type t = t2.GetInterface("MyInterface");
MyInterface obj = (MyInterface) Activator.CreateInstance(t);
Absolutely these codes will make a exception;
Can you make a test before makeing your answer?
lost my way
|
|
|
|
|
fftongzhi wrote:
Type t = t2.GetInterface("MyInterface");
Oops, was pasting from my rusty brain
Type t = a.GetType("mydll.myClass");
//do some test here to make sure class has interface
MyInterface obj = (MyInterface) Activator.CreateInstance(t);
To be honest, I think the problem is as Eric described it. Define your inferface in another assembly, compile once and leave it
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
Apologize for my discourteous words.
I can get the interface in myclass.
let's try again. ( ( ( (
lost my way
|
|
|
|
|
Is the interface compiled along with the assembly that you load? Interfaces have assembly identity, so both the assembly you'll load and the loader need to reference the interface in the same assembly.
There can also be version number issues. If the interface gets recompiled after you've built mydll, the versions won't match.
|
|
|
|
|
Thank you first,but the problem is still here.
I think it doesn't matter with the version.
I made a test like this.
First I build a interface(Imyclass) in a Imyclass.dll;
Reference it in the project of myclass which implemented the Imyclass and build a myclass.dll
And then,reference the Imyclass.dll to the project want to load myclass.dll at runtime.
and these codes will still create a exception(specified cast is not void);
Imyclass ImyCls =(Imyclass)Activator.CreateInstance(t);
In this case,the version of Imyclass.dll will same in each project,and the problem is still going on.
Some thing special is ,in myclass,I used some struct defined by myself for fuction parameters and return value.Is that the problem of system defult serialization???
lost my way
|
|
|
|
|
very lucky,it works.
the problem is I use the interface dll in diffirent version.
Becouse I made a cope of the dll for load,when I update one I missed the other one.hehe............
lost my way
|
|
|
|
|
Is there any tutorials about ADO.NET in C# somewhere that you might know?
I want to learn how to add, remove and update an Access database.
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
Rickard Andersson wrote:
want to learn how to add, remove and update an Access database.
Why not use OleDb ? I can email you a little project I did for my folks's company. Just a Sales Reporting app on Access
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
Yes for sure!
It was OleDB I meant
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
ADO.NET has OleDB classes. Why not use those? Besides that, the System.Data.OleDb.OleDbDataAdapter is sweet. If the functionality is in .NET, why not use it?
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|
|
Can some one help me with how to start setting up an MS-SQL Connection in C#?
|
|
|
|
|
There are some pretty good articles here:
http://www.codeproject.com/cs/database/[^]
Norm Almond: I seen some GUI's in my life but WTF is this mess
Leppie: I made an app for my sister and she wouldnt use it till it was colorful enough
Norm:good point leppie, from that statement I can only deduce that this GUI must be aimed at children
Leppie:My sister is 25
-Norm on the MailMagic GUI
|
|
|
|
|
if i hava a class
class a
{
int a;
CString str;
};
i want to write its object into a file and send that file through a network to different computer and i want to recive that object again if i have the same class there.
may i read the same object on network from a file?
any body can explain my idea into code like
how to write object into file ?
how to read object on the network (having same class there) from file ?
r00d0034@yahoo.com
|
|
|
|
|
Aren't ya in wrong forum now?
Rickard Andersson@Suza Computing
C# and C++ programmer from SWEDEN!
UIN: 50302279
E-Mail: nikado@pc.nu
Speciality: I love C#, ASP.NET and C++!
|
|
|
|
|
on toolbar i want to show show a gif ,
how to do ?
study and user
|
|
|
|
|
bclangren wrote:
how to do ?
Toolbars requiere an ImageList to get the pictures from. The documentation says that an ImageList can be created from a bitmap, icon, or metafile.
But the Add method of the Images property takes an Image as an argument, so you could probably get an Image for the GIF file (or JPG or whatever) with Image.FromFile for example and add it to the imagelist. I have not tried it, but it could work.
-- LuisR
──────────────
Luis Alonso Ramos
Chihuahua, Mexico
www.luisalonsoramos.com
"Do not worry about your difficulties in mathematics, I assure you that mine are greater." -- Albert Einstein
|
|
|
|
|
In winforms, I have a datagrid which loads more than thousand of records. If I select all of them, and copy( ctl+c), the application hangs.I need to kill the application through task manager. However, if choose a reasonable small number of records( 50 for example), it can copy them and paste them in notepad,excel,... in just a second. But if I do not want to limit user to select below certain number of reocrds in order to copy, how should I do to stop application hanging?
Thanks!
|
|
|
|
|
I have two assemblies (1.consoleApp1.exe, 2.Log.dll)
Both assemblies use the same namespace and consoleApp1.exe has a reference to log.dll. My problem is that I can't reference an object from log.dll which is located in consoleApp1.exe. I get the following error message " namespace or type could not be found. Are you missing an assembly or namespace?"
Also note, I can reference log.dll from consoleApp1.exe just fine. It's only the other way around where I'm having problems.
I'm new to this, so any suggestions as to why this is happening would be great.
|
|
|
|
|
ez2 wrote:
Also note, I can reference log.dll from consoleApp1.exe just fine. It's only the other way around where I'm having problems.
Best is too create another assembly with common data and reference them from both You have nice chicken - egg scenario here
Hope this help
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|
|
Can anyone tell me about a simple function that copies all files from one folder in a remote location to a local folder?
For example:
Move all files located in \\Remote\Folder to c:\localfolder
Thanks!
Cintch
|
|
|
|
|
Directory.Move Method
.NET Framework Security:
FileIOPermission for reading from sourceDirName and writing to sourceDirName or destDirName. Associated enumerations: FileIOPermissionAccess.Read, FileIOPermissionAccess.Write
Moves a file or a directory and its contents to a new location.
public static void Move(
string sourceDirName,
string destDirName
);
Parameters
sourceDirName
The path of the file or directory to move.
destDirName
The path to the new location for sourceDirName.
Give them a chance! Do it for the kittens, dear God, the kittens!
As seen on MS File Transfer: Please enter an integer between 1 and 2.
|
|
|
|