Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Basic Unicode app fails in ntdll!RtlpWaitForCriticalSection during startup

0 views
Skip to first unread message

Dan Rosart

unread,
Jun 22, 2005, 10:26:00 PM6/22/05
to
I apologize if someone's reading all the groups this gets cross-posted
to, as I keep getting more suggestions about where to post it to get it
solved.

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
tor...@rogers.com

Ed Mulroy

unread,
Jun 23, 2005, 6:11:12 AM6/23/05
to
I have only done a little with Unicode apps so consider the source.

Wide characters as in Unicode are wchar_t and not char type variables and
use 'wcout' and not 'cout'. Try changing 'std::cout' to 'std::wcout'.

. Ed

> Dan Rosart wrote in message
> news:42ba1dbd$1...@newsgroups.borland.com...

Dan Rosart

unread,
Jun 23, 2005, 8:05:03 AM6/23/05
to
It compiles and links successfully and fails during initialization,
before reaching any of my code. For that matter, I tried it with wcout
before and the same things happened.

Ed Mulroy

unread,
Jun 23, 2005, 1:40:04 PM6/23/05
to
I just tried it and it ran. Check the environment on your machine - virus
settings, disk ok, etc.

. Ed

> Dan Rosart wrote in message

> news:42ba...@newsgroups.borland.com...

0 new messages