Reputation: 315
in resource.h
#define String1 333
in resource.rc
#include <windows.h>
#include "resource.h"
STRINGTABLE
{
STRING1 "hie people"
}
in 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;
}
and one more problem i am compiling in code blocks .it says resource.h is not there where i am wrong
Upvotes: 4
Views: 10728
Reputation: 15566
I assume that it is Visual C++ and you are using MFC. It is as simple as calling:
::LoadString(...)
And if you are using MFC, then
CString str;
str.LoadString(STRING1)
An Example here of how to use LoadString
Upvotes: 9