|
Because the child frame is a *child* of the main window, I believe hiding the main window will hide the child. However, if you resize the main window to 1x1 pixel and put it at -100, -100, it's very rare for the multimonitor setup to exist that will see your one pixel window. Just store the CRect the window takes up first so you can restore it.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I'm writing Client & Server program, i'm using ADO ...
If i wanna write program on the Client computer, i must add this line to my source code ?
pRecordset->CursorLocation = adUseClient;
Is that necessery ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
Yes, if you are using a access Database, but if you are using a SQL Server I saw that the bookmarks and absolute positions don't works if you dont use that parameter.
Cheers!!!!
Carlos Antollini.
|
|
|
|
|
I got your mean about Access database ...
But i didn't understand your mean about SQL Server database, you mean if i uss SQL Server database, If i use CursorLocation or i don't use CursorLocation in my program, result is equal ?
Is it right ?
My month article: Game programming by DirectX by Lan Mader.
Please visit in: www.geocities.com/hadi_rezaie/index.html
Hadi Rezaie
|
|
|
|
|
I have a pointer to a CButton -derived object that is assigned using GetDlgItem (though I have tried using FromHandle and FromHandlePermanent ).
Any ideas why sometimes (in a release build) the m_pCtrlSite member of CCmdTarget gets set to 1? I think it should be NULL unless it is something to do with an ActiveX control, which it isn't.
This is causing my subsequent call to EnableWindow to fail because inside the CWnd calls it checks m_pCtrlSite for NULL , which it isn't if it's 1. But trying to dereference it (as in the CWnd ) casues an obvious access violation.
Derek Lakin.
Salamander Software Ltd.
|
|
|
|
|
Hi,
Could somebody solve the following serialization problem (sorry, the experts out there).
I have a pointer to an object in CMyDoc class, such as
class CMyDoc : public CDocument
{
protected:
CModel* pModel;
// ... other members go here
};
where CModel is a CObject derived class, defined as
class CModel : public CObject
{
CArray <csomeobj, csomeobj&=""> obj;
// other memebers ...
};
The CSomeObj is Cobject derived, and has one or more CString members, mixed with other types.
we call the Serialize override of obj from CModel::Serialize( CArchive& ar) in the statement
obj.Serialize(ar);
It goes fine for storing all the objects, but when loading them back, my program gets an error because it reads back a wrong CString memebers of the 'obj' object, but Other data of different type ar Ok.
I do not unerstand why ? any help, please ?
|
|
|
|
|
Use < and > instead of < and >. And post the serialization code from CYourDoc and CModel.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I am able to display a tooltip in a CScrollView initailly but when I scroll down or to the right, then the tooltips don't want to appear.
Anybody had this problem before?
Thank you
Franz Klein
|
|
|
|
|
Do you call OnPrepareDC before DPtoLP conversion during hit-testing?
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
In my application i want to return a value into an edit box. i know that i have to change the value in a string type value.
So, as the value i want to return is a double i would like to use the function _ecvt.
But i have a pb with it, because if i want to return for example a number as 3.14, there is no pb, but if the value is 0.0314, the first 0 after "." is not taken.
In my code i do that:
int decimal,sign;
.
.
.
m_dlgPrice=0.0314;
strParam=_fcvt(m_dlgPrice,4,&decimal,&sign);
CString strInt=strParam.Left(decimal);
CString strDecimal =strParam.Mid(decimal); strParamFin.Format("%s.%s",strInt,strDecimal);
CEdit* Edit=(CEdit*)GetDlgItem(IDC_PRICE);
Edit->SetWindowText(strParamFin);
and in the edit box i could only see .314, so where is the pb?
thanks in advance for your help.
gerald
|
|
|
|
|
i actually don't know why you do it THIS way.. i would rather use
strParamFin.Format ("%f", m_dlgPrice);
this works great for me..if the output isn't what you're looking for (use other style specifications like %g )
hope this helps
bernahrd
"Politicians and diapers have one thing in common. They should both be changed regularly and for the same reason."
|
|
|
|
|
you were right, thanks for your help
gerald
|
|
|
|
|
... i have got a directory with many subdirs.. in most of them there is a foo.cfg file.. i would like to open now all these files..
is there any chance for me and not iterating through all the dir's with find_file???
thanks in advance
bernhard
"Politicians and diapers have one thing in common. They should both be changed regularly and for the same reason."
|
|
|
|
|
You have the attribute that inform you if the file is a directory. I don't know if you are working with MFC, but when you find a directory and if it is not dot, you need to use the find file into the directory, each time that you find a directory you need to find into it...
Good luck...;)
Carlos Antollini.
|
|
|
|
|
write a recursive function using CFindFile
FindFile(String strDirectory)
{
OPEN FILE_FIND(strDirectory)
FOR EACH file IN FILE_FIND
IF IS_DIRECTORY(file) THEN
FindFile(file)
ELSE
// do something else
END IF
NEXT file
CLOSE FILE_FIND
}
Regards
Ray
"Je Suis Mort De Rire"
|
|
|
|
|
thanks for the prompt answer...
bernhard
"Politicians and diapers have one thing in common. They should both be changed regularly and for the same reason."
|
|
|
|
|
Can anybody help me?
I want to set 2 different text colors in one item.
Is this possible and how can i do that?
|
|
|
|
|
You'll need to draw the item yourself, changing the text color with SetTextColor() before you draw the word you want colored differently.
--Mike--
http://home.inreach.com/mdunn/
"....." -- Silent Bob
your with and
|
|
|
|
|
Please, show me mistakes.
This code save array of pixels into txt file as RGB (0...255) for every pixel.
Code perfect works for 24 and 32 bitmaps, but it doesn't work for 8 & 16 bitmaps.
No, it works for 8,16, but save wrong array of pixel
What's the problem, i cann't find
If you know, please, help me
void CMainWnd::SaveAsArray(LPCTSTR filename)
{
int BytesPerPixel = (lpBitmap->biSizeImage)
/(lpBitmap->biHeight * lpBitmap->biWidth);
int WidthBytes = lpBitmap->biWidth * BytesPerPixel;
int size = sizeof(BITMAPINFOHEADER)
+ sizeof(RGBQUAD) * lpBitmap->biClrUsed;
BYTE *Bits = (LPBYTE)lpBitmap
+ size;
BYTE * ScanLine;
BYTE * Data;
BYTE Red, Green, Blue;
CStdioFile skadr;
CString string;
skadr.Open(filename, CFile::modeCreate|CFile::modeWrite);
for( int y = lpBitmap->biHeight; y>0; --y )
{
ScanLine = Bits + (WidthBytes * (y - 1));
Data = ScanLine;
for( int x = 0; x<lpbitmap->biWidth - 1; ++x )
{
LPRGBQUAD Quad = (LPRGBQUAD) Data;
Blue = Quad->rgbBlue;
Green = Quad->rgbGreen;
Red = Quad->rgbRed;
BYTE color = (Red
+ Green
+ Blue)/3;
string.Format("\t %d", color);
skadr.WriteString(string);
Data += BytesPerPixel;
}
string.Format("\n" );
skadr.WriteString(string);
}
skadr.Close();
}
|
|
|
|
|
16 bit bitmaps do not use a BYTE for each colour, they use 5 bits per colour and one spare. 8 bit bitmaps use a palette and one byte to store each colour, which is a lookup value into the palette.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
What can you advise?
What i need to change in my code to work with 8 and 16 bitmaps.
I don't know how to work with 8 and 16 bitmaps.
Thanks for your help!
Sergei
|
|
|
|
|
Does the structure, for example 8 bpp bitmap, goes thus:
Red;
data+=byte;
Green;
data+=byte;
Dark blue;
data+=byte;
// Miss of reserve
data+=byte;
If so, whence to take colours?
Willn't structure RGBQUAD help any more?
I.e. what analog will be to string:
Red = Quad->rgbRed?
There can be I are mistaken?
In what my error?
|
|
|
|
|
My app creates a modless dialog and enters the message loop etc. Why when I do a 'Minimize All Windows' on the Taskbar, does my application not minimize ...?
Regards
Ray
"Je Suis Mort De Rire"
|
|
|
|
|
The Window needs the the style 'overlapped' doh!.
Regards
Ray
"Je Suis Mort De Rire"
|
|
|
|
|
well i just went through some of the codes available for graphical displays , however didnt find ne in which we can simply draw graph using the mouse .... and the then can easily get the respactive co-ordinates ....
need guidance on how to achieve this ... maybe some reference or sth ,....
Thanks in advance ...
|
|
|
|