java控制台改窗体_Windows窗体替换控制台窗口

我在Visual Studio 2012 C中创建了一个Win32控制台应用程序项目 .

如何通过更吸引人的GUI(如Windows窗体)替换控制台窗口?

int32_t main(int32_t argc, char* argv[])

{

const char *date = "20150428_1\\";

int mode=0;

_CallServerPtr pCallServer;

uint32_t start_address_comp=0;

uint32_t start_address_module=0;

const char* xmlFile_tx_dbb="tx_dbb.xml";;

char str[100] = "\0";

char localeStr[64];

memset(localeStr, 0, sizeof localeStr);

const char *l_path = "..\\XERCES\\Configs\\";

std::string buf = "";

double Fsym_Hz=(1/1.15)*1e9;

int selection=0;

int user_selection=0;

try

{

if (strlen(localeStr))

{

XMLPlatformUtils::Initialize(localeStr);

}

else

{

XMLPlatformUtils::Initialize();

}

}

catch (const XMLException& toCatch)

{

XERCES_STD_QUALIFIER cerr << "Error during initialization! :\n"

<< StrX(toCatch.getMessage()) << XERCES_STD_QUALIFIER endl;

}

static const XMLCh gLS[] = { chLatin_L, chLatin_S, chNull };

DOMImplementation *impl = DOMImplementationRegistry::getDOMImplementation(gLS);

DOMLSParser *parser = ((DOMImplementationLS*)impl)->createLSParser(DOMImplementationLS::MODE_SYNCHRONOUS, 0);

DOMConfiguration *config = parser->getDomConfig();

DOMLSSerializer *theSerializer = ((DOMImplementationLS*)impl)->createLSSerializer();

DOMLSOutput *theOutputDesc = ((DOMImplementationLS*)impl)->createLSOutput();

config->setParameter(XMLUni::fgDOMDatatypeNormalization, true);

DOMCountErrorHandler errorHandler;

config->setParameter(XMLUni::fgDOMErrorHandler, &errorHandler);

XERCES_STD_QUALIFIER ifstream fin;

//reset error count first

errorHandler.resetErrors();*/

// reset document pool

parser->resetDocumentPool();

char* pszHostname = NULL;

pSaIn = 0;

pSaOut = 0;

// Initialize the COM Library

CoInitialize(NULL);

if (!pszHostname)

{

// Create the CallServer server object on the local computer

pCallServer.CreateInstance(CLSID_CallServer);

}

if (pCallServer == NULL)

throw "Failed to create the CallableVEE CallServer object";

// Load the VEE User Function library

char strpath[256];

strcpy (strpath,reposity_path);

strcat (strpath,l_path_vee);

_bstr_t bstrLibPath(strpath);

LibraryPtr pLib = pCallServer->GetLibraries()->Load(bstrLibPath);

// Print out the names of the UserFunctions in this library.

UserFunctionsPtr pUserFuncColl = pLib->GetUserFunctions();

VARIANT_BOOL bDebug = VARIANT_FALSE;

pCallServer->PutDebug(bDebug);

// Variables added by ivi

float *freq =(float *)_aligned_malloc(6,16); // Read frequency vector

// Previous variables

int32_t devIdx;

int32_t modeClock;

int32_t ifType;

const char *devType;

char fpga_device_type[32];

int32_t rc;

int32_t ref_clk=0;

uint32_t carrier=0;

uint32_t odelay_dac0 = 0;

uint32_t odelay_dac1 = 0;

// Parse the application arguments

if(argc!=5) {

printf("Usage: FMCxxxApp.exe {interface type} {device type} {device index} {clock mode} \n\n");

printf(" {interface type} can be either 0 (PCI) or 1 (Ethernet). At CEIT, we use 1 (Ethernet).\n");

printf(" {device type} is a string defining the target hardware (VP680, ML605, ...). At CEIT, we use VC707.\n");

printf(" {device index} is a PCI index or an Ethernet interface index. This value depends on the PC.\n");

printf(" {clock mode} can be either 0 (Int. Clock) or 1 (Ext. Clock)\n");

printf("\n");

printf("\n");

printf("Example: Fmc230APP.exe 1 VC707 0 0\n");

printf("\n");

printf("\n");

printf(" List of NDIS interfaces found in the system {device index}:\n");

printf(" -----------------------------------------------------------\n");

if(sipif_getdeviceenumeration(API_ENUM_DISPLAY)!=SIPIF_ERR_OK) {

printf("Could not obtain NDIS(Ethernet) device enumeration...\n Check if the 4dspnet driver installed or if the service started?\n");

printf("You can discard this error if you do not have any Ethernet based product in use.");

}

if( EXIT_IF_ERRORS)

{

sipif_free();

system("pause");

return -1;

}

...

}

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值