|
Actually, I figured it out. There is an "Adobe Photoshop SDK" on the Adobe Photoshop CD (Version 6.0 and earlier -- apparently they started charging for it in Version 7.0).
Regards, Larry
|
|
|
|
|
How can I get rid of the black line drawn at the bottom of a tab control? None of the options on the property pages seem to do it without adding other lines in places i don't want, and i don't see any member functions that would do it. I want a control that has the dialog face color on its bottom edge (like a typical property page tab set), not black.
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
derive the control !
onncpaint
framerect(clientrect,getsyscolorbursh(COLOR_3DFACE));
that`s it ! no more border !
I am the mighty keeper of the book on knowledge . Contact me to get your copy .
|
|
|
|
|
if you meant this:
void CMyTab::OnNcPaint()
{
CDC *pDC = GetDC();
CRect cr;
GetClientRect(cr);
FrameRect(pDC->m_hDC, cr, ::GetSysColorBrush(COLOR_3DFACE));
ReleaseDC(pDC);
}
then, no. that's not it. the border is still there.
-c
Image tools: ThumbNailer, Bobber, TIFFAssembler
|
|
|
|
|
I'm looking for a way to change the IP address of my computer through an application and testing to make sure there is no network conflict, ect. Can anyone point me to a good resource to figure this out? Thanks
|
|
|
|
|
Are you asking how to change it programatically, or are you just wanting to change the ip?
You can use ipconfig from the command line to change network settings pretty quickly, but I am not sure if that is what you are asking for.
Could you clarify what you want to do please?
- Dana
|
|
|
|
|
How do I check for leaked GDI objects?
|
|
|
|
|
They don't leak in W2000/XP. In W 95/98/ME, you'll find you suddenly can't draw any thing, nor can the system. MSDN mag ran a tool that showed the number of resources used and allowed you to browse them, a couple of years ago I think.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
They leak every where, but WinNT/Win2000,WinXP system are use 32bit vales for addressing up to 2^32 GDI objects while 9x system uses just 16bit values, thus can hold only 2^16, which is much fewer. However that does not mean you can use the whole 4 billion GDI objects in WinNT systems, still the system put an upper limit but I do not know it exaclty, but I did encounter resource leak in WinXP before.
check this MSDN article
http://msdn.microsoft.com/msdnmag/issues/01/03/leaks/default.aspx
Anyway, to detect resource leaks in Win2000/WinXP just open the task manger and go to the processes tab, then from from the "View" menu choose "Select Columns..." the check "GDI Objects". After that look up your process from the system processes and monitor its GDI Object, if they constantly increase then you have a leak, if it increase then stop increasing then it could just be initial allocations.
|
|
|
|
|
Here my special problem:
I have a class CBauteil (derived from CObject) and an CObArray.
CBauteil has although Array with an CObject Class (CBauteilschicht).
exp.
class CDoc : public CDocument
{
public:
CObArray m_oaBauteil;
...}
_________________________________________________
class CBauteil : public CObject
{
public:
CObArray m_oaBauteilSchicht;
...}
_________________________________________________
//Acces to first (filled) array
CBauteil *pBauteil = (CBauteil*) pDoc->m_oaBauteil[0];
//Pointer to second ObArray (m_oaBauteilschicht)
pBauteil->m_oaBauteilschicht
//Now I add a new entry to the first Array
CBauteil *pNeuBauteil = new CBauteil();
pDoc->m_oaBauteil.Add(pNeuBauteil );
//and now I want to copy the first Entry of the "SubArray"
pNewBauteil->m_oaBauteilSchicht.Copy(pBauteil->m_oaBauteilschicht);
The Problem:
When I change a value in the original Array m_oaBauteilSchicht[0] the value in m_oaBauteilSchicht[1] changes although. How can I get a real copy so that I can change the values seperately?
|
|
|
|
|
AnTri wrote:
can I get a real copy so that I can change the values seperately?
allocate a new CBauteil object. copy the data from your 'source' object. add the new object to the second array.
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
Hello,
I have a VC++6(MFC) Application which is giving me a problem in Windows98/ME, but not on XP or 2000. The App has a CView that I use to draw on the screen OnDraw(CDC* pDC). I read information for an access database using ado and from that information I draw a chart on the screen. It runs five on XP/2000 but on 98 after a while or many call to the OnDraw functions it freezes and all the bitmaps that I am drawing on the screen don’t show anymore when I try to open a dlg it show a message box saying “A required resource was”.
Any help will be appreciated.
Thank You,
Alfred
|
|
|
|
|
the first thing you need to do is to check for leaked GDI objects.
-c
When history comes, it always takes you by surprise.
|
|
|
|
|
I have a dialog that owns a tree control.
I want to catch a middle button down message in the dialog class.
How can I do this ?
I can catch the message in the tree control but I don't want this.
Does anyone have an idea what can I do about this problem.
Thanks
Orcun Colak
|
|
|
|
|
This should work.. Handle the PreTranslateMessage() Function in your dialog..
BOOL CMyDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message == WM_MBUTTONDOWN)
AfxMessageBox("Middle Button Pressed");
return CDialog::PreTranslateMessage(pMsg);
}
Rob
Whoever said nothing's impossible never tried slamming a revolving door!
|
|
|
|
|
Hio! I am working on a function that searches a huge text file (28000+ lines) for one line of text.. currently i am reading through every single line to find the number im lookin for.. and reading/loading the file currently takes about 25-30 seconds on a 500mhz..
how can i buffer the whole file faster? notepad only takes a half second to open the file, how can i do that? is there any way to jump to a specific line in a text file such that i can start halfway and go up or down if the number im looking for is higher or lower (the numbers are in order, but not sequential)?
here is what i have now, obviously the line by line approach wont work to well
while (!inFile.eof())
{
WndProgress.StepIt();
WndProgress.PeekAndPump();
if (WndProgress.Cancelled()) {
AfxMessageBox("Progress Error!");
WndProgress.DestroyWindow();
return FALSE;
}
inFile.getline(szBuffer2, sizeof(szBuffer2)-1);
strTemp = szBuffer2;
if (strTemp.Left(1) != ".")
{
CNumberAndName* pEntry = new CNumberAndName();
pEntry->m_strRoutingNumber = strTemp.Left(9);
pEntry->m_strBankName = strTemp.Mid(11,36);
paBankArray->Add(pEntry);
}
}
also, is there any easy way to tell how many lines long the file is?
thanks a bunch for any suggestions!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
I suspect that Notepad is in fact opening the file as a memory mapped file, i.e. the file exists as if it was in memory, but it's on disk.
If you're reading with iostreams, you can do a seek to a point to start reading from, but in characters, not lines. The only way to speed up a search is to build an index.
Christian
NO MATTER HOW MUCH BIG IS THE WORD SIZE ,THE DATA MUCT BE TRANSPORTED INTO THE CPU. - Vinod Sharma
Anonymous wrote:
OK. I read a c++ book. Or...a bit of it anyway. I'm sick of that evil looking console window.
I think you are a good candidate for Visual Basic. - Nemanja Trifunovic
|
|
|
|
|
i am using ifstream because it is all i am currently familiar with, i am looking to learn any quicker methods.. is there any way that i can handle the file like notepad is? once i have all of my lines loaded into memory the search is very very quick, the whole problem is loading the whole file into memory (which isnt a requirement, its just how im currently doing it, as im deleting all objects once i find the text anyways)
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
I don't understand why this is taking so long. I'd get rid of the progress bar updates. Also see if you can increase the size of the buffer ifstream uses. Why do you need to copy the string into a CString. Just use strchr() on szBuffer2.
As others have said Memory Mapped Files are great for this, but using streams should also be more than fast enough. There is something or several things fundamentally wrong with your implementation.
Also look at profiling the code, which will show you where the bottlenecks are. Look at Glowcode www.glowcode.com[^]
In ED (see sig) loading a 30K line is instantaneous. As is finding something at the end of such a file.
Neville Franks, Author of ED for Windows. www.getsoft.com
Make money with our new Affilate program
|
|
|
|
|
Map the file into memory and use
good guesses about where a certain
line may be. Then make your way from
there to where you need to read.
That way you should only have to
read a small part of the file.
(hopefully)
|
|
|
|
|
can you give me some keywords on where to start to map the file into memory? i don't know how to do that. im searching cp for 'memory file', and other things, but im not having any success.. is there a keyword associated with mapping a file to memorY?
thanks!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
Bare bones:
HANDLE hFile=::CreateFile(Filename,GENERIC_READ,FILE_SHARE_READ,0,OPEN_EXISTING,FILE_ATTRIBUTE_NORMAL,NULL);
HANDLE hMap=::CreateFileMapping(hFile,0,PAGE_READONLY,0,0,0);
const char* pFile=(char*)::MapViewOfFile(hMap,FILE_MAP_READ,0,0,0);
;
::UnmapViewOfFile(pFile);
::CloseHandle(hMap);
::CloseHandle(hFile);
|
|
|
|
|
First, don't use strTemp. It is a total waste of time. All of those left operations are creating temp objects that just aren't needed.
if (szBuffer2 [0] != '.')
{
CNumberAndName *pEntry = new CNumberAndName ();
szBuffer [9] = 0;
pEntry ->m_strRoutingNumber = szBuffer;
szBuffer [11+36] = 0;
pEntry ->m_strBankName = &szBuffer [11];
paBankArray ->Add (pEntry);
}
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|
|
thanks a bunch.. seems that i need to learn how char arrays work, i always use cstrings because they are easy for me to use.. thanks for the code.. now all i have to do is figure out what you are doing with the char arrays
thanks again for everyones help!
still a newb.. cut me some slack :P
-dz
|
|
|
|
|
The "szBuffer [0] == '.'" is just checking to see if the first character is a '.'.
The szBuffer [9] = 0; is splitting the string into two parts. The first part starts at szBuffer [0] and is 9 characters long. The second part starts at szBuffer [10] and contains the rest of the string. This allows you to copy the first part of the string into your destination.
The szBuffer [11+36] = 0; is doing the same thing. But now we have three strings.
What this does is remove the need to allocate a new buffer to hold the string, copy that string into the new buffer, and then extra elements from the string piece by piece. By directly operating on the original string, we avoid a fair amount of overhead.
Tim Smith
I'm going to patent thought. I have yet to see any prior art.
|
|
|
|