ActiveX & unicode
-
I wrote an activex control that works well in W98. It had some problems with extended chars in WinwowsXP, so I recompiled it using unicode support. And now it works well in WinXP. But I can't register it win w98 nor in wme. Have I got to distribuite 2 versions (98/me and 2000/xp) or there is some way to have only one activeX working on both systems? Thanks Paolo
-
I wrote an activex control that works well in W98. It had some problems with extended chars in WinwowsXP, so I recompiled it using unicode support. And now it works well in WinXP. But I can't register it win w98 nor in wme. Have I got to distribuite 2 versions (98/me and 2000/xp) or there is some way to have only one activeX working on both systems? Thanks Paolo
Not being able to register sounds like it cannot be loaded. Chances are that you're using API calls which have UNICODE/ANSI versions, eg OpenFileA and OpenFileW. In the UNICODE build, it will be trying to pull in references from the DLLs like KERNEL32, USER32 etc. The XP versions have both ANSI and UNICODE entry points, but the Win9x versions don't, they only have ANSI. This gives an error when loading the DLL. To resolve it, you can (a) have two builds (as you ask) (b) Build only an ANSI version, but convert all string parameters (in and out) and properties to be BSTR, which are UNICODE strings. This will require a little extra effort, as you may well need to convert from UNICODE to ANSI for use internally, but it's probably worth it. Steve S Developer for hire
-
Not being able to register sounds like it cannot be loaded. Chances are that you're using API calls which have UNICODE/ANSI versions, eg OpenFileA and OpenFileW. In the UNICODE build, it will be trying to pull in references from the DLLs like KERNEL32, USER32 etc. The XP versions have both ANSI and UNICODE entry points, but the Win9x versions don't, they only have ANSI. This gives an error when loading the DLL. To resolve it, you can (a) have two builds (as you ask) (b) Build only an ANSI version, but convert all string parameters (in and out) and properties to be BSTR, which are UNICODE strings. This will require a little extra effort, as you may well need to convert from UNICODE to ANSI for use internally, but it's probably worth it. Steve S Developer for hire
[quote]Not being able to register sounds like it cannot be loaded.[/quote] It crashes and then reports the error "LoadLibrary failed". Yes, I'm using socket API with different unicode/ansi version. At first I had only the ansi version, but it gave me some problems with ext chars; also I don't know where to convert from unicode to ANSI, because the VC++ Wizard declares the called function using "LPCTSTR"...
-
I wrote an activex control that works well in W98. It had some problems with extended chars in WinwowsXP, so I recompiled it using unicode support. And now it works well in WinXP. But I can't register it win w98 nor in wme. Have I got to distribuite 2 versions (98/me and 2000/xp) or there is some way to have only one activeX working on both systems? Thanks Paolo
Hi Well one option is, as you said, having two versions, the other one is using the Microsoft Layer for Unicode on Windows 95/98/Me Systems Fabian