Quote from: jj2007 on Today at 05:36:14 AMHi Steve,
Can you post an example (not a Hello World, something bigger)?
QuoteMasmBasic is closer to GfaBasic, but it might not be difficult to write a translator. It seems BASICA is roughly the same as GW-BASIC, right?
Usage : ListPrinters \\server
#include <windows.h>
#include <winspool.h>
#include <stdio.h>
int main(int argc, char * argv[]) {
DWORD cbBuf = 0;
DWORD pcReturned;
PRINTER_INFO_2 * prinfo;
BOOL r;
int rv = 0;
DWORD i;
char * err = "The EnumPrinters API could not retrieve printer information.\n";
if (argc != 2) {
printf("ListPrinters V1.0 by Vortex\n\nUsage : ListPrinters \\\\server\n");
return 1;
}
EnumPrinters(PRINTER_ENUM_SHARED | PRINTER_ENUM_NAME, argv[1], 2, NULL, 0, & cbBuf, & pcReturned);
if (!cbBuf) {
printf("%s", err);
return 2;
}
prinfo = (PRINTER_INFO_2 * )VirtualAlloc(0, cbBuf, MEM_COMMIT, PAGE_READWRITE);
if (!prinfo) {
printf("Memory allocation failed.\n");
return 3;
}
r = EnumPrinters(PRINTER_ENUM_SHARED | PRINTER_ENUM_NAME, argv[1], 2, (LPBYTE) prinfo, cbBuf, & cbBuf, & pcReturned);
if (!r) {
printf("%s", err);
rv = 2;
} else {
for (i = 0; i < pcReturned; ++i) {
printf("%s\n", prinfo[i].pShareName);
}
}
VirtualFree(prinfo, 0, MEM_RELEASE);
return rv;
}
\pcc32\pcc32 /I\pcc32\include /c ListPrinters.c
\link32\link32 /SUBSYSTEM:CONSOLE /LIBPATH:\link32\lib /NEV ListPrinters.obj kernel32.lib user32.lib msvcrt.lib winspool.lib
Quote from: jj2007 on May 17, 2024, 03:09:59 PMDll hell in the 21st Century, isn't it lovely?C:\Windows\System32\msvcrt.dll
C:\Windows\System32\msvcr100_clr0400.dll
C:\Windows\System32\msvcr120_clr0400.dll
C:\Windows\System32\msvcrt20.dll
C:\Windows\System32\msvcrt40.dll
C:\Windows\System32\msvcr71.dll
C:\Windows\System32\msvcr80.dll
C:\Windows\System32\msvcr100.dll
There is a simple solution:
- find out what's the latest msvcr*.dll
- use LoadLibrary and GetProcAddress
C:\Windows\System32\msvcrt.dll
C:\Windows\System32\msvcr100_clr0400.dll
C:\Windows\System32\msvcr120_clr0400.dll
C:\Windows\System32\msvcrt20.dll
C:\Windows\System32\msvcrt40.dll
C:\Windows\System32\msvcr71.dll
C:\Windows\System32\msvcr80.dll
C:\Windows\System32\msvcr100.dll
Quote from: sudoku on May 17, 2024, 12:19:08 PMTried to run your executable