Windows application ANSI to Unicode - c

I have made a mistake by developing a big Windows application that supports only ANSI. What are all the impacts, if my application doesn't support Unicode? Also, I am planning to migrate my code to Unicode. As, I am completely blocked due to the critical time factor of my task, could someone help me?
My target environment: XP, Windows Vista, Windows 7 (both 32 bit and 64 bit). It's enough if my application supports only English, but it should run anywhere in the world.
Note: I am not getting input from the user as strings.

What are all the impacts, if my application doesn't support unicode?
It probably won't be able to deal with Unicode in
UI elements (no problem is your UI doesn't have any text entry facilities)
File paths
Text file content
Translation messages (no problem as you state English to be enough)
File formats like XML
Registry data (I think)
I won't claim to have listed all the impacts. I'll make this a community wiki, feel free to add to the list.
i am planning to migrate my code to Unicode? […] could some one help me?
The first sentence is not a question, is it? I doubt SO is the right place to search for people who'll help you porting a “big” application, except by answering specific questions whenever you get stuck.

I guess this MSDN link should help you understand better about using unicode.
http://msdn.microsoft.com/en-us/goglobal/bb688113.aspx
Also, refer to the w3c documentation at:
http://www.w3.org/International/articles/unicode-migration/
They pretty much cover most of the answers, to your question.

Related

Issues with VICE

I have recently started using VICE, specifically x64sc, and I was thinking of coding a game for it. However, I know almost nothing about what I want to do, and the manual isn't very helpful either. Some issues are particularly hard to overcome, and so far I can't find any solution
How do I copy files from a 1541 to an FD-4000? I was going to compile multiple basic extensions together to create a sort of all-in-one extension, but I don't know how to do that either.
How do I replace the kernal ROMs? My intention with this is to implement a fastloader that will work with a virtual FD-4000.
How do I get a virtual FD-4000 to work in VICE?
How do the tape images work? So far I haven't been able to find a conclusive answer.
I have downloaded some basic extensions, but I am not sure whether they are all compatible with the C64. As such, I would like to know information about the following programs, primarily if they are compatible.
apsoft-64
basic lightning v1.2
basic4.0
Basic expansion 4.5
c64 basic v3.5
DotBASIC
Game BASIC
Graphics basic
laser basic
metabasic
metabasic plus
modem basic v1.2
northcastle structured basic v1.7
tape master pro 2
ultra basic
Please let me know is there is a more appropriate place to post this.

Is there a complete example/tutorial (or at least an alternative to wxODBC) for CodeBlocks + Postgres

I am just starting to program Code::Blocks with Postgres. I haven't tried any other DB platform either with it.
So far I've found that DB connections and coding can be done using wxODBC. wxWidgets is what I use for the UI. I found this: http://docs.wxwidgets.org/2.8/wx_odbcoverview.html
But I found these lines regarding postgres on the web page.
Does not support the keywords 'ASC' or 'DESC' as of release v6.5.0
Does not support sub-queries in SQL statements
So I'm concerned about even the simplest queries being able to run.
My key question: Is there a complete example/tutorial on how to use wxODBC with Code::Blocks? If so, I'd appreciate a link.
Secondary questions:
If there's such an elementary problem, what is the workaround?
Is wxODBC the default way of doing things or is there a better/easier way of doing it?
A million thanks!
After much searching AND testing, I have come up with the following conclusions as my answer and I hope this will benefit others considering the use of wxWidgets with C++.
There is documentation on http://docs.wxwidgets.org but this is not very useful because of the way it's presented.
There's a samples folder that you get with wxWidgets. This provides quite a number of complete examples. Unfortunately if you're a new coder to code::blocks, you'll have trouble opening these projects. This is because most of them are not meant for or built with code::blocks but with other systems like Borland C++ or MS VC++. But you can still open the files using your editor or code::blocks.
I'd advise against the use of wxODBC because with different DB platforms it has different issues. Two such cases are shown in my question above. But I guess this is a 'phase' of the project and I hope it gets fixed. And until then, it's not for me or any other serious business that plans to use my combination (C++ with Postgres).
wxODBC is not the default. there's no such thing as the default. But libpqxx is the standard way of doing things and it's very popular. But it has no GUI support and a lot of conversions to and from wxWidgets is needed when working with PG (at least).
So in conclusion, I am compelled (at least for now), to go with libpqxx for C++ on Code::Blocks.
You should know that wxODBC is essentially dead, it was dropped in the 2.9 branch and won't be in 3 which is due to come out soon. You should probably not consider it at all for new code.

How to test my application is UNICODE Compatible or not?

I apologise if it is a silly question..I recently developed an application in windows with C and WinApi. I am in need to check whether application is UNICODE compatible or not. How can I test my machine? Is there any procedure followed to check UNICODE Compatibility. More over I dont have a chinese language machine or any other languages. I want this test to be done in my machine in which language is by default English.
Please provide some links if possible or a detailed procedure.
Great question. On Windows platform this is challenging indeed, because there are many different encodings and code pages supported and one can mix between them.
What I usually do is test the application on input which is a mix of two non-ASCII languages, such as a filename which is a mix of Russian and Hebrew letters, and see that the application is able to open this file, etc. You can copy this: "שלום привет hello" and see how it works for this kind of input.
Because we have two languages here, it is not possible to support with an ANSI codepage, so there will be no this kind of a bug, which is the most common.

LDAP C SDK

I need to write a simple LDAP client in C. The only binary distributions I found are old and also lack SSL tools needed to implement an SLDAP connection. A complete and up to date distribution that I found is that of Mozilla however it is in source code format and I have not been able to compile it into binary form for windows.
I used the instructions described here: https://wiki.mozilla.org/LDAP_C_SDK. I got up to the step where apparently I now need to use nsinstall but I don't know how this is done. Does anyone know how nsinstall is to be used.? Alternatively, does anyone know of an existing binary distribution of the LDAP C sdk for windows? I also need the ssl libraries and associated tool for configuring the keystore.
thanks,
Mike
I used The Google a bit and ended up with this site that has Windows distributions of OpenLDAP: http://www.symas.net/portal/
OpenLDAP is heavily used on *NIX platforms, less commonly on Win32, but these folks seem to have done the heavy lifting for you. Good luck!
Oh, and for docs and API reference, hit http://www.openldap.org

Writing Windows Port Monitor Basics

I'm trying to find a basic example, tutorial, or blog post on how to write a printer port monitor. I downloaded the Windows DDK and dug through localmon, but it appears that this sample is much more complex than just the nuts and bolts basics and from my understanding it is a bit different than an OEM port monitor because of how it handles the registry key and port enumeration. Does anyone know of a blog post, tutorial, or even book that walks the reader through the basic code to get one up and going? I've found a few links talking about the conceptual stuff, but nothing that is hands on code.
I can recomend http://www.codeproject.com/KB/printing/wpa.aspx, which describes how to write a printer driver and also has good hints about what's necessary to build a port monitor.
But my opinion is that a good tutorial in this area is not available on the Internet (I would be glad to find somebody who can show me that I'm wrong). So, when I had to deal with this task I was forced to do it the hard way: I've read carefully the MSDN explanations starting from this point: http://msdn.microsoft.com/en-us/library/ff561109.aspx. In parallel with reading MSDN I also checked the code in DDK you mentioned and try to understand it. I'm sure this solution could also work for you.
I wrote mine from the specs, there aren't really that many API's to implement.
The one thing that regularaly trips people up is EnumPorts, the spooler allocates enough memory for ALL the ports, not just yours. So you need to make sure you fill any strings from the end of the spoolers buffer, don't put them straight after your structures.
It doesn't say so in the specs but you can safely put the UI and Server functions in the same DLL.
It's also possible to create a single port monitor that supports NT and the later Windows 2000 type port monitors.
The code in RedMon is much easier to read than the localmon example, it's worth looking at before you start. It's quite nice because you can compile it in VS, you don't need to use the DDK to build it.
I have been over that exact same territory for a serial printer. About the best example I found was this article in Dr Dobbs Journal. The good part is that both a serial port driver and the user-space control program are covered and the project can also be used as an example of how to set up Visual Studio to compile a driver. This is also something a little difficult to find information about. The article discusses an old NT style driver, which worked well for me on XP.
There are quite a few good articles on CodeProject about writing drivers and programs to interact with them. They include source code and most deal with the newer WDM and WDF style drivers.
OSROnline is another good source, especially for discussion of specific issues and common mistakes. They also have some great utilities you will need.
Some of the most clearly written and understandable driver code I came across was Mark Russinovich's sample code. Although Microsoft withdrew all of the source when they purchased Sysinternals, some of the best examples can still be found cached here and there.
Drivers are pretty interesting. Whatever else you do though, do it in a virtual machine. Really.

Resources