Click here to Skip to main content
15,917,174 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralWhen i press my checkbox, no check appears... Pin
6-May-02 6:43
suss6-May-02 6:43 
GeneralRe: When i press my checkbox, no check appears... Pin
Tim Smith6-May-02 6:50
Tim Smith6-May-02 6:50 
GeneralRe: When i press my checkbox, no check appears... Pin
6-May-02 6:59
suss6-May-02 6:59 
GeneralOne more Q :=) How do i check the box myself? Pin
6-May-02 7:05
suss6-May-02 7:05 
GeneralRe: One more Q :=) How do i check the box myself? Pin
Tim Smith6-May-02 7:48
Tim Smith6-May-02 7:48 
GeneralThankyou Pin
6-May-02 8:03
suss6-May-02 8:03 
GeneralMCSD question Pin
6-May-02 5:24
suss6-May-02 5:24 
GeneralSwitch views in SDI using MFC extention DLL Classes Pin
Dave Loeser6-May-02 5:19
Dave Loeser6-May-02 5:19 
Hey guys, I've got one that I hope someone can help with:
Over on codeguru.com there is an article titled Separating the views of an MDI application into different DLLs

What I'm trying to do is create this same fucntionality within a SDI application. This app is workflow based and using an MDI just doesn't work for this type of application.

Here's some of what I have; In my DLL, I have exported one function:

extern "C" AFX_EXT_API UINT Init(CString *strLabel,CRuntimeClass **pRunTimeClass)
{
    new CDynLinkLibrary(View1DLL);
    *pRunTimeClass = RUNTIME_CLASS(CTestView);
    *strLabel = "View 1";		
    return 0;
}


In my test application I have a menu that will call this method when selected:
void CMainFrame::OnViewSwitchtodll() 
{
HINSTANCE hDLL;     
LPDLLFUNC lpfnDllFunc;   
UINT  uReturnVal;
CString strLabel;
CRuntimeClass* runtimeclass;
    
    hDLL = LoadLibrary("View1.dll");
    lpfnDllFunc = (LPDLLFUNC)::GetProcAddress(hDLL,"Init");
    if (!lpfnDllFunc)
    {
        FreeLibrary(hDLL);       
    }
    else
    {
	uReturnVal = lpfnDllFunc(&strLabel,&runtimeclass);
	CAADoc* pDoc = (CAADoc*)this->GetActiveDocument();
	pDoc->SwitchToView(runtimeclass);
    }
}


This loads up the DLL grabs a function pointer to the Init function exported in the DLL and then passes the runtimeclass to the SwitchToView() in my Document class (this was taken from an article on CodeProject).


When I step into SwitchToView the runtimeclass object appears to be fine... and I do not receive errors... but the mHwnd of the runtimeclass is ??? in the Variable inspector during debug.

I've come to the point where I need someone else to take a look at this - so any help?

Thanks in advance,

Dave "Dak Lozar" Loeser
GeneralRemoving the scroll bars Pin
6-May-02 5:09
suss6-May-02 5:09 
GeneralGetting a file from a website Pin
derfel6-May-02 5:05
derfel6-May-02 5:05 
GeneralRe: Getting a file from a website Pin
Ravi Bhavnani6-May-02 5:10
professionalRavi Bhavnani6-May-02 5:10 
GeneralRe: Getting a file from a website Pin
Paul M Watt6-May-02 6:11
mentorPaul M Watt6-May-02 6:11 
GeneralRe: Getting a file from a website Pin
Ravi Bhavnani6-May-02 14:14
professionalRavi Bhavnani6-May-02 14:14 
GeneralRe: Getting a file from a website Pin
Joao Vaz6-May-02 6:26
Joao Vaz6-May-02 6:26 
GeneralRe: Getting a file from a website Pin
markkuk6-May-02 22:02
markkuk6-May-02 22:02 
GeneralRe: Getting a file from a website Pin
derfel7-May-02 4:03
derfel7-May-02 4:03 
Generalnetstat Pin
adara6-May-02 4:41
adara6-May-02 4:41 
Questionregistering an ActiveX on pc? Pin
Atilla Selem6-May-02 4:22
Atilla Selem6-May-02 4:22 
AnswerRe: registering an ActiveX on pc? Pin
Carlos Antollini6-May-02 4:50
Carlos Antollini6-May-02 4:50 
GeneralRe: registering an ActiveX on pc? Pin
Atilla Selem6-May-02 19:40
Atilla Selem6-May-02 19:40 
GeneralAnother registering problem... Pin
Atilla Selem7-May-02 0:01
Atilla Selem7-May-02 0:01 
GeneralRe: Another registering problem... Pin
Carlos Antollini7-May-02 3:34
Carlos Antollini7-May-02 3:34 
GeneralPrinting with the IE Webbrowser Control Pin
6-May-02 3:04
suss6-May-02 3:04 
Questionhow to scroll in a windowless control Pin
6-May-02 2:44
suss6-May-02 2:44 
Questionhow to do it ? Pin
Angel Kid6-May-02 2:19
Angel Kid6-May-02 2: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.