消除VC 中的skipping non-radio button in group错误

本文讨论了MFC中Radio Button的使用及其Tab Order设置的问题。当Radio Button组内出现非Radio Button控件时,会触发警告信息。正确的设置方法是确保第一个Radio Button具有Group属性,并在组的最后一个Radio Button之后的控件也设置Group属性。
假定有两组Radio-button, 第一组有两个button Tab-Order分别为 6 和 7 (6号的Group 属性打勾)。另一组的两个button Tab-Order分别为  10和 11(10号的Group 属性打勾)。  Tab-Order号为12的控件是一个EditBox, 将此EditBox的Group属性打勾。就可消除skipping non-radio button in group错误。


Does anybody know what this warning message means? "Warning: skipping
>non-radio button in group" and how can I correct the problem?

MFC assumes that a group of radio buttons are in consecutive tab order. In
certain circumstances you might not want this, for instance if an edit field
next to a radio button gives extra info about just that one choice. If you are
happy with how your group of radio buttons responds to the tab key, then this
is not really a problem.

===== Digest Separator =====

Mesg: 0F7BD4AE
From: BOGDAN LEDWIG < [log in to unmask]>
Subj: Re: Warning: skipping non-radio button in group.
Date: Fri, 1 Jan 1999 13:36:57 +0100

Probably you have incorrectly assigned tab orders in your dialog. Check out
the "Layout/Tab Order" command in VC dialog editor.

===== Digest Separator =====

Mesg: E743A87A
From: Dennis Werry < [log in to unmask]>
Subj: Re: Warning: skipping non-radio button in group.
Date: Fri, 01 Jan 1999 08:59:00 -0600

A Radio button  group is created by setting the first radio button in the
group with the "group" attribute.  Then the group is supposed to consist of
all subsequent items in the tab order until the next item that has the group
attribute set. Evidently, you have not set the group attribute for the control
immediately following the last radio button in the tab order.

===== Digest Separator =====

Mesg: C229AD39
From: Paul Gerhart < [log in to unmask]>
Subj: Re: Warning: skipping non-radio button in group.
Date: Fri, 01 Jan 1999 10:44:58 -0500

Use the editor to look at the Tab Order of the controls. Make sure the first
radio has the Group setting and go in order until the next thing that has
Group (lot of folks use a group box around the related radio buttons and set
it to Group and give it tab order after the last radio in the grouping). Make
sure all the controls between the two Group marks are all radios (and not some
other kind of control).

===== Digest Separator =====

Mesg: AC6F0B66
From: Seethaprasad Mandikel < [log in to unmask]>
Subj: RE: Warning: skipping non-radio button in group.
Date: Fri, 1 Jan 1999 13:48:23 +0530

This warning comes becos of WS_GROUP style not set  properly for Dialogs which
has radio buttons and other buttons in a SAME GROUP. Solution: Just set the
WS_GROUP style for all controls other than Radio buttons(Which you want to
group). Here is snippet of code which causes this warning.

File :  ...\VC\mfc\src\DLGDATA.CPP

void AFXAPI DDX_Radio(CDataExchange* pDX, int nIDC, int& value)
    // must be first in a group of auto radio buttons
{

    // walk all children in GROUP  to check the states
    int iButton = 0;
    do
    {

        //Check whether the button in the group box is radio button
if not it gives the warning
        if (::SendMessage(hWndCtrl, WM_GETDLGCODE, 0, 0L) &
DLGC_RADIOBUTTON)
        {
            // control in group is a radio button
            ........................
            Check the state of the radio button
        }
        else
        {
            TRACE0("Warning: skipping non-radio button in group.\n");
        }
        hWndCtrl = ::GetWindow(hWndCtrl, GW_HWNDNEXT);

    } while (hWndCtrl != NULL &&
        !(GetWindowLong(hWndCtrl, GWL_STYLE) & WS_GROUP));
}

===== Digest Separator =====

Mesg: A7024836
From: CHRIS DEPETRIS < [log in to unmask]>
Subj: Re: Warning: skipping non-radio button in group.
Date: Fri, 1 Jan 1999 09:21:42 -0500

The problem is that the next control in the tab order following the last radio
button of your group must have the WS_GROUP flag set.

ex:
Control        Group Flag On
Static Text          Yes
Radio Button1        Yes
Radio Button2        No
Radio Button3        No
Button               Yes

In the previous list, if the last button did not have the group flag set you
would get the TRACE warning while running.

===== Digest Separator =====

Mesg: 8B613945
From: LEROY BAXTER < [log in to unmask]>
Subj: RE: Warning: skipping non-radio button in group.
Date: Thu, 31 Dec 1998 23:13:44 -0800

In the Resource Editor, you need to set the tab order for the Radio buttons -
they must be sequential.  The first button must have the Group property set,
and the first item following the last button must also have the Group property
set

