|
Thank you for replying my question, but i don't know much about this. Could you please tell me more about this ? Thank you very much
|
|
|
|
|
I'm not sure, to be honest. I have a rough idea, but I was intending mostly to show you enough to put you on the right track.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank you very much! I'll try to find more about this. Have a nice day!
|
|
|
|
|
If you want your application to be associated with a given file extension, you can add the appropriate keys to the registry, like CG said.
Let's say your extension is 'afe' ('arbitrary file extension' ), then you'll have to:
Add a new key HKCR\.afe
Set its standard value to afe_file
Add a new key HKCR\afe_file
Set its standard value to the textual description you want for .afe files.
Add a new key HKCR\afe_file\shell\open\command
Set its standard value to "Full path to your application" "%1"
Now every time you double-click on a .afe-file, your application will get started and given the full path of the file as first commandline parameter.
Regards,
mav
--
Black holes are the places where God divided by 0...
|
|
|
|
|
Thank you very much for your help
|
|
|
|
|
Hey Everybody!
I wrote a multi-threaded crawler (which is doing a more than just crawling).
This is the first multi-threaded program I'm writting so I'm having some problems with it.
I have a 2 groups of threads, one is downloading from the net, the other is extracting the URLs and other information.
I've synchronized the threads using semaphores.
The problem is that sometimes, after the program is running for a while, I'm getting an Exception with the message that the process is trying to perform an I/O (read or write) to an illegal spot in the memory (also it adds that it could be a memory corruption).
I've also experienced a few times that the program simply get terminated, without any warning or any notice (the visual studio simply returns to its original stat from the debug stat).
ANY Ideas how to fix that?!
I'm terribly stuck!
Thanks A LOT!!!!
|
|
|
|
|
Sounds like you are having data corruption, as a result of a lack of
thread synchronization: most data structures are not thread-safe, that is
if one thread is say modifying a List, and another thread suddenly kicks in,
and accesses the same List, it may find it in an inconsistent state.
The one remedy is adding all the required locks; without them, it seems to
work for a while; with them, if applied correctly, it will work forever.
I can't possibly reproduce all the theory here, you should look for either
the lock statement, or some specialized classes such as ReaderWriterLock Class.
|
|
|
|
|
hi there,
i m trying to convert textbox.text to int but it always giving error while runtime
"Input string was not in a correct format."
textbox.text = "00.0000"
nums =Convert.ToInt32(textbox.text);
i also try
nums =int.textbox.text);</
it give error same above
nums =(int)textbox.text;</
it gives error
Cannot convert type 'string' to 'int'
someone know anyother way???;)
Becoming Programmer...
|
|
|
|
|
try:
int nums = int.Parse(this.textbox.Text);
|
|
|
|
|
This will also throw an exception!
All the best,
Martin
|
|
|
|
|
i just want to remove the decimals thats why i m trying to convert it in int as int dont have decimals
i can remove decimals with other methods too but conversion is the best way i thought
Green Fuze wrote: try:
int nums = int.Parse(this.textbox.Text);
same error
Becoming Programmer...
|
|
|
|
|
What you want requires two steps. First, use double.TryParse ( or you will get an error ). Then, use Math.Floor, or Math.Ceiling, if you want to force rounding. Either way, case the double you end up with to an int.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Hello,
As your string represents a double value, you will get a system format exception.
This would work:
string text = "0";
int inums =Convert.ToInt32(text);
text = "00.0000";
double dnums =Convert.ToDouble(text);
But I recommend to use the TryParse methods.
They will not throw an exception.
double d;
if(double.TryParse(text,System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.CurrentCulture, out d))
{
}
else
{
}
All the best,
Martin
|
|
|
|
|
thanks but i dont want decimals remain
Becoming Programmer...
|
|
|
|
|
This will round it mathematical, but you also can use the Math functions or just modify the string.
string text = "1,5345";
double d;
if(double.TryParse(text,System.Globalization.NumberStyles.Float, System.Globalization.CultureInfo.CurrentCulture, out d))
{
int inums = Convert.ToInt32(d);
}
All the best,
Martin
|
|
|
|
|
ok i will
Becoming Programmer...
|
|
|
|
|
Data Entry Validation.
If decimals are illegal values prevent or validate their entry, don't leave your users guessing what the expected entry is.
Rhys
"The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it"
They say a little knowledge is a dangerous thing, but it's not one half so bad as a lot of ignorance."
Terry Pratchett
|
|
|
|
|
|
thanks but i think you replied it after 1 month xD
Becoming Programmer...
|
|
|
|
|
Hi!
I've one question:
I want to send a request to DNS server with type NAPTR. But I don't know how. Help me, plz!!!
|
|
|
|
|
Please explain me the use of keyword internal protected and internal with an example ??
what is the difference between internal protected and internal ??
Can construstor be declared internal protected/internal ?? why or why not???
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
google broken ?
internal means visible only within the current assembly. protected internal presumably means visible only to derived classes within the current assembly.
Yes, you can make a constructor whatever you like. If it's protected, obviously only derived classes can be created, unless a factory method is provided.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Sir actually , google too provides this much information.as far as any example is concerned that , upto this limit i can use the internal member vaiables, and till this limit , i can make use of internal protected.
I mean if u provide any small example , any example.Please
Sonia Gupta
Soniagupta1@yahoo.co.in
Yahoo messengerId-soniagupta1
Love is Friendship and Friendship is Love....
|
|
|
|
|
Is what you mean to ask, why would you use these things ?
Internal is useful for things you want to hide, but which should be visible within a module. For example, if you have a seperate data layer class that you want to be visible only to the entity classes within your module. internal protected allows you to create a base class which is derived from within your module, but which clients of your module are unable to extend.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: protected internal presumably means visible only to derived classes within the current assembly.
I knew I wasn't the only one.
protected internal means it's visible everywhere within the same assembly *and* to all subclasses.
Cheers,
Vıkram.
After all is said and done, much is said and little is done.
|
|
|
|