|
Is that any way that call CMainFrame's function
from my CDocument class?
Best Regards.
MJM.
|
|
|
|
|
What's wrong with AfxGetMainWnd() ?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Do u mean i use AfxGetMainWnd()
& then use PostMessage to handling that with
CMainFrame class?
|
|
|
|
|
You indicated that you wanted to "call CMainFrame's function from my CDocument class." AfxGetMainWnd() is used to get a pointer to the frame window object. With that, you can call whatever function you need.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
But i can not access function that i declare in CMainFrame object!
for example i wrote CreatePane function in CMainFrame object.
i wanna call this function
from CMyDocument ! i use AfxGetMainWnd but m_pMainWnd can not access
CreatePane or CreatePane did not declare in FrameWnd object!
best Regards.
MJM.
|
|
|
|
|
mostafa_pasha wrote: But i can not access function that i declare in CMainFrame object!
Why not?
mostafa_pasha wrote: but m_pMainWnd can not access
CreatePane or
Probably because you forgot to cast the return value from AfxGetMainWnd() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Thanks a lot , i forget casting!
Best Regards.
MJM.
|
|
|
|
|
i need if is found , or not !
if is found SetWindowText the string from another table and if is not AfxMessageBox ("Not Found in your Database !")
this is my code :
void CNcontabile::OnChangeGestiuneadb()
{
CString strCourseID;
CWaitCursor wait; // Display a wait cursor
CDatabase_Bun *pBun;
pBun = new CDatabase_Bun;
// Set the filter
pBun->m_strFilter = "um = '" + strCourseID +"'";
if(pBun->Open());
return;
if (pBun->IsOpen())
{
while(!pBun->IsEOF())
{
m_gestiuneaDb.GetWindowText(strCourseID);
strCourseID.TrimLeft();
strCourseID.TrimRight();
m_gestiuneaDb.SetWindowText(strCourseID);
if(strCourseID == pBun->m_um )
{
m_dengestiuneDb.SetWindowText("GGGGGGG");
}
}
}
pBun->Close();
delete pBun;
}
is not working because i have a filter and is no match !
my second problem is how to trim the spaces ? (CEdit & the CDatabase spaces ) ????????????
Bravoone
|
|
|
|
|
Why it doesnt work and what filter?
|
|
|
|
|
Bravoone_2006 wrote: pBun->m_strFilter = "um = '" + strCourseID +"'";
Since strCourseID is empty, this'll never work.
Bravoone_2006 wrote: m_gestiuneaDb.GetWindowText(strCourseID);
strCourseID.TrimLeft();
strCourseID.TrimRight();
m_gestiuneaDb.SetWindowText(strCourseID);
Why are you calling these in a loop? Call them once outside of the loop.
Bravoone_2006 wrote: if(strCourseID == pBun->m_um )
I don't suppose you've bothered to set a breakpoint on this statement to see the different values of strCourseID (which we already know is empty) and pBun->m_um . That's the main reason why you can't see the problem.
Bravoone_2006 wrote: is not working because i have a filter and is no match !
Actually it is working. It's doing exactly what you told it to do - find records where pBun->m_um is equal to empty. Hint: no records match this criteria.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
And then how can i match records with strCourseID? and i need to do this fast because i have many records !
the records in my database have spaces !
Bravoone
|
|
|
|
|
Bravoone_2006 wrote: And then how can i match records with strCourseID?
By assigning it a value.
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I wrote a Rss reader,used the webbrowser control.
I think it would be nice if I can integrate google toolbar.
so I tried.
but never worked
can anybody give me a help?
Much thanks!
|
|
|
|
|
I do not think that you can - I believe that BHOs and similar ADD-ins are supported by the "framework" provided by Internet Explorer, not by the WebBrowser control proper.
This is actually one of the dangers of hosting the WebBrowser control. If you allow it to be used for general browsing by a user (allowing dropped links, not properly disable the context menu, handing the new window event, etc.), the user is browsing in a "less secure" environment than Internet Explorer offers, and this may lead to problems (like popup-mismanagement).
Peace!
-=- James If you think it costs a lot to do it right, just wait until you find out how much it costs to do it wrong! Avoid driving a vehicle taller than you and remember that Professional Driver on Closed Course does not mean your Dumb Ass on a Public Road! DeleteFXPFiles & CheckFavorites (Please rate this post!)
|
|
|
|
|
I could get hold of a lot of tutorials on Codeproject to custom paint the List View Items but I want to draw a custom selection bar. Is there any way this can be achieved?
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
|
|
|
|
|
HakunaMatada wrote: Is there any way this can be achieved?
ofcourse here is the code
void ListCtrlEx::OnCustomDraw( NMHDR* pNMHDR_i, LRESULT* pResult_i )<br />
{<br />
NMLVCUSTOMDRAW* pLVCD = reinterpret_cast<NMLVCUSTOMDRAW*>( pNMHDR_i );<br />
NMCUSTOMDRAW &nmcd = pLVCD->nmcd;<br />
*pResult_i = CDRF_DODEFAULT;<br />
switch (nmcd.dwDrawStage)<br />
{<br />
case CDDS_PREPAINT:<br />
<br />
*pResult_i = CDRF_NOTIFYITEMDRAW;<br />
break;<br />
<br />
case CDDS_ITEMPREPAINT:<br />
{<br />
if( nmcd.uItemState&CDIS_SELECTED )<br />
{<br />
pLVCD->clrTextBk = RGB(255,0,0);<br />
nmcd.uItemState &= ~CDIS_SELECTED;<br />
}<br />
else<br />
{<br />
pLVCD->clrTextBk = RGB(255,255,255);<br />
}<br />
<br />
*pResult_i = CDRF_DODEFAULT ;
break;<br />
}<br />
default:<br />
*pResult_i = CDRF_DODEFAULT;<br />
break;<br />
}<br />
<br />
<br />
}
nave
|
|
|
|
|
Hi all,
I'm trying to get a region containing the icon from the listview. I tried using "ListView_GetItemRect(hSysListView32Wnd, i, &rect, LVIR_ICONS)" on
SysListView32, but it returns a region that is too big (contains a
rectangular block surrounding the icon).
Thanks in advance.
Amar.
|
|
|
|
|
which type of view did u tried?
nave
|
|
|
|
|
Hi,
I am wanting to know if there is a way to programaticaly generate a preview image of an installed theme/style on Windows XP.
Thanks.
|
|
|
|
|
|
u can use OpenThemeData() function to open a specific theme. Then pass this handle to various DrawTheme...() functions.
nave
|
|
|
|
|
Hi all
I need to insert a DATA breakpoint on one of my variables; I need that this breakpoint should be active only after a particular condition occurrs in time in another point of the code.
I don't want to pause the debugging to manually active this breakpoint; the activation should be automatically triggered some way.
Do you know a way to activate this breakpoint dinamically while my code is running? There is code for activating a breakpoint at runtime?
Regards
Manu Stone
|
|
|
|
|
manustone wrote: There is code for activating a breakpoint at runtime?
At runtime, all debugging info is discarded, is it even possible?
|
|
|
|
|
I've been suggested DebugBreak(). I still haven't the change to test it ( I will do immediately) so I don't know ( probably it will) disable in the Release version of the app.
Do you know some other functions or practical methods to insert breakpoint in the code? I'm really interested in DATA breakpoints?
Thanks for your response.
Manu
|
|
|
|
|
At run time or through writing assembler instructions? I don't know if it can be done at run time, sincerely. But with asm its possible.
__asm int 3;
Nobody can give you wiser advice than yourself. - Cicero
|
|
|
|