想写个修改用户密码的程序,于是引入了头文件<activeds.h>报error C2146: syntax error : missing ';' before identifier 'IADs'#include "stdafx.h"#include "stdafx.h"
#include "iostream.h"
#include "string.h"
#include "stdlib.h"
#include "stdio.h"int main(int argc, char* argv[])
{
printf("Hello World!\n");
return 0;
}
以上最简单的文件当然可以成功编译并运行。想写个修改用户密码的程序,于是引入了头文件
#include <windows.h>
#include <activeds.h>
#include <ntdsapi.h>
#include <atlbase.h>变成如下,却编译就出错,何解?#include "stdafx.h"#include "stdafx.h"
#include "iostream.h"
#include "string.h"
#include "stdlib.h"
#include "stdio.h"#include <windows.h>
#include <activeds.h>
#include <ntdsapi.h>
#include <atlbase.h>int main(int argc, char* argv[])
{
printf("Hello World!\n");
return 0;
}
Compiling...
ADSI2.cpp
e:\program files\microsoft visual studio\vc98\include\iads.h(26) : error C2146: syntax error : missing ';' before identifier 'IADs'
e:\program files\microsoft visual studio\vc98\include\iads.h(26) : fatal error C1004: unexpected end of file found
Error executing cl.exe.ADSI2.obj - 2 error(s), 0 warning(s)
#include "iostream.h"
#include "string.h"
#include "stdlib.h"
#include "stdio.h"int main(int argc, char* argv[])
{
printf("Hello World!\n");
return 0;
}
以上最简单的文件当然可以成功编译并运行。想写个修改用户密码的程序,于是引入了头文件
#include <windows.h>
#include <activeds.h>
#include <ntdsapi.h>
#include <atlbase.h>变成如下,却编译就出错,何解?#include "stdafx.h"#include "stdafx.h"
#include "iostream.h"
#include "string.h"
#include "stdlib.h"
#include "stdio.h"#include <windows.h>
#include <activeds.h>
#include <ntdsapi.h>
#include <atlbase.h>int main(int argc, char* argv[])
{
printf("Hello World!\n");
return 0;
}
Compiling...
ADSI2.cpp
e:\program files\microsoft visual studio\vc98\include\iads.h(26) : error C2146: syntax error : missing ';' before identifier 'IADs'
e:\program files\microsoft visual studio\vc98\include\iads.h(26) : fatal error C1004: unexpected end of file found
Error executing cl.exe.ADSI2.obj - 2 error(s), 0 warning(s)
解决方案 »
- 请教个数据库插入的问题
- 新手问题:关于OnPaint函数里调用OnDraw()
- ???IStream 的write 及 release 问题???
- [MFC创建窗体出现了很奇怪的问题,创建的不是想得到的那一个]
- MFC中的类里的成员函数,如BOOL CEdit:: CanUndo() const ???
- 地址127.0.0.1到底是什么地址?这个地址真的有点特别呀。
- 删除CListCtrl和数据库数据
- 坛主在哪儿?为什么要封杀我的ID,给我一个说法,赔偿经济损失!
- CListCtrl控件编辑控件源码分析
- 输入法的软键盘是怎么做的?
- 请问写一个DLL形式的COM是否需要考虑重入问题?
- 256色BMP转PCX错位的问题
#define WINVER 0X500
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x500
#endif
#ifndef _WIN32_WINDOWS
#define _WIN32_WINDOWS 0x0500
#endif
#define WINVER 0X500
#endif
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x500
#endif
#ifndef _WIN32_WINDOWS
#define _WIN32_WINDOWS 0x0500
#endif#include "stdafx.h"
#include "iostream.h"
#include "string.h"
#include "stdlib.h"
#include "stdio.h"#include <windows.h>
#include <activeds.h>
#include <ntdsapi.h>
#include <atlbase.h>int main(int argc, char* argv[])
{
printf("Hello World!\n");
return 0;
}是这样加的吗?但是仍是出错?
Microsoft Visual C++ 6.0
#include <windows.h>
#include <activeds.h>
#include <ntdsapi.h>
#include <atlbase.h>
为
#include <windows.h>
#include <atlbase.h>
#include <activeds.h>
#include <ntdsapi.h>
你的VC打补丁了吗?(我用的是SP5)
#include <Adshlp.h>
#pragma comment(lib,"ActiveDS")
#pragma comment(lib,"adsiid")
这下报告没有ntdsapi.h头文件,查找VC98目录下的确没有这个文件,何办?
Compiling...
Skipping... (no relevant changes detected)
ADSI.cppADSI.obj - 0 error(s), 0 warning(s)编译通过,但是生成.exe文件时出错--------------------Configuration: ADSI2 - Win32 Debug--------------------
Linking...
LINK : warning LNK4067: ambiguous entry point; selected "mainCRTStartup"
ADSI2.obj : error LNK2001: unresolved external symbol _NetUserChangePassword@16
Debug/ADSI2.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.ADSI2.exe - 2 error(s), 1 warning(s)我程序里调用了这个修改用户密码的函数
The NetUserChangePassword function changes a user's password for a specified network server or domain.NET_API_STATUS nStatus;
nStatus = NetUserChangePassword(NULL,User,Password,NewPassword1);
#pragma comment(lib,"netapi32.lib")
“ 永 远 让 薪 水 跑 在 能 力 前 面 ” 是 软 媒 的 座 右 铭 。( 二 ) 高 技 术
软 媒 公 司 内 部 针 工 具 型 软 件 研 发 ,形 成 自 主 产 权 的 系列 软 件 架 构 。
( 三 ) 高 手 军 团
软 媒 的 每 个 高 级 工 程 师 , 都 是 身 手 不 凡 的 业 界 精 英 , 形 成 了 浓 厚 的 高 科 技 氛 围 。( 四 ) 高 素 质 用 户 群
“ 一 个 软 件 离 开 了 它 的 用 户 就 是 垃 圾” 并 不 过 分 ,软 媒 提 供 了 7 * 2 4 小 时 的 在 线 用 户 群 引 导 软 件 的 需 求 。
产 品 介 绍 < 系 列 软 件 研 发 工 具 >
让 九 亿 农 民 兄 弟 都 能 开 发 出 自 己 喜 爱 的 软 件 。 提 示 : 凡 符 合 本 职 位 要 求 者 , 可 以 直 接 来 面 试 无 须 投 放 简 历 。 要 求 : 精 通 标 准 C \ C + + 结 构 化 程 序 设 计 。
1 、 要 求 有 V C + + 软 件 开 发 经 验 。
2 、 精 通 W i n d o w s 界 面 开 发 , 熟 练 使 用 C D C 绘 图 类 。
3 、 具 有 良 好 的 独 立 开 发 能 力 和 自 主 开 发 能 力 。
4 、 有 工 具 型 软 件 开 发 经 验 者 优 先 。 工 作 职 责 :
1 、 开 发 工 具 软 件 及 其 构 件 。
2 、 独 立 自 主 设 计 工 具 使 用 流 程 。
3 、 一 切 设 计 都 基 于 用 户 需 求 。
4 、 不 需 要 团 队 开 发 经 验 。
5 、 要 求 有 良 好 的 用 户 需 求 实 现 能 力 。 基 本 工 资 :
1 、 高 级 软 件 工 程 师 : 9 , 0 0 0 元 / 月 联 系 方 式 : R i c h m a i n @ d u o s o f t . c nhttp://www.jobsdb.com.cn/main/jobseeker/JobTemplates/Default/CN/JobDetail.asp?CompanyID=109434&JobPostID=3178881&FromFlag=&Language=CN&Page=1 & T e m p l a t e I D = D e f a u l t