Click here to Skip to main content
15,888,315 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Question of DLL SendMessage to exe program Pin
7nightlove17-Jul-06 22:33
7nightlove17-Jul-06 22:33 
Questionhow to set the button position??? Pin
mimimimilaw17-Jul-06 16:29
mimimimilaw17-Jul-06 16:29 
AnswerRe: how to set the button position??? Pin
Chris Losinger17-Jul-06 16:41
professionalChris Losinger17-Jul-06 16:41 
AnswerRe: how to set the button position??? Pin
Naveen17-Jul-06 17:26
Naveen17-Jul-06 17:26 
AnswerRe: how to set the button position??? Pin
Hamid_RT17-Jul-06 18:12
Hamid_RT17-Jul-06 18:12 
Questionsever Pin
With_problem17-Jul-06 16:24
With_problem17-Jul-06 16:24 
QuestionHow can we insert a new item to another program's ListCtrl control? Pin
tangbo617-Jul-06 15:58
tangbo617-Jul-06 15:58 
QuestionDebug Assertion Failed(File wingdi.cpp, line : 1054) Pin
dashprasannajit17-Jul-06 15:41
dashprasannajit17-Jul-06 15:41 
Hi All,

I created one MFC extension dll and loaded the exporated function in another sample
MFC SDI application on click of the toolbar events.This application is almost looks
simmilar to paintbrush where the exported functions are having the implementaion of
painting methods.The MFC sample EXE is just to call the extention DLL and call each
exported fucntion(in .DEF file of MFC Extension DLL) to test whether the actions are having or not but for one function i am getting runtime error while excuting the MFC
sample EXE i.e. "Debug Assertion Failed".
Program path of the sample MFC SDI exe......
File : wingdi.cpp
Line : 1054

I am giving following code snippets....

HDC hdc = NULL;
UINT uIntRect = 0;//RECTANGLE;
HWND hwnd = NULL;
BOOL uReturnVal= FALSE;
LPFNDLL_drawShape lpfndll_drawRectangle;
HMODULE hModule = LoadLibrary("D:\\FancyViewer\\Notebook_13July2006\\Notebook\\Debug\\Notebook.dll");
if(hModule)
{

lpfndll_drawRectangle = (LPFNDLL_drawShape)GetProcAddress(hModule,"drawShape");
if (!lpfndll_drawRectangle)
{
AfxMessageBox("GetProcAddress() method is failed");
FreeLibrary(hModule);
return;
}
else
{
CRect rect;
GetClientRect(rect);
CPaintDC dc1(this);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc1);
hwnd = (HWND)dc1.GetWindow();
hdc = dc1.Detach();
uIntRect = RECTANGLE;

// call the function of drawShape method for rectangle of Notebook.dll
uReturnVal = lpfndll_drawRectangle(hdc,uIntRect,hwnd);
ASSERT(uReturnVal == TRUE);
char buffer[65];
MessageBox(_itoa(GetLastError(),buffer,10),NULL,MB_OK);
return;
}
}
else
{
AfxMessageBox("Load library failed");
return;
}
GetLastError();
QuestionRe: Debug Assertion Failed(File wingdi.cpp, line : 1054) Pin
Nibu babu thomas17-Jul-06 18:54
Nibu babu thomas17-Jul-06 18:54 
QuestionInherited Class as Base Class in ClassWizard? Pin
Reagan Conservative17-Jul-06 11:55
Reagan Conservative17-Jul-06 11:55 
AnswerRe: Inherited Class as Base Class in ClassWizard? Pin
Nibu babu thomas17-Jul-06 18:19
Nibu babu thomas17-Jul-06 18:19 
QuestionRegular expressions Pin
Harold_Wishes17-Jul-06 11:13
Harold_Wishes17-Jul-06 11:13 
AnswerRe: Regular expressions Pin
led mike17-Jul-06 11:24
led mike17-Jul-06 11:24 
Questiondynamic array of strings Pin
jon-8017-Jul-06 10:24
professionaljon-8017-Jul-06 10:24 
AnswerRe: dynamic array of strings [modified] Pin
Chris Losinger17-Jul-06 10:48
professionalChris Losinger17-Jul-06 10:48 
GeneralRe: dynamic array of strings Pin
led mike17-Jul-06 11:02
led mike17-Jul-06 11:02 
GeneralRe: dynamic array of strings Pin
Chris Losinger17-Jul-06 11:06
professionalChris Losinger17-Jul-06 11:06 
GeneralRe: dynamic array of strings Pin
led mike17-Jul-06 11:19
led mike17-Jul-06 11:19 
GeneralRe: dynamic array of strings Pin
jon-8018-Jul-06 10:52
professionaljon-8018-Jul-06 10:52 
GeneralRe: dynamic array of strings Pin
Chris Losinger18-Jul-06 11:33
professionalChris Losinger18-Jul-06 11:33 
QuestionRe: dynamic array of strings Pin
jon-8019-Jul-06 5:39
professionaljon-8019-Jul-06 5:39 
AnswerRe: dynamic array of strings Pin
Chris Losinger19-Jul-06 5:46
professionalChris Losinger19-Jul-06 5:46 
QuestionRe: dynamic array of strings Pin
jon-8019-Jul-06 6:05
professionaljon-8019-Jul-06 6:05 
AnswerRe: dynamic array of strings Pin
Chris Losinger19-Jul-06 6:57
professionalChris Losinger19-Jul-06 6:57 
AnswerRe: dynamic array of strings Pin
Hamid_RT17-Jul-06 19:40
Hamid_RT17-Jul-06 19:40 

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.