Correct Implementation of #import
It is important to invoke ADO correctly in your program, or you can have compiler errors. The following code demonstrates the correct way to use #import with Msado10.dll the MSADO15.dll:
#import <msado15.dll> \
no_namespace \
rename( "EOF", "adoEOF" )
error C2011: 'EditModeEnum' : 'enum' type redefinition
error C2011: 'LockTypeEnum' : 'enum' type redefinition
error C2011: 'FieldAttributeEnum' : 'enum' type redefinition
error C2011: 'DataTypeEnum' : 'enum' type redefinition
error C2011: 'ParameterDirectionEnum' : 'enum' type redefinition
error C2011: 'RecordStatusEnum' : 'enum' type redefinition
Here's the original solution in MSDN:
http://support.microsoft.com/kb/169496/EN-US/
Show how to add script to the client in aspx file.
/// <param name="rbl">RadioButtonList to apply script to</param>
/// <param name="page">The Page the script is going to be appended to</param>
/// <param name="script">The script to append</param>
public static void SetRadioButtonListItemScript(RadioButtonList rbl, Page page, string script)
{
for (int idx = 0; idx < rbl.Items.Count; idx++)
{
RegisterClientObjectFunction(page, rbl, idx, script);
}
}
/// <param name="page">The Page the script is going to be appended to</param>
/// <param name="rbl">RadioButtonList to apply script to</param>
/// <param name="idx">the index of the radio button</param>
/// <param name="script">The script to append</param>
static private void RegisterClientObjectFunction(Page page, RadioButtonList rbl, int idx, string script)
{
StringBuilder sw = new StringBuilder();
if (!page.IsStartupScriptRegistered(rbl.ClientID + "_" + idx.ToString() + "script"))
{
sw.Append(@"<SCRIPT>");
sw.Append(@"document.getElementById('" + rbl.ClientID + "_" + idx.ToString() + "').onclick=function() {" + script + "return true;}");
sw.Append(@"</SCRIPT>");
page.RegisterStartupScript(rbl.ClientID + "_" + idx.ToString() + "script", sw.ToString());
}
}
static private void RegisterClientObjectFunction(Page page, CheckBox chk, string script)
{
StringBuilder sw = new StringBuilder();
if (!page.IsStartupScriptRegistered(chk + "script"))
{
sw.Append(@"<SCRIPT>");
sw.Append(@"document.getElementById('"+chk.ClientID + "').onclick=function() {" + script + "return true;}");
sw.Append(@"</SCRIPT>");
page.RegisterStartupScript(chk.ClientID + "script", sw.ToString());
}
}
Add Command here to right button click in explore (Windows XP)
http://www.blogjava.net/Files/programmer/CMDHere.zip
- Download the file and unzip the file CMDHere.reg.
- Double click it to import into registry,
- Right click on any folder, you'll see there's a menu which is "Command here",
- Click it, you'll get into the cmd window with the current path is which you selected.
Or you can import the settings manually.
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Command Prompt]
@="Command Prompt"
[HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Folder\shell\Command Prompt\command]
@="Cmd.exe /k pushd %L"

Set readonly for input text
document.getElementById("ctrl_id").readOnly = true; //pay attention to the readOnly, it's case sensitive.
Set option to unable to select for select control:
<option value="Genre" disabled="disabled">Genre</option>
Set select control to disabled (it has no readonly property):
<select disabled="disabled"></select>
Add a new option to a select control, it works under firefox 2.x and IE 5.x:
function addOption(select_ctrl, option_value, option_text){
var ctrl = document.getElementById(selectctl);
if(ctrl == null)
return;
var doc = ctrl.ownerDocument;
if (!doc)
doc = ctrl.document;
var opt = doc.createElement('OPTION');
opt.value = option_value;
opt.text = option_text;
ctrl.options.add(opt, ctrl.options.length);
}
Delete an option from select control:
selectctl.options[selectctl.selectedIndex] = null;
Delete all options from select control:
selectctrl.options.length = 0;
Change the css for an object:
document.getElementById("ctrl_id").className="SHOWN";