Author Topic: Testing msvcr90.dll with PellesC  (Read 2764 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1974
Testing msvcr90.dll with PellesC
« on: January 29, 2014, 11:02:42 am »
Testing msvcr90.dll with PellesC how unicode works with it.
Code: [Select]
//#include <stdio.h>
#include <wchar.h>

// msvcrxx.h
#define MSVCRXX

#ifdef MSVCRXX
#pragma nodefaultlib
#pragma comment(lib, "msvcr90.lib")
#pragma comment(linker, "/MANIFESTDEPENDENCY:\"type='win32' name='Microsoft.VC90.CRT' version='9.0.21022.8' processorArchitecture='x86' publicKeyToken='1fc8b3b9a1e18e3b'\"")
typedef struct FAKEFILE {
char fake[0x20];
//__declspec(dllimport) extern FAKEFILE * __cdecl __iob_func(void);
__declspec(dllimport) extern FILE * __cdecl __iob_func(void);
#undef stdin
#define stdin  (struct FILE*)(&__iob_func()[0])
#undef stdout
#define stdout (struct FILE*)(&__iob_func()[1])
#undef stderr
#define stderr (struct FILE*)(&__iob_func()[2])

__declspec(dllimport) extern int _setmode(int handle, int mode);
__declspec(dllimport) extern int _fileno(struct FILE * stream);
//int _stdcall SetConsoleOutputCP(unsigned int wCodePageID);

int __cdecl mainCRTStartup(void)
//int main(int argc, char **argv)
_setmode(_fileno(stdout), 0x20000); // set console mode to unicode
//SetConsoleOutputCP(1252); // Windows-1252
wprintf(L"wprintf ÄäÖöÅå\n");
fwprintf(stdout, L"stdout ÄäÖöÅå\n");
fwprintf(stderr, L"stderr ÄäÖöÅå\n");
return 0;
Code: [Select]
LIBRARY msvcr90.dll
« Last Edit: January 29, 2014, 08:16:24 pm by timovjl »
May the source be with you


  • Guest
Re: Testing msvcr90.dll with PellesC
« Reply #1 on: March 04, 2014, 10:15:47 am »
But regardless of which version used for msvcr90.dll it didn't matter. I then noticed that PlexScriptHost.exe is using msvcr110.dll. So perhaps it's not possible to use 2 different msvcr<version>dll at all?