Re: VC++6 CreateWindow fails in init instance
r_z_aret_at_pen_fact.com
Date: 09/18/04
- Next message: r_z_aret_at_pen_fact.com: "Re: VC++6 CreateWindow fails in init instance"
- Previous message: r_z_aret_at_pen_fact.com: "Re: CListCtrl"
- In reply to: GuitarBill: "Re: VC++6 CreateWindow fails in init instance"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 18 Sep 2004 13:22:54 -0400
On Thu, 16 Sep 2004 12:43:22 -0700, "GuitarBill"
<GuitarBill_at_cox_dot_net> wrote:
>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?)
Actually swprintf is the UNICODE/WCHAR version of sprintf, while
wsprintf (note that the first two letters are transposed) is a related
function that can handle either.
But I commend you for warning about a serious trap that some
programmers get into. WCHAR is _always_ WCHAR, while TCHAR can be
either WCHAR or char (depending on whether UNICODE is defined). Mixing
the two indiscriminately can lead to painful debugging and rewriting
sessions.
>
>"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
- Next message: r_z_aret_at_pen_fact.com: "Re: VC++6 CreateWindow fails in init instance"
- Previous message: r_z_aret_at_pen_fact.com: "Re: CListCtrl"
- In reply to: GuitarBill: "Re: VC++6 CreateWindow fails in init instance"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|