首页
社区
课程
招聘
[求助]WTL下CString咋用?
发表于: 2007-2-28 16:58 7087

[求助]WTL下CString咋用?

2007-2-28 16:58
7087
偶用的VC2005装的WTL7.5系统是windows2003企业版的
为啥总说CSting是未申明标识符?
难道需要包含什么头文件吗?
声明问题搞定了需要包含#include <atlstr.h>
现在又有一个问题atl的CString咋获得缓冲区啊
大侠们出手救救菜鸟啊

[培训]内核驱动高级班,冲击BAT一流互联网大厂工作,每周日13:00-18:00直播授课

收藏
免费 0
支持
分享
最新回复 (4)
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
2
#include<atlmisc.h>

operator LPCTSTR()

or GetBuffer
2007-2-28 20:22
0
雪    币: 4560
活跃值: (1037)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
3
谢谢指教
CString ch;
CString szmenu;
int   nA,nB;
nA=0;
nB=0;
DWORD dwReads;
LPTSTR sz;
sz=ch.GetBuffer((GetFileSize(hfile,NULL))+1);
memset(sz,0,GetFileSize(hfile,NULL)+1);
ReadFile(hfile,sz,GetFileSize(hfile,NULL),&dwReads,NULL);       
CString szmenu;
HANDLE hfile;
hfile=CreateFile("menu.rc",GENERIC_READ,0,NULL,OPEN_EXISTING,
        FILE_ATTRIBUTE_NORMAL,NULL);       
nA=ch.Find('(',nB);
nB=ch.Find(')',nB+1);   
szmenu=ch.Mid(nA+1,nB-nA-1);
这个有错吗?
为啥偶总是搜不到括号字符呢
工程源码下载
821K9s2c8@1M7q4)9K6b7g2)9J5c8W2)9J5c8Y4N6%4N6#2)9J5k6h3I4A6N6X3g2Q4x3X3c8K6K9r3q4J5k6g2)9J5k6h3y4G2L8g2)9J5c8X3k6A6L8r3g2K6i4K6u0r3x3e0j5^5y4K6f1^5i4K6u0r3j5h3c8E0K9h3&6Q4x3X3g2J5j5i4u0Q4x3X3g2Z5N6r3#2D9
2007-3-1 01:18
0
雪    币: 4560
活跃值: (1037)
能力值: ( LV4,RANK:50 )
在线值:
发帖
回帖
粉丝
4
大侠帮帮忙啦
以下是读取的文件menu.rc
# -----------------------------------------------------------------
# bblean 1.16 - MENU FILE
# -----------------------------------------------------------------
# Available menu commands are listed in the documentation.
[begin] (Windows)
   [path] (开始菜单) {STARTMENU\程序|COMMON_STARTMENU\程序} <explorer.exe>
   [exec] (xplorer2) {xplorer2\xplorer2.exe} <xplorer2\xplorer2.exe,0>
   [exec] (AB Commander) {ABCommander\abcmdr.exe} <ABCommander\abcmdr.exe,0>
   [separator]
   [exec] (内存释放) {@ShrinkMemory} <shell32.dll,146>
   # Uncomment this line to check out all available system folders
   # [include] {shellfolders.rc}
   [run]  (运行命令)  <cmd.exe>
   [exec] (任务管理)  {WINDOWS\SYSTEM32\taskmgr.exe} <taskmgr.exe,0>
   [separator]
   [submenu] (设置) <blackbox.exe>
      [path] (控制面板) {CONTROLS} <shell32.dll,35>
      [config] (基本设置) <*>
      [stylesmenu] (风格选择) {styles}
      [submenu] (直接编辑)
         [editstyle] (当前风格)
         #(menu.rc)
         [editmenu] (菜单配置)
         #(blackbox.rc)
         [editblackbox] (系统配置)
         #(extensions.rc)
         [editextensions] (扩展设置)
         # (plugins.rc)
         [editplugins] (插件设置)
         [separator]
         [edit] (BBKeys.rc) {plugins\BBKeys\BBKeys.rc}
         [edit] (bbLeanSkin.rc) {plugins\bbLeanSkin\bbLeanSkin.rc}
         [edit] (bbLeanBar.rc) {plugins\bbLeanBar\bbLeanBar.rc}
      [end]
      [submenu] (管理器外观)
         [edit] (编辑扩展配置文件) {plugins\bbleanskin\exclusions.rc}
         [edit] (编辑设置配置文件) {plugins\bbleanskin\bbleanskin.rc}
         [exec] (Toggle Log) {@BBLeanSkin.ToggleLog}
         [exec] (Toggle Skin) {@BBLeanSkin.ToggleSkin}
         [edit] (Readme) {plugins\bbleanskin\readme.txt}
         #            [exec] (关于) {@BBLeanSkin.About}
      [end]
      [path] (程序资源) {BLACKBOX}
      [separator]
      [submenu] (设为默认)
         [exec] (安装为默认Shell) {blackbox.exe -install}
         [exec] (恢复Windows标准) {blackbox.exe -uninstall}
      [end]
      ! [submenu] (关于)
      !   [aboutstyle] (风格)
      !  [aboutplugins] (插件)
      !  [about] (bbLean)
      !  [end]
      [reconfig] (重读配置)
      [restart] (重启管理器)
      [exit] (退出)
   [end]
   [submenu] (离开) <shell32.dll,44>
      [exitwindows] (关机选择) <shell32.dll,211>
      [separator]
      [lockworkstation] (锁定屏幕) <shell32.dll,47>
      [suspend] (休眠状态) <shell32.dll,161>
      [logoff] (注销用户) <shell32.dll,100>
      [reboot] (重启系统) <shell32.dll,46>
      [shutdown] (直接关机) <shell32.dll,215>
   [end]
           [separator]
   [volume]  ( 音量)
[end]
2007-3-1 16:47
0
雪    币: 200
活跃值: (10)
能力值: ( LV2,RANK:10 )
在线值:
发帖
回帖
粉丝
5
跟踪一编你就知道了
2007-3-1 19:02
0
游客
登录 | 注册 方可回帖
返回