在resource.h中
#define String1 333
在resource.rc
中#include <windows.h>
#include "resource.h"
STRINGTABLE
{
STRING1 "hie people"
}
在main.cpp
中#include<iostream.h>
#include<resource.h>
#include<windows.h>
using namespace std;
int main{
cout<<here i want to output string value from resource how to call the string;
}
还有一个我在代码块中编译的问题。我说resource.h不存在我错的地方
答案 0 :(得分:8)
我认为它是Visual C ++而你正在使用MFC。它就像调用一样简单:
::LoadString(...)
如果您使用的是MFC,那么
CString str;
str.LoadString(STRING1)