积极答复者
初始化出错

问题
-
BSTR* bstrName;
_bstr_t bstrValue1(_T("Select * from [mydata] where age <12.000000 and score < 90"));
*bstrName = bstrValue1.copy(); //这里提示: run_time check failure #3 -the variable 'bstrName' is being used without being initialized.
上面代码运行出错,编译没有问题- 已编辑 Honny_yeyh 2012年1月2日 3:14
答案
-
BSTR* bstrName;
_bstr_t bstrValue1(_T("Select * from [mydata] where age <12.000000 and score < 90"));
*bstrName = bstrValue1.copy(); //这里提示: run_time check failure #3 -the variable 'bstrName' is being used without being initialized.
上面代码运行出错,编译没有问题试试看给
BSTR* bstrName 变量初值
- The blog of typewriter職人
- Convert C# to VB.NET
- /*If my concept is wrong ,please correct me.Thanks.*/
- 已建议为答案 Mike FengModerator 2012年1月3日 8:10
- 已标记为答案 Mike FengModerator 2012年1月10日 10:08
-
錯誤訊息表示 the variable 'bstrName' is being used without being initialized
你只有宣告 BSTR* bstrName 但是並沒有初始化資料
歡迎參觀我的Blog.NET菜鳥自救會
- 已建议为答案 Mike FengModerator 2012年1月3日 8:10
- 已标记为答案 Mike FengModerator 2012年1月10日 10:08
-
BSTR* bstrName;
_bstr_t bstrValue1(_T("Select * from [mydata] where age <12.000000 and score < 90"));
*bstrName = bstrValue1.copy(); //这里提示: run_time check failure #3 -the variable 'bstrName' is being used without being initialized.
上面代码运行出错,编译没有问题VC++程序现在非常严格规定任何指针在使用前必须赋值。所以请这样修改:
BSTR* bstrName =NULL;
或者直接这样做:
bstr_t bstrValue1(_T("Select * from [mydata] where age <12.000000 and score < 90"));
BSTR* bstrName = bstrValue1.copy();
QQ我:
下载MSDN桌面工具(Vista,Win7)
我的博客园
慈善点击,点击此处
- 已建议为答案 Mike FengModerator 2012年1月3日 8:10
- 已编辑 ThankfulHeartModerator 2012年1月4日 5:53
- 已标记为答案 Mike FengModerator 2012年1月10日 10:08
全部回复
-
BSTR* bstrName;
_bstr_t bstrValue1(_T("Select * from [mydata] where age <12.000000 and score < 90"));
*bstrName = bstrValue1.copy(); //这里提示: run_time check failure #3 -the variable 'bstrName' is being used without being initialized.
上面代码运行出错,编译没有问题试试看给
BSTR* bstrName 变量初值
- The blog of typewriter職人
- Convert C# to VB.NET
- /*If my concept is wrong ,please correct me.Thanks.*/
- 已建议为答案 Mike FengModerator 2012年1月3日 8:10
- 已标记为答案 Mike FengModerator 2012年1月10日 10:08
-
錯誤訊息表示 the variable 'bstrName' is being used without being initialized
你只有宣告 BSTR* bstrName 但是並沒有初始化資料
歡迎參觀我的Blog.NET菜鳥自救會
- 已建议为答案 Mike FengModerator 2012年1月3日 8:10
- 已标记为答案 Mike FengModerator 2012年1月10日 10:08
-
BSTR* bstrName;
_bstr_t bstrValue1(_T("Select * from [mydata] where age <12.000000 and score < 90"));
*bstrName = bstrValue1.copy(); //这里提示: run_time check failure #3 -the variable 'bstrName' is being used without being initialized.
上面代码运行出错,编译没有问题VC++程序现在非常严格规定任何指针在使用前必须赋值。所以请这样修改:
BSTR* bstrName =NULL;
或者直接这样做:
bstr_t bstrValue1(_T("Select * from [mydata] where age <12.000000 and score < 90"));
BSTR* bstrName = bstrValue1.copy();
QQ我:
下载MSDN桌面工具(Vista,Win7)
我的博客园
慈善点击,点击此处
- 已建议为答案 Mike FengModerator 2012年1月3日 8:10
- 已编辑 ThankfulHeartModerator 2012年1月4日 5:53
- 已标记为答案 Mike FengModerator 2012年1月10日 10:08