convert

Converting LPCWSTR with WideCharToMultiByte. Need help.

i have a function like this: BOOL WINAPI MyFunction(HDC hdc, LPCWSTR text, UINT cbCount){ char AnsiBuffer[255]; int written = WideCharToMultiByte(CP_ACP, 0, text, cbCount, AnsiBuffer , 0, NULL, NULL); if(written > -1) AnsiBuffer[written] = '\0'; if(written>0){ ofstream myfile; myfile.open ("C:\\example.txt", ios::app); myfile.writ...

Inject custom type conversion to .NET library classes

I would like to implement conversion between two library classes by Convert.ChangeType in C#. I can change neither of the two types. For example converting between Guid and byte[]. Guid g = new Guid(); object o1 = g; byte[] b = (byte[]) Convert.ChangeType(o1, typeof(byte[])); // throws exception I am aware that Guid provides a ToByteA...

How Do I Downgrade a C++ Visual Studio 2008 Project to 2005

How can I downgrade a C++ Visual Studio 2008 project to visual studio 2005? Maybe there is a converter program that someone knows of or otherwise a process that I can undertake. Thanks. ...

How to get the content from HTML using VB6

How can i get the content from HTML, removing the elements around it. I am looking for an example using VB6 ...

Linux tool: convert

The system I'm using uses the linux utility convert to convert pdfs to jpgs. My box gives me the following error. >$ convert Badge-1114044091.pdf Badge-1114044091.jpg convert: Postscript delegate failed `Badge-1114044091.pdf'. convert: missing an image filename `Badge-1114044091.jpg'. But the production machine does not. According to ...

Escaped unicode to unicode character in Cocoa

I get from a NSURLConnection a NSData object which I convert with [[NSMutableString alloc] initWithData:[self urlData] encoding:NSUTF8StringEncoding] to a NSMutableString. After some "revision" I display it in a NSTextField. But when the response contains a more-than-utf8-string this is displayed: This "&#x27A1" should be one unico...

In SQL how can I convert a money datatype to a decimal?

I want to convert a money datatype to a decimal, because I want to record the results to 8 decimal places. For example, in a currency rate table I see the rate stored as 2871047428.20 as a money datatype; using Microsoft SQL Management Studio, I want to divide that by 10000000 in order to achieve the result 287.10474282; however the res...

How to convert CFStringRef to NSString?

NSString *aNSString; CFStringRef aCFString; aCFString = CFStringCreateWithCString(NULL, [aNSString UTF8String], NSUTF8StringEncoding); aCFString = CFXMLCreateStringByUnescapingEntities(NULL, aCFString, NULL); How can I get a new NSString from aCFString? ...

Best way to convert Delphi code to C++?

I have an application written in Delphi that compiles in Delphi 2007. I think it was originally written in Delphi 7. Anyway, I need to convert all the core non-GUI code into C++ because I want to release a Mac version of the software. What is the best way to do this? Any shortcuts I can take to speed up the process? EDIT: The code com...

How to convert strings into integers in python?

Hello there, I have a tuple of tuples from MySQL query like this: T1 = (('13', '17', '18', '21', '32'), ('07', '11', '13', '14', '28'), ('01', '05', '06', '08', '15', '16')) I'd like to convert all the string elements into integers and put it back nicely to list of lists this time: T2 = [[13, 17, 18, 21, 32], [7, 11, 13,...

How to convert string into float in javascript?

I have a datagrid and I get 2 column's value by javascript. These fields are numeric and when fields have comma (ex. 554,20), I cant get the numbers after comma. I tried parseInt, parseFloat. How can I solve it? ...

Convert Wordpress theme to plain XHTML+CSS

So there is a lot of posts on the internet about how to convert your XHTML+CSS theme to Wordpress, but I have a Wordpress theme and want to convert it (or un-convert it) back to just XHTML+CSS. Has anyone done this before? Anyone know of any resources (tutorials etc.) that I can use to help me do this? Thanks ...

Best tool to convert my SQL Server database to Oracle

I need a tool that will convert my SQL Server database to Oracle 10. A have found many of them but which is best? ...

F# convert Array2 into a list

I'm still new to functional programming so if I can't figure out how to do something I revert back to procedural style. I found a way to get around having to convert to a list but I'd still like to know how. Here is my attempt to convert a two dimensional array to a list. let board = Array2.init 10 20 (fun i j -> pull(i, j)) let muta...

How can I convert code from Fortran77 to Visual Fortran?

I need to convert a code from Fortran77 to Compaq Visual Fortran. Is it possible? If "yes": is it also possible to save the results in a form that can be imported in EXCEL 2003? ...

C convert hex to decimal format

Hello, Compiling on linux using gcc. I would like to convert this to hex. 10 which would be a. I have managed to do this will the code below. unsigned int index = 10; char index_buff[5] = {0}; sprintf(index_buff, "0x%x", index); data_t.un32Index = port_buff; However, the problem is that I need to assign it to a structure and t...

Use XSLT Variable as Field Name

Hi .... I have an XSLT variable that I'm creating and populating with the value of an attribute at the top of the style sheet like so ... <xsl:variable name="MyAttributeValue" select="/Source/Fields/Field[@SpecialAttribute]/@MyAttributeValue" /> Later on in the processing, I want to use $MyAttributeValue as a field name just lik...

Need help with Converting Points to Shapes

below are a whole length of code i have copied from NEHE Production (Lesson 25).. i was just trying to play around but seem to not able to change/convert each points into a individual spheres nor cylinder.. somehow when i did my adjustment they are not arranged in the way they are suppose to and they won't rotate.. i planed to add light ...

python convert microsoft office docs to plain text on linux

Any recomendations on a method to convert .doc, .ppt, and .xls to plain text on linux using python? Really any method of conversion would be useful. I have already looked at using Open Office but, I would like a solution that does not require having to install Open Office. ...

C#: Cannot convert from ulong to byte

Hello, Strange how I can do it in C++,but not in C#. To make it clear,i'll paste the two functions in C++ and then in C# and mark the problematic lines in the C# code with a comment "//error". What the two function does is encoding the parameter and then add it in to a global variable named byte1seeds. These are the functions in C++ ...