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

C / C++ / MFC

 
GeneralRe: Bug in CSplitterWnd Pin
Gary R. Wheeler27-Mar-04 5:35
Gary R. Wheeler27-Mar-04 5:35 
GeneralRe: Bug in CSplitterWnd Pin
Prakash Nadar27-Mar-04 6:07
Prakash Nadar27-Mar-04 6:07 
GeneralEnumprocess Pin
firke_vishu@math.net27-Mar-04 1:19
sussfirke_vishu@math.net27-Mar-04 1:19 
GeneralRe: Enumprocess Pin
Prakash Nadar27-Mar-04 1:31
Prakash Nadar27-Mar-04 1:31 
GeneralRe: Enumprocess Pin
Gary R. Wheeler27-Mar-04 3:41
Gary R. Wheeler27-Mar-04 3:41 
GeneralRe: Enumprocess Pin
Prakash Nadar27-Mar-04 13:47
Prakash Nadar27-Mar-04 13:47 
Generalresouce from .dll Pin
nareshn227-Mar-04 1:05
nareshn227-Mar-04 1:05 
GeneralFor resouce .dll Pin
nareshn227-Mar-04 0:51
nareshn227-Mar-04 0:51 
Hi I am try to find one solution but failed ...Frown | :( i had treid hard but not seems to success...
Generally I had download one example from
http://www.codeguru.com/Cpp/W-P/dll/article.php/c3637

In this example One MDI application is in .dll with resouce and Resouce is displaying from Main application.

<cpp>
in .dll describe like this

#define CLSID_APP 0x10

// interface IDs
#define IID_MyIUnknown 0x1000
#define IID_IDocument 0x1001

// document constants
#define C_DOC_1 0x100
#define C_DOC_2 0x101

// instantiate an interface class object
BOOL __declspec(dllexport) App_GetClassObject(int nClsid,
int nId,
void** ppvObj);

struct MyIUnknown
{
MyIUnknown() { TRACE("Entering IUnknown ctor %p\n", this); }
virtual BOOL QueryInterface(int nIid, void** ppvObj) = 0;
virtual DWORD Release() = 0;
virtual DWORD AddRef() = 0;
};

struct AFX_EXT_CLASS IDocument : public MyIUnknown
{
IDocument() { TRACE("Entering IDocument ctor %p\n", this); }
virtual CDocTemplate* CreateDocTempl( CWinApp*, int ) = 0;
virtual void CreateFrame() = 0;
};

//end of .dll
<cpp>

in .exe calling like this

<cpp>
void CExeApp::InitDll()
{
VERIFY( App_GetClassObject(CLSID_APP,
IID_IDocument,
(void**)&pIDoc) );
}

///and
BOOL CExeApp::InitInstance()
{
InitDll();
pIDoc->CreateDocTempl(this, C_DOC_1);
pIDoc->CreateFrame();
}

also

int CExeApp::ExitInstance()
{
// TODO: Add your specialized code here and/or call
// the base class
ReleaseDll();

return CWinApp::ExitInstance();
}

void CExeApp::ReleaseDll()
{
pIDoc->Release();
}

//end of .exe
<cpp>

So this code for loading resouce from .dll. ALl going great it's loading resouce from .dll and taking function also
But Now problem is there in .dll i have one dialog that i am displaying from .exe . SO in this dialog i want to call one function from Button1
so i have to copy my function into .dll but it's useless..
Basically i want to creat this function in .exe and calling from .dll like this

This will be in .dll
<cpp>

CDialog::OnButton1
{
CallFunctionFromexe()
}

<cpp>

This will be in .exe
CFormView::Void CallFunctionFromexe()
{
//my function

}


So i one who can understand all this say me how i do all this ?
Sleepy | :zzz:

This is some ascii work also




Dll has
Contain Resource------>One Dialog with Button1
| |
| |
| |
| Dialog::OnButton1()
| {
| callfunctionfromexe()
| }
|
|
|
exe has
Importing resouce-------->Function ::Void Callfunctionfromexe()
from .dll


SO when button1 will clicked so function will call from .exe using resouce .dll

Suggestion required !!!!!!!!
thanx
naresh
QuestionDeriving from an ATL object? Pin
Roozbeh6926-Mar-04 21:57
professionalRoozbeh6926-Mar-04 21:57 
AnswerRe: Deriving from an ATL object? Pin
Prakash Nadar26-Mar-04 23:38
Prakash Nadar26-Mar-04 23:38 
Generalplease help me Pin
Hatem M Nassar26-Mar-04 19:20
Hatem M Nassar26-Mar-04 19:20 
GeneralRe: please help me Pin
Prakash Nadar26-Mar-04 23:31
Prakash Nadar26-Mar-04 23:31 
Generalusing extern Pin
monrobot1326-Mar-04 19:02
monrobot1326-Mar-04 19:02 
GeneralRe: using extern Pin
Prakash Nadar26-Mar-04 23:28
Prakash Nadar26-Mar-04 23:28 
GeneralMultithread locking Pin
Madmaximus26-Mar-04 15:28
Madmaximus26-Mar-04 15:28 
GeneralRe: Multithread locking Pin
Tim Smith26-Mar-04 15:37
Tim Smith26-Mar-04 15:37 
GeneralRe: Multithread locking Pin
Prakash Nadar26-Mar-04 18:21
Prakash Nadar26-Mar-04 18:21 
GeneralMicrosoft Comunications Control Pin
ScarberryProd26-Mar-04 13:27
ScarberryProd26-Mar-04 13:27 
GeneralRe: Microsoft Comunications Control Pin
Branislav26-Mar-04 20:22
Branislav26-Mar-04 20:22 
QuestionCan anyone Help??? Pin
MrNiceBerG26-Mar-04 11:32
MrNiceBerG26-Mar-04 11:32 
AnswerRe: Can anyone Help??? Pin
johnsb226-Mar-04 12:59
johnsb226-Mar-04 12:59 
AnswerRe: Can anyone Help??? Pin
David Crow26-Mar-04 13:48
David Crow26-Mar-04 13:48 
GeneralRe: Can anyone Help??? Pin
MrNiceBerG26-Mar-04 19:04
MrNiceBerG26-Mar-04 19:04 
GeneralRe: Can anyone Help??? Pin
David Crow29-Mar-04 2:05
David Crow29-Mar-04 2:05 
GeneralDate Time Picker Pin
JoeMass26-Mar-04 10:27
JoeMass26-Mar-04 10:27 

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.