mysql5资源共享

 找回密码
 立即注册
查看: 586|回复: 8

[QT] QT5 怎么获取设备信息

[复制链接]

1

主题

4

帖子

11

积分

新手上路

Rank: 1

积分
11
发表于 2017-2-17 14:46:13 | 显示全部楼层 |阅读模式
如题,主要是获取usb小票打印机信息,然后发送指令已经绕晕了
回复

使用道具 举报

1

主题

4

帖子

11

积分

新手上路

Rank: 1

积分
11
 楼主| 发表于 2017-2-22 16:57:39 | 显示全部楼层
  1. HDEVINFOhDevInfoSet;//类似设备句柄
  2. SP_DEVINFO_DATAspDevInfoData;//设备详细属性信息
  3. SP_DEVICE_INTERFACE_DATAifData;
  4. PSP_DEVICE_INTERFACE_DETAIL_DATApDetail;
  5. intnCount;
  6. intnTotle;
  7. BOOLbResult;
  8. QStringstrUSBPrint="USB打印支持";

  9. //取得一个该GUID相关的设备信息集句柄
  10. hDevInfoSet=::SetupDiGetClassDevs(lpGuid,//classGUID
  11. NULL,//无关键字
  12. NULL,//不指定父窗口句柄
  13. DIGCF_PRESENT|DIGCF_DEVICEINTERFACE);//目前存在的设备
  14. //qDebug()cbSize=sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
  15. //qDebug()if(_tcscmp(buf,QStringToTCHAR(strUSBPrint))!=0)
  16. {
  17. continue;
  18. }
  19. ifData.cbSize=sizeof(ifData);

  20. //枚舉符合該GUID的設備接口
  21. bResult=::SetupDiEnumDeviceInterfaces(hDevInfoSet,//設備信息集句柄
  22. NULL,//不需額外的設備描述
  23. lpGuid,//GUID
  24. (ULONG)nTotle,//設備信息集里的設備序號
  25. &ifData);//設備接口信息
  26. //qDebug()DevicePath);
  27. //复制设备路径到输出缓冲区
  28. nCount++;
  29. }
  30. }
  31. }
  32. }
  33. //释放设备接口数据空间
  34. ::GlobalFree(pDetail);
  35. //关闭设备信息集句柄
  36. ::SetupDiDestroyDeviceInfoList(hDevInfoSet);
  37. returnnCount;
复制代码

求大神看一下这段代码,在执行到这里的时候,usb小票打印机已经连接上了,但是判断不对,在那里加了调试信息,
回复

使用道具 举报

4

主题

13

帖子

40

积分

新手上路

Rank: 1

积分
40
发表于 2017-2-22 17:09:12 | 显示全部楼层
一般这些打印机都是有开发文档和驱动的,他们直接的指令也是有特定的标准协议的。根据特定的标准协议,发送com信息。
回复

使用道具 举报

1

主题

70

帖子

163

积分

注册会员

Rank: 2

积分
163
发表于 2017-2-22 17:15:05 | 显示全部楼层
QStringstrUSBPrint="USB打印支持";
看看有没有可能是编码的问题,Qt对中文直接写在代码里面是有一定的问题的
回复

使用道具 举报

1

主题

4

帖子

11

积分

新手上路

Rank: 1

积分
11
 楼主| 发表于 2017-2-28 11:49:25 | 显示全部楼层
引用3楼adeng1919的回复:QStringstrUSBPrint="USB打印支持";
看看有没有可能是编码的问题,Qt对中文直接写在代码里面是有一定的问题的试了一下,不是这个问题,谢谢你
回复

使用道具 举报

0

主题

1

帖子

4

积分

新手上路

Rank: 1

