Click here to Skip to main content
15,905,967 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: rand() causing unresolved external symbol Pin
Member 321680814-Aug-09 3:27
Member 321680814-Aug-09 3:27 
QuestionWord automation question Pin
sashoalm13-Aug-09 4:54
sashoalm13-Aug-09 4:54 
AnswerRe: Word automation question Pin
Stuart Dootson13-Aug-09 5:11
professionalStuart Dootson13-Aug-09 5:11 
GeneralRe: Word automation question Pin
sashoalm13-Aug-09 5:35
sashoalm13-Aug-09 5:35 
GeneralRe: Word automation question Pin
Stuart Dootson13-Aug-09 22:17
professionalStuart Dootson13-Aug-09 22:17 
QuestionStatic pointer Pin
kumar sanghvi13-Aug-09 4:22
kumar sanghvi13-Aug-09 4:22 
AnswerRe: Static pointer Pin
Cedric Moonen13-Aug-09 4:29
Cedric Moonen13-Aug-09 4:29 
GeneralRe: Static pointer Pin
kumar sanghvi13-Aug-09 5:03
kumar sanghvi13-Aug-09 5:03 
ya ill explain....

i have function which calculates the font ie...

CFont* Temp::m_newFont=NULL;
void Temp::init(CDC*pDc)
{
NONCLIENTMETRICS ncmet;
ncmet.cbSize = sizeof(ncmet);
SystemParametersInfo(SPI_GETNONCLIENTMETRICS, sizeof(ncmet), &ncmet, 0);
m_newFont=new CFont;
LOGFONT lf;
HDC hDC=pDc->GetSafeHdc();
SecureZeroMemory(&lf, sizeof(lf));
lf.lfHeight = -MulDiv(20, GetDeviceCaps(hDC, LOGPIXELSY), 72);
lf.lfWeight = FW_MEDIUM;
lstrcpy(lf.lfFaceName,ncmet.lfMenuFont.lfFaceName);
m_newFont->CreateFontIndirect(&lf);

}

and other function which returns pointer..

CFont* Temp::getFont()
{
return m_newFont;
}

where as the above 2 functions are static functions and m_newFont(member varibale) is a static CFont*...

and now im exporting this class using _declspec(dllexport)

and im using this class in some other process..as below...


where pDc is a CDC pointer..
Temp::init(pDC);

and when im trying to use

LOGFONT lf;
CFont* pFont=Temp::getFont();
pFont->GetLogFont(&lf);

lf.lfHeight value is garbage value.....instead of correct value
and when i used Quickwatch and see pFont i see m_hObject as 0x00000000

im not able to understand why it"s getting null..

and even i tried like instead of creating a static pointer i created static CFont object and in getFont() i returned address of the object ...but even that doesn"t help...

pls let me know..
GeneralRe: Static pointer Pin
sashoalm13-Aug-09 21:00
sashoalm13-Aug-09 21:00 
QuestionSequencing or queuing parallel process [modified] Pin
s v joshi13-Aug-09 3:36
s v joshi13-Aug-09 3:36 
AnswerRe: Sequencing or queuing parallel process Pin
Iain Clarke, Warrior Programmer13-Aug-09 4:10
Iain Clarke, Warrior Programmer13-Aug-09 4:10 
AnswerRe: Sequencing or queuing parallel process Pin
Stuart Dootson13-Aug-09 5:09
professionalStuart Dootson13-Aug-09 5:09 
QuestionCFileDialog::HideControl() broken Pin
softwaremonkey13-Aug-09 2:47
softwaremonkey13-Aug-09 2:47 
AnswerRe: CFileDialog::HideControl() broken PinPopular
Stuart Dootson13-Aug-09 3:25
professionalStuart Dootson13-Aug-09 3:25 
GeneralRe: CFileDialog::HideControl() broken Pin
softwaremonkey13-Aug-09 4:30
softwaremonkey13-Aug-09 4:30 
AnswerRe: CFileDialog::HideControl() broken Pin
Iain Clarke, Warrior Programmer13-Aug-09 3:52
Iain Clarke, Warrior Programmer13-Aug-09 3:52 
QuestionStrange runtime behavior without breakpoint Pin
Tomas(cz)13-Aug-09 0:55
Tomas(cz)13-Aug-09 0:55 
AnswerRe: Strange runtime behavior without breakpoint Pin
Code-o-mat13-Aug-09 2:07
Code-o-mat13-Aug-09 2:07 
GeneralRe: Strange runtime behavior without breakpoint Pin
Tomas(cz)13-Aug-09 3:41
Tomas(cz)13-Aug-09 3:41 
QuestionCapture inactive desktop in windows Pin
Stifly13-Aug-09 0:36
Stifly13-Aug-09 0:36 
AnswerRe: Capture inactive desktop in windows Pin
Code-o-mat13-Aug-09 6:57
Code-o-mat13-Aug-09 6:57 
QuestionRandom Name Generator Pin
Chuck Vought13-Aug-09 0:30
Chuck Vought13-Aug-09 0:30 
QuestionRe: Random Name Generator Pin
CPallini13-Aug-09 0:55
mveCPallini13-Aug-09 0:55 
AnswerRe: Random Name Generator Pin
Chuck Vought13-Aug-09 2:11
Chuck Vought13-Aug-09 2:11 
GeneralRe: Random Name Generator Pin
CPallini13-Aug-09 2:31
mveCPallini13-Aug-09 2:31 

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.