Pelles C forum

C language => Tips & tricks => Topic started by: TimoVJL on January 29, 2014, 11:02:42 AM

Title: Testing msvcr90.dll with PellesC
Post by: TimoVJL 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];
} FILE;
//__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])
#endif

__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;
}
msvcr90.def
Code: [Select]
LIBRARY msvcr90.dll
EXPORTS
__iob_func
__set_app_type
_fileno
_setmode
wprintf
fwprintf
Title: Re: Testing msvcr90.dll with PellesC
Post by: Persay 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?