|
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.
|
|
|
|
|
No ID3v2 tags.
I have over 8,000 MP3s, my program scans the disks for them and produces a list of mp3s in html. Unfortunately I never created the mp3s for most of the tracks, so some may have no tag at all, or a corrupt tag depending on how they were created – not seen any ID3v2 tags yet. If there is no tag, I simply use the file name.
thanks
|
|
|
|
|
I am writing Windows application in C# (VS .NET Release). When exception is thrown by framework in some function (for example, I try to call function of the object which is not created), Visual Studio debugger doesn't point to the line which caused the exception. Instead of this it points to the last line of Main function:
static void Main()
{
Application.Run(new Form1());
} // <- debugger points here
Stack window contains this line and all other lines point to .NET functions.
I found some workaround. In Debug - Exceptions dialog there is exception handling algorithm:
When exception is thrown:
- Break into debugger
- Continue
Standard choice is "Continue". If I change it to "Break into debugger", I have full exception information (stack contains all my functions, debugger points exactly to the needed line).
However, this is not a good solution. If I throw exception in my program, debugger breaks on it also.
|
|
|
|
|
Does anyone have a list of the equivilent data types in C# of the MS defined data types of HWND, HANDLE, DWORD, etc..
I need it so I may use it to define some WinAPI calls I need.
Thank you
Raiko
|
|
|
|
|
IntPtr
if you start putting in too manay features, it no longer remains useful for beginners
quote in a CP article comment, shiraz baig
|
|
|
|
|
You can use Marshal.PtrToStructure to convert your unmanaged to managed object.
Mazy
"If I go crazy then will you still
Call me Superman
If I’m alive and well, will you be
There holding my hand
I’ll keep you by my side with
My superhuman might
Kryptonite"Kryptonite-3 Doors Down
|
|
|
|
|
Raiko wrote:
HWND, HANDLE, DWORD
HWND, HANDLE = IntPtr
DWORD (double word) = int (or uint if data is to big)
Have a look at this table(sorry no web link):
Marshaling Data with Platform Invoke[^]
Have a look at the Platform Invoke Data Types link, it has a nice table for most conversions
Cheers
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.
|
|
|
|
|
That helped out alot
unfortunately, my findwindow call always returns 0.. That is, when I output it in a messagebox by converting it to a string. How do you put NULL into a string?
[DllImport("user32")]
public static extern System.IntPtr FindWindow(string lpClassName, string lpWindowCaption);
How it's declared..
|
|
|
|
|
I implement ::FindWindow in this[^]article.
if you start putting in too manay features, it no longer remains useful for beginners
quote in a CP article comment, shiraz baig
|
|
|
|
|
Raiko wrote:
How it's declared..
[DllImport("user32")]
public static extern System.IntPtr FindWindow(int makemezero, string lpWindowCaption);
NULL = 0, not null
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.
|
|
|
|
|
|
There is no tool as far as I know (someone from MS responded this in a public MS NG).
But it's an interesting challenge. After all, controls declared in the .rc file must be mapped to C# code. For the set of common controls, I guess it should be easy to do it. The only issue is about dialog units, and stuff like that.
Sh*t...another item in my tasklist..
if you start putting in too manay features, it no longer remains useful for beginners
quote in a CP article comment, shiraz baig
|
|
|
|
|