Go4Expert

Go4Expert (http://www.go4expert.com/)
-   Win32 (http://www.go4expert.com/forums/win32/)
-   -   Resource add in compile time in MFC (http://www.go4expert.com/forums/resource-add-compile-time-mfc-t2776/)

Akash 31Jan2007 11:40

Resource add in compile time in MFC
 
First Import a .txt file in MFC
and then give some name such as "A"
So its adding as IDR_A1

Then find IDR_A1, U will see #define IDR_A1 129 or different

Then write the code which is given billow in OnInitDialog()

HGLOBAL hResourceLoaded; // handle to loaded resource
HRSRC hRes; // handle/ptr to res. info.
char *lpResLock; // pointer to resource data
DWORD dwSizeRes;
int nResourceId;
unsigned char vv[50000];

ofstream outputFile;


hRes = FindResource(NULL, MAKEINTRESOURCE(129),"A");


hResourceLoaded = LoadResource(NULL, hRes);
lpResLock = (char *) LockResource(hResourceLoaded);
dwSizeRes = SizeofResource(NULL, hRes);
strcpy(vv,lpResLock);
//*vv=*lpResLock;
outputFile.open("C:\\B.txt",1);
outputFile.write((const char *) lpResLock, dwSizeRes);
outputFile.close();

//adding #include <fstream.h>

shabbir 31Jan2007 13:56

Re: Resource add in compile time in MFC
 
Sorry I could not get what is your point??

Akash 31Jan2007 14:15

Re: Resource add in compile time in MFC
 
basically it work as a installer . First U have to attach so many file ,
such as txt,binary in compile time.
When its run then will not depend to any other file for writing anywhere.
Till now if u r not understand then batter to discus Hansaraj Das
Akash Dutta
Cellnext Solutions Limited.(DELHI)
akashduttaj@gmail.com
akash.dutta@cellnext.com
Ph:09313773387(M),03325141429(R)

shabbir 31Jan2007 15:21

Re: Resource add in compile time in MFC
 
What I wanted to know is whats your query then.

Akash 1Feb2007 09:26

Re: Resource add in compile time in MFC
 
dont understand your question.

shabbir 1Feb2007 10:16

Re: Resource add in compile time in MFC
 
This is a query and discussion forum and it looks like you are looking for something. isnt that true?

Akash 1Feb2007 10:28

Re: Resource add in compile time in MFC
 
100% true

shabbir 1Feb2007 13:35

Re: Resource add in compile time in MFC
 
Quote:

Originally Posted by Akash
100% true

Then if you are looking for something then whats your question??

Akash 2Feb2007 15:26

Re: Resource add in compile time in MFC
 
actually right now I am working in win32 console application with dialogic
also know some portion of MFC.
want to know win32 application.

so plz send me a simple programe of win32 application,
which will create a button and when fire this then it will
show a message box..........thats all

thank U.

shabbir 2Feb2007 15:45

Re: Resource add in compile time in MFC
 
Have you tried writing something??


All times are GMT +5.5. The time now is 21:26.