|
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.
|
|
|
|
|
Hi guys.
I have a problem and sorry for the easy (for you) question, but I don't know very well remoting yet.
I must to comunicate between two application on the same machine.
One a web services page with asmx and second a windows application.
It's all ok, and it runs correctly but after some minutes when the web service should comunicates with windows application, it tell me:
System.Runtime.Remoting.RemotingException: No receiver registered.
This is the code:
server
//start the remoting to comunicate with web service
TcpChannel channel=new TcpChannel(1000);
ChannelServices.RegisterChannel(channel);
IuXComunicator obj=new IuXComunicator();
obj.SetServer(this);
ObjRef service;
service=RemotingServices.Marshal(obj,"IuXComunicator");
the class:
public class IuXComunicator:MarshalByRefObject
{
private IuXServer server;
public IuXComunicator()
{
}
public void SetServer(IuXServer Server)
{
this.server=Server;
}
public void SendDueNews()
{
Debug.WriteLine("Requested send news");
server.SendNews(0);
}
}
the client
public class IuXComunicatorClient
{
private static IuXComunicator advisor;
private static TcpChannel channel;
public IuXComunicatorClient()
{
}
public static void AvviseServer()
{
if (channel==null)
{
channel=new TcpChannel(10);
ChannelServices.RegisterChannel(channel);
RemotingConfiguration.RegisterWellKnownClientType(typeof(IuXComunicator),"tcp://localhost:1000/IuXComunicator");
}
advisor=new IuXComunicator();
advisor.SendDueNews();
}
}
Please help me.
|
|
|
|
|
(the relevent code- i think)
Data is a char array of the last 128 bytes of an mp3 file.
String title = new String(data, MP3_TITLE_OFFSET, MP3_TITLE_LENGTH).Trim();
sw = new StreamWriter(fs);
sw.Write(title);
sw.Flush();
sw.Close();
Example problem: title of the mp3 = "intro", but i created a string with 30 bytes(the possible length of a title) so have a string with 25 null characters.
In debug mode, length of title is 5 and doesnt show the null characters.
When title is outputed to a file the 25 null characters are also ouputed.
How do i remove these null characters from the string?
Thanks!
|
|
|
|
|
trimming out a string :
String s = "hello\0\0\0";
char[] cs = { '\0' };
int n = s.TrimEnd(cs).Length;
n = 5
if you start putting in too manay features, it no longer remains useful for beginners
quote in a CP article comment, shiraz baig
|
|
|
|
|
Hi, I find its easier to just read the last 128bytes from a mp3, then as I did this recently, here's my complete ID3 class Cheers
public class ID3v1Tag
{
string TAG;
string songtitle;
string artist;
string album;
string year;
string comment;
byte track;
byte genre;
public ID3v1Tag(byte[] block)
{
if (block.Length != 128) throw new Exception("Black must be 128 bytes in size");
TAG = Encoding.Default.GetString(block, 0, 3);
if (TAG != "TAG") throw new Exception("Not an ID3 v1 tag");
songtitle = Encoding.Default.GetString(block, 3, 30);
artist = Encoding.Default.GetString(block, 33, 30);
album = Encoding.Default.GetString(block, 63, 30);
year = Encoding.Default.GetString(block, 93, 4);
comment = Encoding.Default.GetString(block, 97, 28);
track = block[126];
genre = block[127];
}
public string SongTitle {get {return songtitle;}}
public string Artist {get {return artist;}}
public string Album {get {return album;}}
public string Year {get {return year;}}
public string Comment {get {return comment;}}
public int Track {get {return track;}}
public string Genre {get {return ((GenreType)genre).ToString();}}
private enum GenreType :byte
{
Blues = 0,
ClassicRock,
Country,
Dance,
Disco,
Funk,
Grunge,
HipHop,
Jazz,
Metal,
NewAge,
Oldies,
Other,
Pop,
RnB,
Rap,
Reggae,
Rock,
Techno,
Industrial,
Alternative,
Ska,
DeathMetal,
Pranks,
Soundtrack,
EuroTechno,
Ambient,
TripHop,
Vocal,
JazzFunk,
Fusion,
Trance,
Classical,
Instrumental,
Acid,
House,
Game,
SoundClip,
Gospel,
Noise,
AlternRock,
Bass,
Soul,
Punk,
Space,
Meditative,
InstrumentalPop,
InstrumentalRock,
Ethnic,
Gothic,
Darkwave,
TechnoIndustrial,
Electronic,
PopFolk,
Eurodance,
Dream,
SouthernRock,
Cult,
Gangsta,
Top40,
ChristianRap,
PopFunk,
Jungle,
NativeAmerican,
Cabaret,
NewWave,
Psychadelic,
Rave,
Showtunes,
Trailer,
LoFi,
Tribal,
AcidPunk,
AcidJazz,
Polka,
Retro,
Musical,
RocknRoll,
HardRock,
None = 255,
}
}
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.
|
|
|
|
|
Thanks for all the help.
This is a program I converted from java, the Java Trim works differently from the c# trim when removing whitespace, hadn’t noticed the TrimEnd() method.
I've just discovered that the titles of some mp3s have nuls not just at the end. e.g {O,n,e, ,\0,U,2}. so have written my own method to remove chracters less then 0x20 and greater than 0x7f
|
|
|
|
|
Humpo wrote:
I've just discovered that the titles of some mp3s have nuls not just at the end. e.g {O,n,e, ,\0,U,2}. so have written my own method to remove chracters less then 0x20 and greater than 0x7f
Then they are maybe ID3v2 tags...... My class strictly conforms to the ID3v1.1 specification. If it doesnt work, the TAG it self is WRONG!
Cheers
PS: Good luck if you are try to implement ID3v2, I gave up before even attempting 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.
|
|
|
|
|