Click here to Skip to main content
15,913,722 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionloading dll second time giving error "A required resource was unavailable" Pin
appollosputnik1-Mar-12 0:16
appollosputnik1-Mar-12 0:16 
AnswerRe: loading dll second time giving error "A required resource was unavailable" Pin
Jochen Arndt1-Mar-12 0:33
professionalJochen Arndt1-Mar-12 0:33 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
appollosputnik1-Mar-12 1:30
appollosputnik1-Mar-12 1:30 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
Jochen Arndt1-Mar-12 1:44
professionalJochen Arndt1-Mar-12 1:44 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
appollosputnik1-Mar-12 1:53
appollosputnik1-Mar-12 1:53 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
Jochen Arndt1-Mar-12 2:03
professionalJochen Arndt1-Mar-12 2:03 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
appollosputnik1-Mar-12 3:14
appollosputnik1-Mar-12 3:14 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
Jochen Arndt1-Mar-12 3:38
professionalJochen Arndt1-Mar-12 3:38 
That's one place where you release a DC (in your app or the DLL?). If not in the DLL, you should concentrate on the DLL code. There may be multiple places in your code using DCs and GDI objects. If you miss any release call or forget to de-select GDI objcets out of context, the error may occcur.

I can't really help you without seeing the code. I can only guess.
Check this example code:
C++
CDC *pDC = GetDC();
CPen NewPen(PS_SOLID, 0, m_Color);
CPen *pOldPen = pDC->SelectObject(&NewPen);
CFont *pOldFont = pDC->SelectObject(m_pMyFont);
// do something with the DC
...
// Don't forget to select the old objects
pDC->SelectObject(pOldFont);
pDC->SelectObject(pOldPen);
// Don't forget to release the DC
ReleaseDC(pDC);

GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
appollosputnik1-Mar-12 3:58
appollosputnik1-Mar-12 3:58 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
Jochen Arndt1-Mar-12 4:14
professionalJochen Arndt1-Mar-12 4:14 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
appollosputnik1-Mar-12 4:30
appollosputnik1-Mar-12 4:30 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
appollosputnik1-Mar-12 4:32
appollosputnik1-Mar-12 4:32 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
Jochen Arndt1-Mar-12 5:34
professionalJochen Arndt1-Mar-12 5:34 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
appollosputnik1-Mar-12 6:02
appollosputnik1-Mar-12 6:02 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
Wes Aday1-Mar-12 6:13
professionalWes Aday1-Mar-12 6:13 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
Jochen Arndt1-Mar-12 6:16
professionalJochen Arndt1-Mar-12 6:16 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
Wes Aday1-Mar-12 6:19
professionalWes Aday1-Mar-12 6:19 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
appollosputnik1-Mar-12 6:25
appollosputnik1-Mar-12 6:25 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
Jochen Arndt1-Mar-12 6:34
professionalJochen Arndt1-Mar-12 6:34 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
Chris Meech1-Mar-12 6:40
Chris Meech1-Mar-12 6:40 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
appollosputnik1-Mar-12 16:34
appollosputnik1-Mar-12 16:34 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
Richard MacCutchan1-Mar-12 20:42
mveRichard MacCutchan1-Mar-12 20:42 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
appollosputnik1-Mar-12 21:54
appollosputnik1-Mar-12 21:54 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
Richard MacCutchan1-Mar-12 23:12
mveRichard MacCutchan1-Mar-12 23:12 
GeneralRe: loading dll second time giving error "A required resource was unavailable" Pin
appollosputnik1-Mar-12 20:19
appollosputnik1-Mar-12 20: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.