|
This line passes the format provider to the String.Format method
Console.WriteLine( String.Format( provider, messageStr, argToConvert ) );
String.Format calls the GetFormat method on the provider to get the formatter. You can look at the Code in for String.Format in reflector to see what's going on. (Haven't tried this myself)
You can see this in the debugger by sticking a breakpoint in the GetFormat method and waiting till it is hit then looking at the call stack. (Debug->Windows->CallStack (Ctrl+D,C))
Simon
|
|
|
|
|
Thanks Simon!
My study result is, when calling String.Format( provider, messageStr, argToConvert ),
1.
provider.GetFormat is called and returned an intance of AnyRadix;
2.
Then Format method is called on the returned instance of AnyRadix, and messageStr/argToConvert are passed as formatString/argToBeFormatted parameter, and a string is returned from Format method -- the returned string is also treated as the result of String.Format call -- String.Format( provider, messageStr, argToConvert ).
My analysis correct?
regards,
George
|
|
|
|
|
Sounds about right. Like I say, I haven't looked in reflector myself.
Simon
|
|
|
|
|
Thanks for your help, Simon!
regards,
George
|
|
|
|
|
I have to deploy my application which uses MS SQL Express as a database. I have to deploy my program to end-user who knows nothing about database configuration. How can I deploy my project and MSSQL express with one MSI installation package. I've found an answer in expert-exchange, but they won't let me in, as I have to pay. Thanks you guys
|
|
|
|
|
1st, try the databases forum. This one is for c# questions.
2nd. If you scroll to the very very very bottom of the experts exchange page, they have all the answers uncovered for free. (Yes, I know it's weird, it's some kind of advertising con to get people to pay them for free content)
Good luck
Simon
|
|
|
|
|
hi!
i m using c# , i used EXpTreeLib.dll , tree view and one more dll Emmaculate.dll , thumbnelview , the
probelm is that when i making a setup using Setup&deployment wizard i added both dll , project is working
fine but when i open this form then the unhandeled exception occured Error path not found etc in other
system not mine , in my pc when i running the project is working fine , may its not getting control path
what should i do .................plz help me
i think i should register the dll in other system on which i m running the exe but ,
when i register the both dll , ExpTreeLib.dll , emmaculate.dll in other system in which i m running exe
after making setup
error occure dll not register entry point not found.
in my pc project running fine , setup complete fine and also exe running fine but when i deploy in other
system then its making a problem in that form that is using both dll.
Entry point not found ..............
on run :
regsvr32 c:\ExpTreeLib.dll
error occure entry point not found may i registed that dll so its resolve the above problems.
Love is Life & Life is Love!
|
|
|
|
|
nomi wrote: entry point not found
Likely cause might be that method Main is missing.
|
|
|
|
|
dani thanks to reply , yar i wanna know that y its running fine in my system and when i deploy on other system then this form is generate a error , path is not missing unhadeled exception etc in this form i just use two dll that i define earlier so what should i do , should i register the dll or what can i do , and how to know where is the error , means main cause of the error ......
Love is Life & Life is Love!
|
|
|
|
|
Are you providing right function name and passing right arguments while calling the function of the dll?
|
|
|
|
|
yes offcourse bcz its running fine on my system , error occure in other computer when i running the exe of the project , error just occure in particular form others are working fine
may dll not getting its path , i dont understand how can i know what is the source of error
Love is Life & Life is Love!
|
|
|
|
|
here i have created one of user control in C#, and i want make it to Activex Control, how can i call the dll without contain any interface in my application, i have only the events like click, plug..........
here how can i too cal that dll into Javascript........
|
|
|
|
|
i am trying to pick a image file from open dialog box and send to other user in C#.net
private System.Windows.Forms.OpenFileDialog openFileDialog1 = new OpenFileDialog();
openFileDialog1.RestoreDirectory = true;
openFileDialog1.FileName = "";
openFileDialog1.Filter = "Graphic Interchange Format (*.gif)|*.gif|" +
"JPEG File Interchange Format (*.jpg;*.jpeg)|*.jpg;*.jpeg";
if (openFileDialog1.ShowDialog() == DialogResult.OK)
{
string filename = openFileDialog1.FileName.Substring(openFileDialog1.FileName.LastIndexOf("\\") + 1);
File.Copy(openFileDialog1.FileName, Application.StartupPath + "\\Temp\\" + filename, true);
string fname = Application.StartupPath + "\\Temp\\" + filename;
if(File.Exists(fname))
WhiteBoard1.iSelected = fname;
FileInfo info = new FileInfo(WhiteBoard1.iSelected);
long filesize = info.Length;
if(filesize>0)
{
WhiteBoard1.strConfid = strConfid;
WhiteBoard1.LoadImage();
}
}
In whiteboard class
public void LoadImage()
{
try
{
Graphics grphs = CreateGraphics();
if(File.Exists(iSelected))
{
Image img1 = Image.FromFile(iSelected);
pict.Image=img1;
}
}
catch(OutOfMemoryException)
{
MessageBox.Show(msg.ToString());
}
}
I get exception as
OutofMemory Exception
|
|
|
|
|
How big is the file ?
asma_panjabi wrote: string filename = openFileDialog1.FileName.Substring(openFileDialog1.FileName.LastIndexOf("\\") + 1);
getting file name ? Use System.IO.Path.GetFileName()
|
|
|
|
|
It doesnt work for any size of file
|
|
|
|
|
sometimes it executes for .jpg but it never takes .gif file. Please some solution for it.
|
|
|
|
|
asma_panjabi wrote:
string filename = openFileDialog1.FileName.Substring(openFileDialog1.FileName.LastIndexOf("\\") + 1);
File.Copy(openFileDialog1.FileName, Application.StartupPath + "\\Temp\\" + filename, true);
string fname = Application.StartupPath + "\\Temp\\" + filename;
Whats all this part about? Why not just use the path that the OpenFileDialog gets?
Also, why do you have a Graphics grphs = CreateGraphics(); it doesn't get used in the code you posted and idealy you shouldn't be using it anyway. If you want to draw to your form you should do it in the OnPaint event.
I mean, that Graphics object could be the thing causing your problems, try moving it out of the try block and see what happens.
My current favourite word is: I'm starting to run out of fav. words!
-SK Genius
Game Programming articles start - here[ ^]-
|
|
|
|
|
I need to send the image from one user to other so i have to copy the file to my drive. So
File.Copy(openFileDialog1.FileName, Application.StartupPath + "\\Temp\\" + filename, true);
string fname = Application.StartupPath + "\\Temp\\" + filename;
I have removed Graphics grphs = CreateGraphics(); from try catch but no gain in that. Plz help
|
|
|
|
|
|
Is it possible to change the order of nodes in treeview control? I wanted to move a node which don't have any child node to one step above. am using c# and winforms dotnetframework is 2.0
|
|
|
|
|
Remove the TreeNode in question from one TreeNodeCollection and put it in another or insert it back into the TreeNodeCollection at a different spot, depending on what "one step above" means. Also look at TreeView.Nodes and TreeNode.Nodes.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
TreeNode parent = myNode;
TreeNode child = parent.Nodes[0];
child.Remove();
parent.Parent.Nodes.Add(child);
child.Nodes.Add(parent);
This statement is false.
|
|
|
|
|
Please give me a code for Binary,Hexadecimal,and Octal Systems to Decimal System in Turbo C or in C++...
|
|
|
|
|
Mark Arjim Parba wrote: Please give me a code ...blah... Turbo C or in C++
Please read point # 1, 2, 3 and 9 in this post[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|