wchar_t wch[MAX_PATH];
::PathCombine(wch, _T("D:"), _T(".//aa.caj"));
编译结果error C2039: 'PathCombine' : is not a member of '`global namespace''
error C2065: 'PathCombine' : undeclared identifier
如何解决啊
::PathCombine(wch, _T("D:"), _T(".//aa.caj"));
编译结果error C2039: 'PathCombine' : is not a member of '`global namespace''
error C2065: 'PathCombine' : undeclared identifier
如何解决啊
解决方案 »
- 求教 在mfc下用fopen
- VB+VC来开发软件
- VC用mschart画散点图,画不上去,是线。。急!
- 内联汇编速度能提升?还是我写的不好?
- access数据库BOOL类型
- 有高手的话,想问二个问题,1、非阻塞式连接是怎么样建立的2、用winsock怎么提交网页的post表单。
- vc++运行win32 console程序出错!
- 各位大虾!!用directshow采集视频数据,如何实现将采集到的数据去出???
- 一个类中难道不能使用2个自定义的消息吗,发送到2个类去?
- 请教大侠!!!关于单文档程序Ctreeview控制Clistview问题
- 在VC6.0中写MFC遇到的若干问题
- 求助!我快疯了!编的很多程序都是一样的问题
#include <iostream.h>
#include "Shlwapi.h"void main( void )
{
// Buffer to hold combined path.
char buffer_1[MAX_PATH] = "";
char *lpStr1;
lpStr1 = buffer_1;// String for balance of path name.
char buffer_2[] = "One\\Two\\Three";
char *lpStr2;
lpStr2 = buffer_2;// String for directory name.
char buffer_3[] = "C:";
char *lpStr3;
lpStr3 = buffer_3;cout << "The file path to be combined is "
<< lpStr2<< endl;
cout << "The directory name path is "
<< lpStr3<< endl;
cout << "The combined path is "
<< PathCombine(lpStr1,lpStr3,lpStr2) << endl;}
------------
INPUT:
------------
Path for directory part: "C:"
Path for file part: "One\Two\Three"
------------
OUTPUT:
------------
The file path to be combined is One\Two\Three
The directory name path is C:
The combined path is C:\One\Two\Three
CString fPath;//aa.caj的全路径名
GetModuleFileName(NULL,sPath.GetBufferSetLength(MAX_PATH+1),MAX_PATH);
sPath.ReleaseBuffer();
int nPos;
nPos=sPath.ReverseFind('\\');
sPath=sPath.Left(nPos); fPath = sPath+"\\Temp\\aa.caj";//假定aa.caj在你的可执行文件同路径下的temp文件夹下
AfxMessageBox(fPath);//输出全路径名