🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internationalization
Article #52

Basic Unicode app fails in ntdll!RtlpWaitForCriticalSection during startup

#52
From: Dan Rosart
Date: Wed, 22 Jun 2005 02:34
27 lines
1916 bytes
Just trying to get started using C++BuilderX PE, and I can't even get 
the simplest app out there short of Hello World working.

#include <iostream>
#include "tchar.h"

int _tmain(int argc, _TCHAR* argv[])
{
   for (int i=1; i<argc; ++i) {
     std::cout << argv[i] << _T(" Length: ") << _tcslen(argv[i])
       << std::endl;
   }
   return 0;
}

I add the -tWU flag to BCC32 and change c0x32.obj to c0x32w.obj in the 
linker line, and it compiles just fine, but when I run it, it fails 
during startup with an access violation in 
ntdll!RtlpWaitForCriticalSection at 7C918FEA. (ie. before ever reaching 
my code.) It works as you would expect if I compile and run it as a 
non-Unicode app. Is there something obvious that I'm doing wrong? There 
seems to be a dearth of documentation on this, and I'm sure those of you 
making real applications with this IDE must be able to get something 
like this working.

Dan Rosart
torgen@rogers.com
Technical Details
Message-ID: <42b8ce21$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 10297d,7115a3466b0b05e,start
X-Google-Attributes: gid10297d,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 21 Jun 2005 22:34:00 -0400
From: Dan Rosart <torgen@rogers.com>
User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internationalization
Subject: Basic Unicode app fails in ntdll!RtlpWaitForCriticalSection during
 startup
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 216.183.146.49
Message-ID: <42b8ce21$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1119407649 216.183.146.49 (21 Jun 2005 19:34:09 -0700)
Lines: 27
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.maxwell.syr.edu!newsfeed.icl.net!proxad.net!fr.ip.ndsoftware.net!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail