SOL9 Sample: NetConnection

SOL9 2.0 Samples

1 Screenshot


2 Source code

/*
 * NetConnection.cpp 
 * Copyright (c) 2015 Antillia.com TOSHIYUKI ARAI. ALL RIGHTS RESERVED. 
 */


#include <sol/nm/ShareInfo0.h>
#include <sol/nm/NetShare.h>
#include <sol/nm/NetConnection.h>
#include <sol/nm/ConnectionInfo0.h>
#include <sol/nm/ConnectionInfo1.h>

#include <sol/Locale.h>

void _tmain(int argc, TCHAR** argv)
{
  Locale locale;

  try {
    wchar_t* server = NULL;

    NetShare netShare(server);


    ShareInfo0 info0;

    netShare.enumerate(info0);
    SHARE_INFO_0* ptr = info0.getInfo();
    
    int count = info0.getEntriesRead();
    printf("SHARE_INF_0 count=%d\n", count);
    for (int i = 0; i<count; i++) {
      if (ptr) {
        printf("NetName: %S\n", ptr->shi0_netname);
        NetConnection netConnection(server);
        ConnectionInfo1 connInfo1;
        netConnection.enumerate(ptr->shi0_netname, connInfo1);
        connInfo1.display();
      }
      ptr++;
    }
    
    printf("\n");


  } catch (...) {
    printf("Exception \n");
  }

  printf("OK. Please hit [enter] key\n");
  getchar();
}

Last modified: 2 May 2016

Copyright (c) 2016 Antillia.com ALL RIGHTS RESERVED.