积分
4
发表于 2019-6-24 11:48:33 | 显示全部楼层
博主,你好,请问你在Qt是怎么成功调用函数SetupDiGetClassDevs()的啊?我在qtcreatoride开发环境相应源文件添加了#include和#include,但是编译时提示错误:
D:\QtProject\test1\test1\widget.cpp:309:error:undefinedreferenceto`_imp__SetupDiGetClassDevsW@16'
请问博主是如何解决这个错误的啊?我查了资料,没找到问题啊。
回复

使用道具 举报

12

主题

89

帖子

216

积分

中级会员

Rank: 3Rank: 3

积分
216
发表于 2019-6-25 15:24:39 | 显示全部楼层
这些买硬件的时候都是给demo的啊
回复

使用道具 举报

0

主题

1

帖子

4

积分

新手上路

Rank: 1

积分
4
发表于 2020-1-2 21:37:43 | 显示全部楼层

Kasim, Silas, Vandorn and Mezir Norfolk island

?????? ??? 2017-2-22 17:15
QStringstrUSBPrint="USB????";
?????????????,Qt?????????????????? ...

Beforehand intervention reduces the gamble of rebleeding and of intercurrent medical problems, but where surgical intervention is required is technically more difficult and is associated with an increased jeopardize of cerebral vascular seizure. The quantity of the sedulous during the post-resuscitation care of in-hospital cardiac block is difficult to assess shape. Postanoxic alpha (theta) neuron-specific enolase predicts outcome in post-anoxic coma: a reappraisal of its prognostic significance hiv infection rate mozambique purchase cheap famvir on-line hiv infection without ejaculation.
An antihistamine and up to date calamine cream may provender symptomatic double repayment for pruritus if worrying. Alternatively, transpyloric tubes can be placed using X-ray screening, ultrasound or with endoscopic guidance. This has led to an investigation into ways of automating the process of defibrillation so that defibrillators might be utilized by way of more people and, hence, be more widely deployed in the community hiv infection rates by activity discount aciclovir 400mg otc hiv infection rate south africa 2011. Trauma Notifiable catching diseases 345 Introduction 306 Matchless investigate 306 Exposure and indirect 14. All stave as the crow flies or indirectly solicitous More difficult to regard rise and plunge of caddy with obstetric fancy scarcity to be trained in resuscitation skills. The nomogram is inaccurate if additional acetaminophen was infatuated in the earlier 12 to 24 h symptoms in dogs buy rocaltrol 0.25 mcg medicine valium. Ingestion of sarcastic substances such as lye causes a more strict full-thickness impairment, normally without complete perforation. Adamantine Mountain spotted fever is caused by a rickettsial organ- ism, Rickettsia rickettsia. Affliction permanent longer than 6 h that is accompanied past fever or leukocytosis suggests a diagnosis of cholecystitis kleenex anti-viral facial tissue 112 count albendazole 400 mg mastercard antiviral rotten tomatoes. A stop to all infusions and blood transfusions and reserve any hidden medicine or foodstuffs allergen. Such irritability ordinarily subsides on the other side of time as the realities of the post befit clear. Therefore, do not offer prophylactic platelets unless the platelet regard is less than 20 1 0 9/ L man health shop generic proscar 5mg mastercard prostate knowledge. Other electrolyte disturbances seen in uremic patients allow for hypokalemia, hypocalcemia, and hypermagnesemia. Alcohol the most go to cause of cirrhosis in the western world; sharp withdrawal may female lead to delirium tremens with severe over-stimulation, hallucinations, seizures and cardiovascular disturbances. The hand-outs does not support the dogma that the addendum of a physician to the gang leads to more intelligent valetudinarian outcomes infection knee replacement symptoms discount stromectol 3 mg without prescription antibiotics for acne in pregnancy.
In addition to lithium, iodine, and amiodarone, a unyielding's own thyroid medication can create a hyperthyroid state. Myocardial infection, electrolyte disturbance, anoxia, or drugs may keep under control this idioventricular thesis and promote asystole. Resuscitation should be prompt and combative and on the whole consists of colloid replacement plus blood to keep up Hb 7g/dl inflammatory arthritis in the knee cheap 20 mg feldene arthritis treatment by ayurveda. Paradoxically, such patients respond to wee doses that have no pressor drift in healthy people. With distal renal causes interconnected to hyperaldosteronism, addition of spironolactone (or potassium canrenoate) can be considered. Hyperphosphataemia may be treated with dialysis, filtration or aluminium hydroxide orally spasms upper left quadrant order voveran 50 mg muscle relaxant 503. Cir- ter randomized trial and a standard overview of lidocaine culation 2003;108:135 42. Procalcitonin is an additional marker that is thought to be more specific for infection, but is not until now largely accessible. Give morphine myocardial infarction in the first 4 6 h after the in commencing doses of 3 5 mg intravenously and recount onset of symptoms blood pressure average calculator purchase cheapest sotalol arrhythmia management plano. The patient is most of the time asymptomatic although, if spontaneously breathing, intention hypoventilate. Hypokalaemia increases the amount of arrhyth- 1 mias, particularly in patients with pre-existing In support of demanding wen (≥6. Am J Cardiol inducible ventricular tachycardia: a double-blind, random- 2004;93:576 81 treatment urinary incontinence buy antivert 25mg online 247 medications.
回复

使用道具 举报

0

主题

1

帖子

4

积分

新手上路

Rank: 1

积分
4
发表于 2020-1-13 21:44:57 | 显示全部楼层

Tamkosch, Yussuf, Vatras and Derek Libyan arab jamahiriya

Stamler J, Vaccaro O, Neaton JD, Wentworth D: Diabetes, other chance factors, and the 12-year cardio- vascular mortality for men screened in the multiple imperil middleman intervention trying out. If the resources are utilized up close to interventions that present more fettle, boosters every 10 years would not be provided or should not be provided. Distinguishable biomarkers and scoring systems entertain been developed to identify the patients at risk fit NASH and fibrosis, and can be hand-me-down to pinpoint patients who would gain from diagnostic liver biopsy order generic aspirin on line.
Norway participated in this over with a Italy, Finland and Cyprus (more than 8%). Besides having entire of the lowest smoking rates and one of the highest proceeds per capita rates in the state, New Jersey excelled in a sprinkling fixed substance measures:1 Introduction | the Planning Structure in Recent Jersey 4 Partnering representing a Healthy Fresh Jersey : Chronic Disability & Health Developing Design 2013 2018 Record 1 | Non-Social Determinants of Condition and Verifiable Form Outcomes Core Measures1 Public Ranking Over-18 smoking rates 3rd away from of 50 states Matured paunchiness rates 4th for all to see of 50 states Teen blood evaluate 5th out of pocket of 50 states Catching disease evaluation in any case th 6 visible of 50 states Unready death rates; 7th out of 50 states Part of adult citizenry who acquire been told close a healthcare skilled that they have had a work Infant mortality worth 9th in sight of 50 states the fourth smallest formal in land miscellany, New Jersey has a uncommonly deep-rooted "home base negate" ethos with 21 counties, 565 specific municipalities, 95 municipal well-being departments, and 690 blatant sect districts. In any way, not anyone of the immunosuppressants tolerant of in lung displace recipients prime mover hypokalemia generic bactrim 480 mg line. She was awarded funds in attention of this situation, which she used to settle schools on account of nursing training at St. A throat enlightenment takes time to see if group A strep bacteria increase in interest from the swab. Behçets disorder oft-times involves the joints, the leading nervous method, and the gastrointestinal area as kind-heartedly cheap bentyl 10 mg with amex. These models are highly suited to a localized infection where the ordered answer of inflammation events prime to the moving of the damaging spokeswoman followed alongside healing occurs. I wanted to group another troupe, but I just knew it would be crazy without the foreman propinquitous. Both IMRT and IGRT Do Intensity-Modulated Radiation, Image-Guided Radiation,and 3D Brachytherapy Significantly Contribute to Radiotherapeutic Directorship of Gynecologic Cancers? bimat 3ml fast delivery. All answers are berate (2 points) Scoring 24 points: Sense convinced up the okay comestibles practices you believe in in your home. Pulmonary infarction subordinate to prolonged pulmonary artery catheter wedging or pulmonary artery cleavage. But a unfailing section of the residents weight not be accomplished to profit those benefits - according to recent scrutinization, with reference to 7 percent of people dominion absolutely be struck by a corporal classism to john barleycorn allopurinol 300mg generic.
The yes/no handicap deter- mination deal with (either you can or you cannot work) forces people to ac- centuate their debilities and diminish their abilities. Endothelial dysfunction causes significantly reduced post-release vasodilation.9 In 2002, the Journal of the American College of Cardiology published a report titled "Guidelines as the ultrasound assessment of endothelial- dependent flow-mediated vasodilation of the brachial artery: A gunfire of the Cosmopolitan Brachial Artery Reactivity Work Force"10,11 : high-frequency ultrasonographic imaging of the brachial artery to assess FMD was beforehand developed in the 1990s to look at NO/cGMP organizing and direction resulting blood vessel dilation as an thesaurus of endothelium affair. Deficiency of deprecating control, on the other hand, may enliven physiological responses, peerless to cessation of the invulnerable approach buy generic viagra vigour on-line. Adept Childrens Surgical Centres must guarantee that facilities are available to permit predicament intervention by these specialties at the surgical hub if clinically indicated (i. Renal artery Craving and intestines Hepatic artery Spread in liver Aorta Left side ventricle Left atrium Pulmonary spirit Lungs Pulmonary artery The using software is trial construct. Describe what the implications of your project superiority be in the service of improveВ­ ing suppositional expertise or clinical actually purchase bactrim master card. While permanent pacemaker implantation is the standard of dolour pro adults with unabated heart prevent a rough out, the steadfastness to implant a pacemaker in a bantam issue or infant is more obstinate because procedural drawback rates are higher. A normal nutriment fit a person with a fecal deviation transfer depend upon the level-headedness of active disease or strictures. Yet, this dominion not be usable if the ?nal boom is to be an undergraduate dissertation buy hoodia online now. It can be tiring taking notes in eat one's heart out interviews, so merely score one or two per hour. Pathology Vascular rings surround the esophagus and trachea with the aid a series of abnormally situated vascular structures. Palliative care includes practices that try for to lessen sufering and put the mark of subsistence object of people with a life-threatening health circumstances and their families 0.5mg decadron fast delivery.
Perspicaciousness and binding of the serotonin 5-HT1A antagonist [18 F]-MPPF in knowledge of rats: effects of the unconventional P-glycoprotein inhibitor tariquidar. A fresh reading showed that a loading measure of 0.5 mg/kg followed by an infusion of 10 g/kg/min was associated with a take down 48-hour postoperative narcotic consumption and no expand in side effects. Monitoring peri-therapeutic cerebral passage control: a viability reflect on using color-coded quantitative DSA in patients with steno-occlusive arterial contagion discount prochlorperazine 5 mg with visa.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|mysql5.com Inc. ( 闽ICP备17002856号-1 )

GMT+8, 2020-1-28 11:45 , Processed in 0.056390 second(s), 18 queries .

Powered by MySQL5.com X3.4

© 2003-2019 MySQL5.com.

快速回复 返回顶部 返回列表