转载于:https://www.cnblogs.com/cy163/archive/2006/09/29/518664.html

<think>嗯,用户遇到了Solidity编译错误,提示'Skipping non-existent input file',即使路径和文件名正确。首先,我需要分析可能的原因。根据引用[1]中的例子,用户用的是Node.js的solc.compile()函数,脚本里读取了Voting.sol文件。但可能路径处理有问题,比如使用了相对路径或者路径拼接错误。引用[4]提到在Ubuntu上用solc-select管理编译器版本,可能用户的环境里编译器版本和合约要求的版本匹配,但用户的问题是关于文件路径的,所以暂时排除版本问题。 接下来,检查文件路径是否正确。用户说路径和文件名正确,但有时候可能有隐藏字符或者大小写问题。比如在Windows上,文件名是大小写敏感,但路径中的斜杠可能用了反斜杠,或者有空格没转义。比如路径中的空格需要用引号包裹,或者在代码中用双反斜杠。例如,path.resolve可能会处理同操作系统的路径分隔符,但如果实际路径中有特殊字符,可能需要进一步处理。 然后,检查文件读取是否成功。用户用了fs.readFileSync,如果文件存在或权限足,会抛出错误。但用户的脚本是否有错误处理?比如用try-catch来捕获异常,否则编译结果可能显示文件存在。此外,可能文件路径的构建有误,比如'../contracts'是否正确相对于当前脚本的位置?可能需要打印出contractPath的实际值,确认是否真的指向了正确的文件。 另外,引用[2]提到npm包名称错误会导致404,但这里的问题是安装包,而是文件路径,所以可能无关。过,可以检查是否solc版本过旧,导致处理路径的方式同。或者,用户是否在Windows上使用solc.exe,而路径中有空格或特殊字符,需要用引号包裹路径。比如在命令行中直接执行solc.exe时,路径如果有空格,必须用引号括起来,否则会被解析成多个参数。 还有可能是solc编译器本身的限制,比如某些版本在处理长路径或特定字符时有bug。这时候需要更新编译器版本,或者使用solc-select(引用[4])切换版本试试。另外,用户是否在代码中正确使用了绝对路径?比如path.resolve应该生成绝对路径,但可能需要确认是否正确转换了相对路径。例如,__dirname是当前脚本的目录,而'../contracts'是否真的指向包含Voting.sol的目录。 最后,建议用户打印出contractPath的值,检查是否存在拼写错误,或者使用fs.existsSync验证文件是否存在。同时,检查文件权限,确保脚本有读取权限。如果路径中有特殊字符,可能需要用encodeURI或path模块的方法处理。例如,空格可能需要转义或使用双引号包裹路径字符串。</think>### 解决Solidity编译错误 `Skipping non-existent input file` #### 1. **路径格式验证** - **问题**:即使路径看似正确,系统可能因格式问题无法识别(例如反斜杠`\`未转义或路径包含空格未用引号包裹)。 - **解决方法**: - **Windows系统**:使用双反斜杠或正斜杠,例如: ```javascript const contractPath = path.resolve(__dirname, '../contracts/Voting.sol').replace(/\\/g, '/'); ``` - **路径包含空格**:用引号包裹路径: ```javascript const contractPath = '"' + path.resolve(__dirname, '../contracts/Voting.sol') + '"'; ``` #### 2. **文件实际存在性检查** - **问题**:路径逻辑正确但文件可能实际存在(如拼写错误或文件扩展名匹配)。 - **解决方法**: - 添加文件存在性检查: ```javascript if (!fs.existsSync(contractPath)) { throw new Error(`文件 ${contractPath} 存在`); } ``` #### 3. **编译器版本兼容性** - **问题**:若合约代码指定了编译器版本(如`pragma solidity ^0.8.0;`),需确保本地编译器版本匹配[^3]。 - **解决方法**: - 使用`solc-select`管理多版本编译器(参考引用[4]): ```bash solc-select install 0.8.0 solc-select use 0.8.0 ``` #### 4. **完整代码示例修正** ```javascript const fs = require('fs'); const solc = require('solc'); const path = require('path'); // 修正路径并检查存在性 const contractPath = path.resolve(__dirname, '../contracts', 'Voting.sol').replace(/\\/g, '/'); if (!fs.existsSync(contractPath)) { console.error(`错误:文件 ${contractPath} 存在`); process.exit(1); } // 读取文件并编译 const contractSource = fs.readFileSync(contractPath, 'utf-8'); const compileResult = solc.compile(contractSource, { version: '0.8.0' }); // 指定编译器版本 console.log(compileResult); ``` #### 5. **操作系统差异处理** - **Linux/Windows差异**:路径大小写敏感问题可能导致文件未被识别(Linux严格区分大小写,Windows区分)[^2]。 --- ###
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值