Re: VC++6 CreateWindow fails in init instance

From: Andrew Kennard (a.kennard_at_btinternet.com)
Date: 09/17/04


Date: Fri, 17 Sep 2004 09:16:41 +0100

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

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
> > >
> >
> >
>
>



Relevant Pages

  • Re: FindFirstFileW
    ... > love to see a unicode version of FindFirstFile/FindNextFile, ... First change: string -> WideString ... Don't cast those arrays to WideString. ...
    (alt.comp.lang.borland-delphi)
  • Change Notepad.exe from ANSI to Unicode?
    ... Is there a registry setting I can change to get the Notepad to save to Unicode by default? ... TIA. ...
    (microsoft.public.win2000.general)
  • Change Notepad default from ANSI to Unicode?
    ... Is there a registry setting I can change to get the Notepad to save to Unicode by default? ... TIA. ...
    (microsoft.public.windowsxp.general)
  • undef UNICODE possible?
    ... with UNICODE in mind. ... The project is always using the UNICODE stuff and I ... still getting conditional compiles that use the UNICODE codition. ... TIA ...
    (microsoft.public.vc.ide_general)
  • Re: reverse contents of cell
    ... > between strings and arrays of bytes was possible. ... as written, it has the ability to really mess up Unicode, ...
    (microsoft.public.excel.worksheet.functions)