|
Hi Christian,
thank you very much for your readiness to help me in this way!
As you can see below, I could solve my problems.
best wishes
jens
|
|
|
|
|
If you have an MDI app you need to go
AfxGetApp()->MDIGetActive()->GetActiveView->GetDocument(); ( or possibly AfxGetApp()->MDIGetActive()->GetActiveDOcument();, but I'm not sure on that one ).
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|
|
Great! fantastic! excellent!
Thank you very mutch for your suggestion
It works fine.
Some small correction:
MDIGetActive() is not a element from derived CWinApp class (CMyApp), but CMDIFrameWnd::MDIGetActive. So I insert a pointer to the CMainFrame:
CMainFrame* pmyFrame = (CMainFrame*)AfxGetMainWnd();
ASSERT_VALID(pmyFrame);
CMyDoc * pmyDoc = (CMyDoc*) pmyFrame->MDIGetActive()->GetActiveDocument();
ASSERT_VALID(pmyDoc);
thank you
regards
jens
|
|
|
|
|
HOWTO: Get Current CDocument or CView from Anywhere
Article ID: Q108587
werks fer me, eh...
|
|
|
|
|
Hi Tim
Maybe I am blind.
How can I find this article?
thanks in advance
regards
jens
|
|
|
|
|
This is a Miscosoft Knowledge Base (KB) article from the MSDN - if you don't have the MSDN Library installed, you can go to msdn.microsoft.com and search for the article (Q108587) number.
|
|
|
|
|
Does anyone know how can I writing addtional modules (DLL) to Microsoft Flight Simulator? In SDK isn't nothing about it ;-(
If You know, please tell me it...
Eml: piopawlu@interia.pl
|
|
|
|
|
I have some code that draws a filled rectangle with a CBrush and FillRect() , changes the window origin, and then continues to draw lines with a CPen . My problem is that the lines are being drawn behind the filled rectangle, and messing with the window origin with SetWindowOrg() seems to be doing it. Commenting out my call to SetWindowOrg() draws the lines on top.
Why is it doing this?
Simon
Hey, it looks like you're writing a letter!
Sonork ID 100.10024
|
|
|
|
|
This has been resolved.
Simon
Hey, it looks like you're writing a letter!
Sonork ID 100.10024
|
|
|
|
|
Here is my code:
DWORD dwMask;
CHARFORMAT cf;
dwMask = m_wndChild.GetDefaultCharFormat(cf);
cf.dwMask = dwMask | CFM_COLOR ;
cf.dwEffects ^= CFE_AUTOCOLOR;
m_wndChild.SetWindowText(m_sTexto);
COLORREF Gris = RGB (192,192,192);
COLORREF Azul = RGB (20,20,200);
COLORREF Azul_Claro = RGB(50,50,255);
COLORREF Verde = RGB (0,255,0);
int Tamano_Array = m_arrPosicIluminar.GetSize();
for (int i=0; i < (Tamano_Array / 2);i++)
{
m_wndChild.SetSel(m_arrPosicIluminar[i*2],m_arrPosicIluminar[i*2+1]);
cf.crTextColor = Verde;
// cf.crBackColor = Gris; //This is not possible
m_wndChild.SetSelectionCharFormat(cf);
}
m_wndChild.SetSel(-1,0);
Thanks in Advance.
|
|
|
|
|
Sorry. I found the answer in a previous thread.
"You can set a background color for selected text using RichEdit 2.0 or later. Just pass CHARFORMAT2 structure to CRichEditCtrl::SetSelectionCharFormat and set crBackColor member to whatever you want."
|
|
|
|
|
Has anyone got any code/example how to create/use a CListCtl with a CHeaderCtl using WTL? (NO MFC!!!)
Ignorance sould be pitied, not flamed.
|
|
|
|
|
Hi all,
I'm writing Dialog-base program ...
I have created Toolbar for my program ... (with CToolBar)
Now, i wanna set Tooltip for my buttons in the toolbar ...
I wrote this code, but won't work !
This code have not any error or warning but don't show tooltip !
Sometimes it crashes !
PLEASE HELP ME !
ON_NOTIFY_EX_RANGE(TTN_NEEDTEXT, 0, 0xFFFF, OnTooltips)
// 0 and 0xFFFF aren't my button's ID in my toolbar, i write below code too, but won't work
// ON_NOTIFY_EX_RANGE(TTN_NEEDTEXT, IDC_BUTTON1, IDC_BUTTON8, OnTooltips)...
BOOL CLoanDialog::OnTooltips(UINT id, NMHDR *pNMHDR, LRESULT *pResult)
{
TOOLTIPTEXT *pTTT = (TOOLTIPTEXT*)pNMHDR;
UINT nID = pNMHDR->idFrom;
if(pTTT->uFlags & TTF_IDISHWND)
{
nID = (UINT)(WORD)::GetDlgCtrlID((HWND)nID);
if(nID)
{
strcpy(pTTT->szText, "Hadi"); // I want to show Hadi string for all buttons ...
*pResult = 0;
return(TRUE);
}
}
return(FALSE);
}
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Toolbars supprt their own built in tooltips. You should be able to set them up as follows:
When creating the toolbar, and looking at the properties of each button, you can enter a string which is the staus bar prompt. The tooltip of the button can be entered in the format:
"Status bar prompt"\n"Tooltip"
Just set the associated text for each button.
You may need to call EnableToolTips on your toolbar to get he me to work. I have never used a toolbar in a dialog project, but it should work this way.
Roger Allen
Sonork 100.10016
|
|
|
|
|
Hi Roger,
I did thease works, but i have problem, still
Please help me !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I use CDaodatabase to open the mdb file,
I use the code follow:
try
{
m_db.Open(m_Source,FALSE,FALSE,_T(""));
}
catch(CDaoException* e)
{
e->Delete();
return false;
}
return true;
but every time it throw a error code
|
|
|
|
|
Since you haven't posted enough code we can only guess.
If you have kept the mdb open in Access , then Access has exclusive access. Close Access before running your code.
That might be the problem.
Nish
Sonork ID 100.9786 voidmain
www.busterboy.org
Nish is a BIG fan of Goran Ivanisevic
|
|
|
|
|
That could be it, although, to my knowledge, Access 97 doesn't demand exclusive access to the .mbd it has open. At least, my application can read the database without any problems. Quite handy since i can modify the database in Access, and have my app redraw the results by invalidating the view.
Simon
Hey, it looks like you're writing a letter!
Sonork ID 100.10024
|
|
|
|
|
It works better (sharing wise) if you have your tables seperate from the code/views etc. Its also handy to have your queries external.
Access's own user login bit has never seemed to quite get the hang of sharing. With a sort of random selection of locking techniques, one record or whole table.
This all seems to be ok once your tables are seperated.
Another point, which will no doubt cause a scrap amongst us all, is that I tend towards a non Access data type. DBase IV is a favourite, since it can be made accessible from many different language/office apps and you have a wide range of ODBC drivers that your own code can use.
(I'll wait behind the bike sheds for the first up)
We do it for the joy of seeing the users struggle.
|
|
|
|
|
What is your Access database version ?
If you used Access 2000, then you must use AfxGetModuleState for solve it !
See MSDN !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Sorry ,I can't find the AfxGetModuleState function in MSDN
Can you show me how to use it?
thank you
|
|
|
|
|
One of member variables in AfxGetModuleState is about Database version, set it to 0x601 ... don't ask me WHY ? (it is because you are using Access 2000)
Then you can use Open function !
Bye, i'm now busy, sorry !
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
We are developing application in wince.We need to rotate the screen 90.Is there any way to do this.we
are using the following code to achive this,But its not working in proper way
unsigned short buffer[240][320];
unsigned short * pusLine = (unsigned short *)GXBeginDraw();
for (unsigned int y = 0; y < gx_displayprop.cyHeight; y++)
{
unsigned short * pusDest = pusLine;
for (unsigned int x = 0; x < gx_displayprop.cxWidth; x++)
{
//*pusDest = PixelCol;
buffer[x][y] = *pusDest;
pusDest+= gx_displayprop.cbxPitch >> 1;
}
pusDest += gx_displayprop.cbyPitch >> 1;
}
GXEndDraw();
pusLine = (unsigned short *)GXBeginDraw();
for (unsigned int x = 319; x>0; x--)
{
unsigned short * pusDest = pusLine;
for(unsigned int y = 0 ;y<239;y++)
{
*pusDest = 255;
pusDest+= gx_displayprop.cbxPitch >> 1; }
pusDest += gx_displayprop.cbyPitch >> 1;
}
GXEndDraw();
|
|
|
|
|
- Sometimes I do not include certain .h file(s), but the app still runs ok. I do not know why. Are there any defaults .h file(s)?
- Can you give me an example?
- Best regards,
Maer
|
|
|
|
|
There are no default .h files, you're probably either including stuff you don't need, or you're including other headers that #include the other ones you need.
Christian
After all, there's nothing wrong with an elite as long as I'm allowed to be part of it!! - Mike Burston Oct 23, 2001
|
|
|
|