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
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)
LoadString from MSDN
An Example here of how to use LoadString
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With