convert

Converting String^ to std::string (basic string) -> Error. How can I fix this?

I try to convert a String^ to basic string...but I get the error after this code. What does it mean and how can I fix it? I need to input basic string into a class constructor. The string^ would not work. System::String^ temp = textBox1->Text; string dummy = System::Convert::ToString(temp); error C2440: 'initializing' : cannot convert...

Convert string with commas to float

Is there a built-in Delphi function which would convert a string such as '3,232.00' to float? StrToFloat raises an exception because of the comma. Or is the only way to strip out the comma first and then do StrToFloat? Thanks. ...

Java Question, how to get the value of a method from an unknown object

I have lots of object defined in the system, perhaps 1000 objects, and some of them have this method: public Date getDate(); Is there anyway I can do something like this: Object o = getFromSomeWhere.....; Method m = o.getMethod("getDate"); Date date = (Date) m.getValue(); ...

Difference between Convert.ToInt32(string) and Int32.Parse?

Exact duplicate: http://stackoverflow.com/questions/18465/net-parse-verses-convert can anyone help me? ...

How can I make my old Dbase 2 progs run under SQL?

How can I make my old Dbase 2 progs run under SQL? I want to do two things. have my old Dbase progs run under windows with huge datasets on my personal computer (so it would have no internet need) and 2. Have my old dbase progs run from an sql server on the internet where I could log on form the internet and work the program and dat...

HowTo put region of Pyglet image into PIL Image?

My app reads frames from video (using pyglet), extracts a 'strip' (i.e. region - full width by 1 to 6 video lines), then pastes each strip (appends it) into an image that can later be written out an *.png file. Problem is Pyglet GL images are stored in graphics memory, so are very limited re size. My current klunky workaround is build u...

NSString initWithBytes isNotEqualTo error

Hi all, i am using soap request in my application and using initWithBytes to convert the retrieved NSMutableData to NSString. NSString *theXML = [[NSString alloc] initWithBytes: [webData mutableBytes] length:[webData length] encoding:NSUTF8StringEncoding]; while i am running the app on the simulator everything works fine. but at the...

How can I make this declaration work?

EDIT: I also got an answer to make sector a vector of vectors: vector<vector<char>>sector; and that gets rid of the rest of my errors. EDIT: I've made sector an array of pointers as someone suggested, and still get three errors: EDIT: I have edited the program, but it has not fixed all of the errors: I have this section of a progra...

How to convert FlowDocument to rtf .

Hi, I have used a WPF RichTextBox to save a flowdocument from it as byte[] in database. Now i need to retrieve this data and display in a report RichTextBox as an rtf. when i try to convert the byte[] using TextRange or in XAMLReader i get a FlowDocument back but how do i convert it to rtf string as the report RichTextBox only takes rtf...

How to convert a sbyte[] to byte[] in C#?

I've got a function which fills an array of type sbyte[], and I need to pass this array to another function which accepts a parameter or type byte[]. Can I convert it nicely and quickly, without copying all the data or using unsafe magic? ...

How do I convert date formats in Perl without importing external modules?

Probably an easy answer: how do I convert this without importing external modules? I've read the CPAN but couldn't explicitly pinpoint a method that does the following: Convert: 20080428 to 28-APR-08 Any ideas? Even directing me to a tutorial would be appreciated. Regards, PIAS ...

Convert IntPtr to int* in C#?

I have a C++ DLL returning an int* to a C# program. The problem is the int* in C# remains null after the assignment. When I assign the C++ result to an IntPtr, I get a correct non-null value. However any attempt to convert this to an int* results in null. I've tried: IntPtr intp = cppFunction (); // Non-null. int* pi = (i...

How does one convert a Visual Studio .NET 2008 solution to Visual Studio .NET 2005?

Assume that a solution only contains classes and that those classes are all written to .NET 2.0 specifications. If that solution were to be opened, converted and saved in Visual Studio 2008, would it be possible to reopen the solution later in Visual Studio 2005 with some minimal modifications to the .SLN file? How would one go about d...

ByteArrayOutputStream to CharBuffer

I have an input ByteArrayOutputStream and need to convert that to a CharBuffer. I was trying to avoid creating a new string. Is there anyway to do this. I was trying to do the following, but I don't have the encoding for the string so the code below will not work (invalid output). ByteBuffer byteBuffer = ByteBuffer.wrap(byteOutputStr...

The easiest way to convert a PHP script into OpCode using C#?

Hi, What is the easiest way to convert a PHP script (.php) into OpCode/Bytecode (Operation Code) using C#? I can use DLLs if I have to. I need this to be done for the project I am working in order to analyze PHP code easier. Any thoughts or ideas are welcome. ...

How to convert an Indexed pixel format image to a 32-bit image?

I have an image that I get and attempt to load into a graphics object using Graphics.FromImage(image), however this throws an exception if the image has an indexed pixel format. Is there a way to safely convert an indexed image? Update: Thanks to Joe for the tip to just draw the old image over the new one, instead I was trying to conve...

Converting a collection.foreach from c# to VB.Net

In C# i just put the method in the parentheses that i want to run on each row of the collection, but it isn't working in VB.NET. ex: SubSonic.PartCollection Parts; ... Parts.ForEach(TestMethod); I've tried this in VB.Net, but it's not compiling, and i'm not quite sure what I'm missing. Dim Parts as SubSonic.PartCollection ... parts....

any PHP or Ruby library to convert Tranditional Chinese to Simplified Chinese or vice versa?

any PHP or Ruby library to convert Tranditional Chinese to Simplified Chinese or vice versa (Big5 <--> GB)? the iconv library won't do it as it merely convert the encoding -- the glyph stays the same. ...

Can I convert long to int?

I want to convert long to int. If the value of long > int.MaxValue, I am happy to let it wrap around. What is the best way? ...

Converting Double to String in C++

Hi guys I am having some issues trying to convert a double to C++ string. Here is my code std::string doubleToString(double val) { std::ostringstream out; out << val; return out.str(); } The problem I have is if a double is being passed in as '10000000'. Then the string value being returned is 1e+007 How can i get th...