Newsgroup: it.comp.lang.c++
Titolo: Errore compilando un file di esempio!

 ** error 1 ** deleting .\Winmainprova.obj
---- Make had errors. Right click error line to open file.
---- Make had errors. Right click error line to open file.
Questo e' il file che ho tirato giu dall'help e che ho provato a
compilare con borland free compiler usando Vide.
#include <windows.h>
#include <fcntl.h>
#include <stdio.h>
#include <io.h>
#ifndef __FLAT__
#error This Example must be compiled using 32 bit compiler
#endif
//Example for _get_osfhandle() and _open_osfhandle()
BOOL InitApplication(HINSTANCE hInstance);
HWND InitInstance(HINSTANCE hInstance, int nCmdShow);
LRESULT FAR PASCAL _export MainWndProc(HWND hWnd, UINT message,
            WPARAM wParam, LPARAM lParam);
Example_get_osfhandle(HWND hWnd);
#pragma argsused
int PASCAL WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
        LPSTR lpCmdLine, int nCmdShow)
{
MSG msg;      // message
  if (!InitApplication(hInstance))  // Initialize shared things
   return (FALSE); // Exits if unable to initialize
  /* Perform initializations that apply to a specific instance */
  if (!(InitInstance(hInstance, nCmdShow)))
   return (FALSE);
  /* Acquire and dispatch messages until a WM_QUIT message is
received. */
  while (GetMessage(&msg, // message structure
   NULL, // handle of window receiving the message
   NULL, // lowest message to examine
   NULL))  // highest message to examine
  {
  TranslateMessage(&msg); // Translates virtual key codes
  DispatchMessage(&msg);  // Dispatches message to window
  }
  return (msg.wParam);  // Returns the value from PostQuitMessage
}
BOOL InitApplication(HINSTANCE hInstance)
{
  WNDCLASS  wc;
  // Fill in window class structure with parameters that describe the
  // main window.
  wc.style = CS_HREDRAW | CS_VREDRAW; // Class style(s).
  wc.lpfnWndProc = (long (FAR PASCAL*)(void *,unsigned int,unsigned
int, long ))MainWndProc; // Function to retrieve messages for
                // windows of this class.
  wc.cbClsExtra = 0;  // No per-class extra data.
  wc.cbWndExtra = 0;  // No per-window extra data.
  wc.hInstance = hInstance; // Application that owns the class.
  wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
  wc.hCursor = LoadCursor(NULL, IDC_ARROW);
  wc.hbrBackground = GetStockObject(WHITE_BRUSH);
  wc.lpszMenuName = NULL;  // Name of menu resource in .RC file.
  wc.lpszClassName = "Example"; // Name used in call to CreateWindow.
  /* Register the window class and return success/failure code. */
  return (RegisterClass(&wc));
}
HWND InitInstance(HINSTANCE hInstance, int nCmdShow)
{
  HWND  hWnd; // Main window handle.
  /* Create a main window for this application instance.  */
  hWnd = CreateWindow(
   "Example",                 // See RegisterClass() call.
   "Example _get_osfhandle _open_osfhandle (32 bit)",  // Text for
window title bar.
   WS_OVERLAPPEDWINDOW,        // Window style.
   CW_USEDEFAULT,         // Default horizontal position.
   CW_USEDEFAULT,          // Default vertical position.
   CW_USEDEFAULT,            // Default width.
   CW_USEDEFAULT,        // Default height.
   NULL,                  // Overlapped windows have no parent.
   NULL,                  // Use the window class menu.
   hInstance,              // This instance owns this window.
   NULL                   // Pointer not needed.
  );
  /* If window could not be created, return "failure" */
  if (!hWnd)
   return (FALSE);
  /* Make the window visible; update its client area; and return
"success" */
  ShowWindow(hWnd, nCmdShow); // Show the window
  UpdateWindow(hWnd);     // Sends WM_PAINT message
  return (hWnd);        // Returns the value from PostQuitMessage
}
#pragma argsused
LRESULT FAR PASCAL _export MainWndProc(HWND hWnd, UINT message,
            WPARAM wParam, LPARAM lParam)
{
  switch (message)
  {
    case WM_CREATE:
    {
      Example_get_osfhandle(hWnd);
      return NULL;
    }
    case WM_QUIT:
    case WM_DESTROY:  // message: window being destroyed
      PostQuitMessage(0);
    break;
    default:      // Passes it on if unprocessed
      return (DefWindowProc(hWnd, message, wParam, lParam));
  }
}
Example_get_osfhandle(HWND hWnd)
{
    long osfHandle;
    char str[128];
    int fHandle = open("file1.c", O_CREAT|O_TEXT);
    if(fHandle != -1)
    {
      osfHandle = _get_osfhandle(fHandle);
      sprintf(str, "file handle = %lx OS file handle = %lx", fHandle,
osfHandle);
      MessageBox(hWnd,str,"_get_osfhandle",MB_OK|MB_ICONINFORMATION);
      close(fHandle);
      fHandle = _open_osfhandle(osfHandle, O_TEXT );
      sprintf(str, "file handle = %lx OS file handle = %lx", fHandle,
osfHandle);
      MessageBox(hWnd,str,"_open_osfhandle",MB_OK|MB_ICONINFORMATION);
         close(fHandle);
    }
    else
      MessageBox(hWnd,"File Open Error","WARNING",MB_OK|MB_ICONSTOP);
return 0;
}

 library refernce
Hai sbagliato NewsGroup (anche per l'altra domanda)
quello giusto e':
it.comp.programmare.win32
prova li...
--
Gerolamo
Lo spam è un problema! Informati su: 
http://www.collinelli.net/antispam
Abbonati a un ISP decente che utilizzi tecniche per combattere lo spam
Non usare una mailbox e-nonima. Se hai paura dello spam usa servizi
come Despammed, Sneakemail, Vene.ws, 
Vene.dave.it
, ...