Click here to Skip to main content
16,011,383 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
QuestionRe: /, source code questions Pin
led mike26-Nov-08 7:21
led mike26-Nov-08 7:21 
AnswerRe: /, source code questions Pin
CPallini26-Nov-08 7:46
mveCPallini26-Nov-08 7:46 
Questionhook for Outlook Express 6 Pin
Dr. Kelwin26-Nov-08 5:33
Dr. Kelwin26-Nov-08 5:33 
QuestionChild window and tab stop Pin
BadJerry26-Nov-08 5:08
BadJerry26-Nov-08 5:08 
AnswerRe: Child window and tab stop Pin
Code-o-mat26-Nov-08 8:34
Code-o-mat26-Nov-08 8:34 
QuestionIs MFC DLL reentrant? Pin
rp_suman26-Nov-08 3:56
rp_suman26-Nov-08 3:56 
AnswerRe: Is MFC DLL reentrant? Pin
Mark Salsbery26-Nov-08 5:04
Mark Salsbery26-Nov-08 5:04 
GeneralRe: Is MFC DLL reentrant? Pin
rp_suman28-Nov-08 18:36
rp_suman28-Nov-08 18:36 
Hi Mark,

It seems, reentrancy is wholly depend on the code.
Here are some rules for code to be reentrant:
Reentrancy[^]

And the code is as follows, the dll function will give the content of given file name:
<br />
void extern "C" __declspec(dllexport) getFileContent(LPCTSTR strFile, LPCTSTR& lpStrOut)<br />
{	<br />
	CFile pFile;<br />
	pFile.Open(strFile, CFile::modeRead);<br />
	int iLen = pFile.GetLength();<br />
	char *ch = new char[iLen+1];<br />
	pFile.Seek(0, CFile::begin);<br />
	pFile.Read(&ch[0], iLen);			<br />
	ch[iLen] = '\0';<br />
	lpStrOut = ch;<br />
	pFile.Close();<br />
}<br />

The function is reading file content into character array and returns pointer to the content.
As it does not use any static variable, but allocating and returning "new" character array, is it reentrant?

With Thanks & Regards,
Suman

--
"Programming is an art that fights back!"

GeneralRe: Is MFC DLL reentrant? Pin
Mark Salsbery28-Nov-08 19:05
Mark Salsbery28-Nov-08 19:05 
QuestionTransparent Window Pin
Aabid26-Nov-08 2:54
Aabid26-Nov-08 2:54 
AnswerRe: Transparent Window Pin
Ahmed Charfeddine26-Nov-08 3:23
Ahmed Charfeddine26-Nov-08 3:23 
AnswerRe: Transparent Window Pin
Code-o-mat26-Nov-08 4:15
Code-o-mat26-Nov-08 4:15 
AnswerRe: Transparent Window Pin
My2Cents30-Nov-08 12:51
My2Cents30-Nov-08 12:51 
QuestionDrag n Drop not working with desktop icon on Win7. Pin
Shashi.Shinde26-Nov-08 2:28
Shashi.Shinde26-Nov-08 2:28 
RantRe: Drag n Drop not working with desktop icon on Win7. Pin
Ahmed Charfeddine26-Nov-08 3:27
Ahmed Charfeddine26-Nov-08 3:27 
Question¿Quién sabe? alphablending 2 bitmaps Pin
Chesnokov Yuriy26-Nov-08 2:04
professionalChesnokov Yuriy26-Nov-08 2:04 
AnswerRe: ¿Quién sabe? alphablending 2 bitmaps Pin
Christian Graus26-Nov-08 8:09
protectorChristian Graus26-Nov-08 8:09 
AnswerRe: ¿Quién sabe? alphablending 2 bitmaps Pin
Chesnokov Yuriy26-Nov-08 19:30
professionalChesnokov Yuriy26-Nov-08 19:30 
NewsRe: ¿Quién sabe? alphablending 2 bitmaps Pin
Chesnokov Yuriy26-Nov-08 19:36
professionalChesnokov Yuriy26-Nov-08 19:36 
AnswerRe: ¿Quién sabe? alphablending 2 bitmaps Pin
Gabriel.P.G28-Nov-08 16:03
Gabriel.P.G28-Nov-08 16:03 
QuestionShort cut key..... Pin
m_mun26-Nov-08 0:53
m_mun26-Nov-08 0:53 
AnswerRe: Short cut key..... Pin
sashoalm26-Nov-08 2:09
sashoalm26-Nov-08 2:09 
AnswerRe: Short cut key..... Pin
Aabid26-Nov-08 3:20
Aabid26-Nov-08 3:20 
QuestionAplication header is not including while adding class with wizard Pin
krishnakumartm26-Nov-08 0:48
krishnakumartm26-Nov-08 0:48 
AnswerRe: Aplication header is not including while adding class with wizard Pin
_AnsHUMAN_ 26-Nov-08 1:19
_AnsHUMAN_ 26-Nov-08 1:19 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.