Click here to Skip to main content
15,900,378 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralMore info (wierd !!) Pin
Still learning how to code27-Jun-02 2:55
Still learning how to code27-Jun-02 2:55 
GeneralRe: More info (wierd !!) Pin
Still learning how to code27-Jun-02 2:58
Still learning how to code27-Jun-02 2:58 
GeneralEject of PCMCIA card Pin
Josef Schroettle27-Jun-02 2:06
Josef Schroettle27-Jun-02 2:06 
GeneralProblem with creating a toolbar in a DLL Pin
Mohit Khanna27-Jun-02 1:55
Mohit Khanna27-Jun-02 1:55 
GeneralRe: Problem with creating a toolbar in a DLL Pin
Roger Allen27-Jun-02 3:43
Roger Allen27-Jun-02 3:43 
GeneralRe: Problem with creating a toolbar in a DLL Pin
Mohit Khanna27-Jun-02 22:56
Mohit Khanna27-Jun-02 22:56 
GeneralRe: Problem with creating a toolbar in a DLL Pin
Roger Allen27-Jun-02 23:08
Roger Allen27-Jun-02 23:08 
GeneralRe: Problem with creating a toolbar in a DLL Pin
Mohit Khanna27-Jun-02 23:34
Mohit Khanna27-Jun-02 23:34 
Hi Allen,
I tried it, but now it asserts at CDockContext::CDockContext()...

ASSERT(pBar->m_pDockSite != NULL);

The docksite for my toolbar is NULL....
This code is called by the EnableDocking Method()....

There is really something wrong... Is it valid to pass AfxGetApp()->m_pMainWnd->m_hWnd to DLL's fucntion... and then convert it into (CWnd *) and then use it as the mainframe???

Please help in this...

Now my code is...

bool CPlug_In_1App::CreatePlugInToolBar()
{
AFX_MANAGE_STATE(AfxGetStaticModuleState());

HINSTANCE hInstance = AfxGetResourceHandle();
// set resource handle to ourselves (the DLL)
AfxSetResourceHandle(theApp.m_hInstance);
if (!m_wndPlugInToolBar.CreateEx(m_pFrame, TBSTYLE_FLAT, WS_CHILD|CBRS_ALIGN_TOP, CRect(0, 0, 0, 0), IDR_PLUGIN_1)
|| !m_wndPlugInToolBar.LoadToolBar(IDR_PLUGIN_1))
{
TRACE0("Failed to create toolbar\n");
// reset resource handle
AfxSetResourceHandle(hInstance);
return NULL;
// fail to create
}
//lose garnage pixels
m_wndPlugInToolBar.SetBarStyle(m_wndPlugInToolBar.GetBarStyle()|CBRS_BORDER_3D);
m_wndPlugInToolBar.EnableDocking(CBRS_ALIGN_ANY);
m_wndPlugInToolBar.SetWindowText("TraySetup & Communication");
m_wndPlugInToolBar.EnableToolTips(TRUE);
// reset resource handle
AfxSetResourceHandle(hInstance);

retrun true
}


-Mohit
GeneralRe: Problem with creating a toolbar in a DLL Pin
Roger Allen28-Jun-02 0:21
Roger Allen28-Jun-02 0:21 
GeneralRe: Problem with creating a toolbar in a DLL Pin
Mohit Khanna28-Jun-02 0:50
Mohit Khanna28-Jun-02 0:50 
Generalconnecting to a remote database Pin
Sam197927-Jun-02 1:50
Sam197927-Jun-02 1:50 
GeneralRe: connecting to a remote database Pin
Le centriste27-Jun-02 5:19
Le centriste27-Jun-02 5:19 
GeneralRe: connecting to a remote database Pin
Mike Nordell28-Jun-02 9:35
Mike Nordell28-Jun-02 9:35 
GeneralAbout memory leaks Pin
Rage27-Jun-02 1:47
professionalRage27-Jun-02 1:47 
GeneralRe: About memory leaks Pin
Ramu Pulipati27-Jun-02 2:01
Ramu Pulipati27-Jun-02 2:01 
GeneralRe: About memory leaks Pin
Rage27-Jun-02 2:19
professionalRage27-Jun-02 2:19 
GeneralRe: About memory leaks Pin
Christian Graus27-Jun-02 2:21
protectorChristian Graus27-Jun-02 2:21 
GeneralRe: About memory leaks Pin
Frank Driesens27-Jun-02 2:40
Frank Driesens27-Jun-02 2:40 
GeneralRe: About memory leaks Pin
Rage27-Jun-02 2:55
professionalRage27-Jun-02 2:55 
GeneralRe: About memory leaks Pin
LittleYellowBird27-Jun-02 4:33
LittleYellowBird27-Jun-02 4:33 
GeneralRe: About memory leaks Pin
Rage27-Jun-02 4:51
professionalRage27-Jun-02 4:51 
GeneralGetting shldisp.h Pin
Ravi Shankar27-Jun-02 1:35
Ravi Shankar27-Jun-02 1:35 
GeneralRe: Getting shldisp.h Pin
Ramu Pulipati27-Jun-02 1:57
Ramu Pulipati27-Jun-02 1:57 
GeneralCRecordset - Retrieving SQL & Parameters on Fail Pin
Henry Kafeman27-Jun-02 1:02
Henry Kafeman27-Jun-02 1:02 
GeneralRe: CRecordset - Retrieving SQL & Parameters on Fail Pin
Bill Wilson27-Jun-02 10:04
Bill Wilson27-Jun-02 10:04 

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.