我正在使用VBA构建用户表单。我希望能够生成一个随机数列表,并让用户输入他们从哪个单元格开始。我有一个名为#include <iostream>
#include <string.h>
#include <IOKit/IOKitLib.h>
#include <IOKit/storage/IOMedia.h>
#include <CoreFoundation/CoreFoundation.h>
#include <CoreFoundation/CFString.h>
using namespace std;
static void printPairs (const void* key, const void* value, void* context) {
CFShow(key);
CFShow(value);
}
int main()
{
// create matching dictionary
CFMutableDictionaryRef classesToMatch;
classesToMatch = IOServiceMatching(kIOMediaClass);
if (!classesToMatch) cout << "Error: IOServiceMathing failed" << endl;
// get iterator of matching services
io_iterator_t mediaIterator;
kern_return_t kernResult;
kernResult = IOServiceGetMatchingServices(kIOMasterPortDefault,classesToMatch,&mediaIterator);
if (KERN_SUCCESS != kernResult) cout << "Error: IOServiceGetMatchingService failed" << endl;
// Iterate medias
io_object_t nextMedia;
while ( (nextMedia = IOIteratorNext(mediaIterator)) )
{
CFMutableDictionaryRef dict = nullptr;
kernResult = IORegistryEntryCreateCFProperties(
nextMedia,&dict, kCFAllocatorDefault, 0);
if (KERN_SUCCESS != kernResult) cout << "Error: IORegistryEntryCreateCFProperties failed" << endl;
CFNumberRef objWhole = static_cast<CFNumberRef>(CFDictionaryGetValue(dict, CFSTR("Whole")));
CFNumberRef objRaid = static_cast<CFNumberRef>(CFDictionaryGetValue(dict, CFSTR("RAID")));
int64_t whole = 0;
CFNumberGetValue(objWhole, kCFNumberSInt64Type, &whole);
// skip partitions
if (objWhole && whole)
{
io_name_t name;
IORegistryEntryGetName(nextMedia, name);
cout << "=============" << name << "============" << endl;
CFDictionaryApplyFunction(dict, printPairs, nullptr);
// PRINT SMART HERE
cout << endl;
}
// clean-up
CFRelease(dict);
IOObjectRelease(nextMedia);
}
IOObjectRelease(mediaIterator);
}
的文本框和一个名为txtStarting
的范围。
userstarting
该表格不允许我输入范围的完整值。就像我想从单元格B1开始一样,一旦我输入B,就会给我一个错误。