Re: VC++6 CreateWindow fails in init instance

r_z_aret_at_pen_fact.com
Date: 09/18/04


Date: Sat, 18 Sep 2004 13:22:55 -0400

On Fri, 17 Sep 2004 09:16:41 +0100, "Andrew Kennard"
<a.kennard@btinternet.com> wrote:

>Aaaah thanks.
>
>I'm as you can probably tell i'm new to c++ and started my c++ programming
>experience on WinCE and XP and hadn't appreciated win9x wasn't unicode

Yep. It's also missing some functions, but you would already know that
if it were relevant.

To (perhaps needlessly) expand/clarify an earlier post:
For eVC, UNICODE must _always_ be defined, and the eVC IDE obliges.
Windows 95 (and probably 98 and ME, which are based on 95) do not
really support Unicode strings, so UNICODE should _not_ be defined; an
earlier post (from Guitar Bill) mentioned software (library?) you can
use to support Unicode strings on Win 95. Windows NT and Windows
versions based on it (2K, XP), support Unicode, so UNICODE can be
defined for apps that "want" to support Unicode strings.

>
>So I presume this means that all messages like WM_GETTEXT etc return char
>arrays and wchars etc ?
>
>TIA
>
>Andrew
>
>"GuitarBill" <GuitarBill_at_cox_dot_net> wrote in message
>news:%23r8oVVCnEHA.2552@TK2MSFTNGP11.phx.gbl...
>> Possibly a Unicode issue? (not supported on Win9x; you will need to use
>> MSLU/unicows). Are you compiling for Unicode?
>> You are mixing metaphors with the code you posted - should be _stprintf
>not
>> wsprintf (which is wide/Unicode version, which might explain bogus message
>> string on non-Unicode build?)
>>
>> "Andrew Kennard" <a.kennard@btinternet.com> wrote in message
>> news:eSBnPYBnEHA.2216@TK2MSFTNGP10.phx.gbl...
>> > Yes I tried to show it in a message box in the normal way but it just
>> comes
>> > out as a load of ?????????????????????? instead of a number ?
>> >
>> > It's just the usual
>> >
>> > TCHAR szTemp[100];
>> > wsprintf(szTemp,TEXT("Create window failed %d"),GetLastError());
>> > MesssageBox(NULL,szTemp,NULL,MB_OK);
>> >
>> > I've used this elsewhere in the code OK but it doesn't seem to work here
>?
>> > Perhaps it's too early in the code or the fact the main window for the
>> prog
>> > isn't created ?
>> >
>> > TIA
>> >
>> > Andrew Kennard
>> >
>> > "Steve Alpert" <sra@newsgroups.nospam> wrote in message
>> > news:uKJxLkAnEHA.1248@TK2MSFTNGP09.phx.gbl...
>> > > Andrew Kennard wrote:
>> > > > Hi all
>> > > >
>> > > > I have a small VC++6 program written on my WinXP dev machine that
>runs
>> > fine
>> > > > on other XP machines
>> > > >
>> > > > If however I try and run it on a Win9x machine it stops before it's
>> even
>> > got
>> > > > going.
>> > > >
>> > > > The problem seem to be the CreateWindow inside InitInstance is
>> failling
>> > but
>> > > > I don't know why ?
>> > > >
>> > > > If I create a "hello world" app this runs fine on Win9x
>> > > >
>> > > > So it's definately something in my app/project
>> > > >
>> > > > The InitInstance, RegisterClass, WinMain are as per the hello world
>> app.
>> > > >
>> > > > It is complied as a MultiThreaded app in the CodeGeneration
>> properties.
>> > > >
>> > > > Any pointers as to what might cause my app to fail at this very
>early
>> > stage
>> > > > would be most appreciated
>> > >
>> > > If you have the source, did you try calling GetLastError() after the
>> > > failure?
>> > >
>> > > /steveA
>> > >
>> > > --
>> > > Steve Alpert
>> > > my email Fgrir_Nycreg @ vqk.pbz is encrypted with ROT13
>(www.rot13.org)
>> > > and spaces
>> > >
>> >
>> >
>>
>>
>

-----------------------------------------
To reply to me, remove the underscores (_) from my email address (and please indicate which newsgroup and message).

Robert E. Zaret, eMVP
PenFact, Inc.
500 Harrison Ave., Suite 3R
Boston, MA 02118
www.penfact.com



Relevant Pages

  • Re: Meanwhile, sounds like the unicode update is coming along ...
    ... talking about the documentation for porting apps to Tiburon. ... documentation for porting ANY and ALL apps to Unicode. ... Petzold's Programming Windows is roughly ...
    (borland.public.delphi.non-technical)
  • Re: unicode in ruby
    ... doesn't support unicode strings natively? ... Unix support for Unicode ... Why the hell utf-16? ...
    (comp.lang.ruby)
  • Re: unicode in ruby
    ... doesn't support unicode strings natively? ... glaring problem. ... But getting unicode right is hard. ... Look at the size of the icu library and the size of ruby itself. ...
    (comp.lang.ruby)
  • Re: Font for a menu?
    ... It wouldn't be so bad if the Windows key were somewhere else on the keyboard, ... That's the one - the main problem is that Microsoft don't distribute a font ... I think the Unicode set has been ... flags exist in the set - but only flags for upward stems. ...
    (microsoft.public.vc.mfc)
  • Re: Font for a menu?
    ... and I haven't found any font with it. ... I think the Unicode set has been defined by classical musicians with a strong interest in early plainsong :-) ... They are intended to join onto stems via the mechanism for creating composite characters by the look of it, but stems have different lengths and it isn't clear to me how this will work. ... To get flags for downward stems the existing flags will have to be reflected about a horizontal line - do Windows drawing functions allow this? ...
    (microsoft.public.vc.mfc)