0

i creating an small application in Delphi 2009. here i got problem that when i run my application in WindowsXP its working but it is not working in Windows95. i know the problem that 95 will not support Unicode. if anyone knows the solution please tell me. and also i have one more idea that converting Unicode to ASCII. is it possible please tell how to do that.

Thanks in Advance

Worm Regards, Yuvaraj

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • you should first check what version the OS is if you want to support windows 95 as well, based on the OS version you use certain methods, etc. –  Dec 30 '10 at 12:55
  • i'm really unsure if binaries produced by D209 are runnable in win95 at all – Free Consulting Dec 30 '10 at 12:58
  • 4
    Who on earth still uses Windows 95? If you really want to support Win 95 then you should try Delphi 6/7. – David Heffernan Dec 30 '10 at 13:52
  • 7
    Depending on the app, and the nature of the work (are you under contract to produce a business app that runs on "all windows"? or are you writing an iTunes-killer shareware app?), you may be better off ignoring Win9x. 9x users are unlikely to buy new software, they're unlikely to upgrade. So the cost/benefit ratio says that you should skip this platform if it causes headaches. – Chris Thornton Dec 30 '10 at 13:56
  • 1
    @David - does it really matter who uses Win95? Clearly some people do (rumour has it, it still actually works!) - being disgusted that some people aren't mechanically feeding the $$ machine that is the software upgrade cycle won't change things for someone who has to provide software for those users. :) – Deltics Dec 30 '10 at 20:00
  • 1
    @Deltics: There actually are a fair number of Win 9x platforms out there, I've read, doing specialized things. Doubtless quite a few people still use them. However, they're doing the exact same things with them that they did five or ten years ago, and haven't spent the several hundred dollars necessary to run more modern software. This means they're not a good target market if you want to make money selling stuff to them. That's why vendors quickly stopped supporting 680x0-based Macs when the PPC ones came out, and replacements were more expensive then. – David Thornley Dec 30 '10 at 20:22
  • @ David T - the OP clearly has users on Win 95. Opining on whether users *should* be using Win 95 or whether such users might make a good market or not is completely and utterly irrelevant to the OP's situation. He *HAS* Win 95 users. End of story. No amount of whining about how some users are ludites is going to change that, or the fact that Delphi 2009 cannot (easily at least) produce apps that will run on Win95. That is all. All good stuff for blogging about, not really very helpful in a StackOverflow response, is my only point. – Deltics Dec 30 '10 at 23:25

3 Answers3

7

Delphi 2009 produces applications which make Unicode functioncalls. You can't change that. It is not a matter of converting your unicode strings into ascii. If you want your applications to run on Win95 you need Delphi 2007 or earlier.

Lars Truijens
  • 42,837
  • 6
  • 126
  • 143
  • Is there anything known about using MSLU with apps generated by unicode Delphi versions? – Marco van de Voort Dec 30 '10 at 13:40
  • The ENTIRE point of Delphi 2009 was that moving to Unicode fundamentally required that they throw away compatibility with non-unicode Windows versions (Win9x). – Warren P Dec 31 '10 at 18:23
3

Microsoft has developed the Microsoft Layer for Unicode (MSLU for short) for specifically this purpose: running applications targeting the UNICODE version of the Win32 API on systems like Win95 without having to alter them. It achieves this by intercepting and forwarding the calls.

Unfortunately, MSLU is by default delivered as a VC++ lib. Rob Kennedy made a Delphi port a couple of years ago, available here, targeting Delphi 2005. I'd imagine rewriting things for D2009 would be a bit of work, but doable.

Another pitfall is that MSLU is a bit outdated tech, and might not cover all of the API's Delphi uses. I guess the only way to find out is to actually go ahead and try to see if it works.

Paul-Jan
  • 16,746
  • 1
  • 63
  • 95
  • MSLU provides a layer for API function calls but not for messages, as I understand. So sending text-containing messages to controls won't work properly and this will affect some GUI elements. So MSLU is not an option, really. – Eugene Mayevski 'Callback Dec 30 '10 at 14:01
  • I don't think that what Rob did with MSLU would have any relevance here. – David Heffernan Dec 30 '10 at 15:12
  • 1
    I won't make any promises, but I'm not entirely convinced that MSLU wouldn't work. @Eugene, MSLU replaces `CreateWindowExW`, `SendMessageW`, and `CallWindowProcW`, so I think it should handle text messages. My main concern is that there are a lot more API functions nowadays than there were when MSLU was released in 2001. On the other hand, [Andreas Hausladen says](http://stackoverflow.com/questions/1385344/1385367#1385367) he can "target Windows 95 with Delphi 2010 if I modify the System.pas," so it may just be a matter of avoiding calling any new APIs. Seems like it'd be worth a try. – Rob Kennedy Dec 30 '10 at 17:34
  • @Rob I agree that it's worth trying, but when I looked (back in 2001-2002) into what the author of the unicode library for Delphi tried to do (what was that product's name? Forgot it...), it was far more than converting Unicode to ANSI before calling API functions. He had to implement certain hacks to make standard controls work properly. – Eugene Mayevski 'Callback Dec 30 '10 at 17:47
  • @Eugene, I think you're referring to the Tnt library. That didn't use MSLU. It was also trying to keep WideString VCL properties in sync with their AnsiString counterparts, and that required overriding and patching various non-API functions. Users would write Unicode code, and Tnt made it work with the underlying non-Unicode VCL. I assume Yuvaraj will write Unicode code, so there's no compatibility problem between his code and the VCL like there was in the Tnt days. – Rob Kennedy Dec 30 '10 at 17:58
  • @Yes, that was TNT, thanks. TNT didn't use MSLU but it did the same MSLU does - convert Unicode to ANSI and call ANSI functions on Win9x. This is where it was different from then-our ElPack, which provided full Unicode on Win9x. – Eugene Mayevski 'Callback Dec 30 '10 at 18:04
2

Unicode VCL, which appeared in D2009, can't be used on Windows 9x.

Eugene Mayevski 'Callback
  • 45,135
  • 8
  • 71
  • 121