示例#1
0
void hdfutil::WriteString(const H5::CommonFG& group, const std::string & dsname, const std::string & str) {
    hsize_t dims[] = {1};
    H5::DataSpace dataspace(1, dims);       // 1 string
    H5::StrType   strtype  (0, str.size()); // string length
    H5::DataSet dset = group.createDataSet(dsname, strtype, dataspace, CreatePropList());
    dset.write(&str[0], strtype);
}
示例#2
0
文件: main.c 项目: radzikpwnz/twc
/**
 * Program initialization.
 */
static int Init()
{
    /* Load control cursors */
	LoadControlCursors();

    /* Register window classes */
    if ( RegisterWindowClasses() == 0 ) {
        return 0;
    }

    /* Initialize common controls library */
    InitCommonControlsEx( NULL);

    /* Initialize property list dll */
	if ( InitPropertyListDll( GetModuleHandle(NULL)) == 0 ) {
        return 0;
    }

    /* Initialize TWC and creating main window */
    if ( !twcInit() || !(twcCreateObject( &MainWnd, 1, HWND_DESKTOP)) ) {
        return 0;
    }
	hMainWnd = MainWnd.hwnd;

    /* Create property list */
    if ( CreatePropList() == 0) {
        return 0;
    }

    /* Set status bar z-order(top) */
    SetWindowPos( StatusBar.hwnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);

    /* Add toolbox and toolbar buttons */
    AddToolboxButtons(Toolbox.hwnd);
	AddMainToolbarButtons(MainToolbar.hwnd);

    /* Show main window */
    ShowWindow( hMainWnd, SW_SHOWMAXIMIZED);
	UpdateWindow( hMainWnd);

    twc_SetObjectsClientDataSize( sizeof( TWC_OBJECT_CLIENT_DATA));

    actNewProject();

    return 1;
}