|
THANX A LOT 'markkuk'. U are a GENIUS (i mean ur computer)
It works. Please please please tell me in which book did u find that syntax.... I was reading C++ from Stroupstrup and in fact... that was a question from the exercises of chapter-5. But i cudnt dig out that particular syntax. thanx.
...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
|
|
|
|
|
It is really quite easy to decipher, or create, any simple or complex C/C++ decl, once you know how..
Ever heard of the "right-left rule" ? Again, google is your best friend...
Bikram Singh
|
|
|
|
|
Thank you bikram singh.... YOU ARE MY BEST FRIEND.
'right-left' rule was a BLAST. i dont know how i missed to learn it.... ANYWAY... now i am a genius too.... thanx a lot
|
|
|
|
|
Is there an API function to get Printer feedback from the current job printing?
Thanks
|
|
|
|
|
Yes.
The EnumJobs function retrieves information about a specified set of print jobs for a specified printer.
The JOB_INFO_1 structure specifies print-job information such as the job-identifier value, the name of the printer for which the job is spooled, the name of the machine that created the print job, the name of the user that owns the print job, and so on.
That does the trick!
|
|
|
|
|
Hi , i have a picture box with a large image loaded. can anyone guide me on how to implement a vertical and horizonal scroll bar to see the entire image. Is there a function to autosize the image to fit in my picture box?
thanks in advance ...
|
|
|
|
|
|
You can use _ttoi or brew your own (more robust) function.
bool convertWideStringToInt
(wchar_t* wStr,
int& nInt)
{
if (wscanf (wStr, _T("%d"), &nInt) == 1)
return (true);
return (false);
} /ravi
My new year's resolution: 2048 x 1536
Home | Articles | Freeware | Music
ravib@ravib.com
|
|
|
|
|
ExtFloodFill is used for device context
is there any method to use ExtFloodFill to fill a bitmap ?
thanks...
|
|
|
|
|
hey, how about blitting the bitmap to that device context and then using the same floodfill function
...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
|
|
|
|
|
Ok, i just im making a binder
and i am using the CreateFile(), ReadFile(), and WriteFile() functions
now it took me long enough to figure out you cant read 28KB file into a buffer and write it all at once
Problem 1
As you should be able to guess im going to split the output by a string (no problem since i already wrote a function for that) but if im reading in segments then well you know it could cut into that string im splitting by
Problem 2
SetFilePointer doesnt seem to be working for me
if i could get this to work i have an idea that m
might (i stress might) solve my problems
|
|
|
|
|
Didn't the third parameter of ReadFile work (nNumberOfBytesToRead)?
Jaime
|
|
|
|
|
Yes the third parameter of ReadFile has alwase worked. i am sorry but i dont really see what that has to do with either of my problems
|
|
|
|
|
»Archer282« wrote:
now it took me long enough to figure out you cant read 28KB file into a buffer and write it all at once
Sure you can. I've used these functions before to read in a file 10x larger than that. No problem.
"When I was born I was so surprised that I didn't talk for a year and a half." - Gracie Allen
|
|
|
|
|
»Archer282« wrote:
now it took me long enough to figure out you cant read 28KB file into a buffer and write it all at once
Really. I've read and written larger files in the past. What problems did you encounter?
Michael
CP Blog [^]
|
|
|
|
|
well at first i just read all of it into one buffer
i defined it like so
char *szBuffer;
and then wrote all of it right after reading
everytime i would get the blue screen of death
then if i returned to windows it would be locked up
i looked at an example on MSDN which read and wrote the data in segments, i have had success doing it this way (no problems, except for the ones i mentioned)
note: when i did this in segments i defined my buffer like
char szBuffer[1024];
could this have been a problem?
if it will help i clean up and post the old code that was wasnt working
|
|
|
|
|
>>well at first i just read all of it into one buffer. i defined it like so
>>char *szBuffer;
Well Mr. Hotshot, are you allocating memory for szBuffer ??? before using it with your file-handling-functions.... IF NO.... god help you .
If yes... sorry.
USE malloc or new to alllocate appropriate amount of memory.
>>note: when i did this in segments i defined my buffer like
>>char szBuffer[1024];
look closely... here you alocate the buffer's size to be 1024 bytes. BUT in char* szBuffer.... YOU MAY NOT BE ALLOCATING ANY MEMORY and the 'BLUE SCREEN' loves programmers like you.
.... i hope i helped;)
...Avenger
Remember... testing & debugging are always part of programming ...so exterminate those stinking bugs
|
|
|
|
|
Funny how right when i go and ask for help my problem seem to be solved before i get an answer
I kinda reverted my code to the way it was when i gettting the bsod and now it seems to be working just fine
and i manged to get SetFilePointer() to go to the end but i had to use GetFileSize()
Logically you would think you could go to the end by doing
SetFilePointer( hFile, 0, NULL, FILE_END );
but i cant it get it to work doing that
infact i cant even get it to go anywhere from FILE_END
just occured to me could that be becuase i only used GENERIC_WRITE access?
|
|
|
|
|
Well, here's an idea to stop all those kind helping people from answering for nothing:
Once you realize you solved your problem, you could edit your original post and change its title, appending "<--solved" to it.
This would also have the added advantage of giving a clue to people having the same kind of question that they might find their answer in that thread.
Anyone agrees with me ?
|
|
|
|
|
Hi,
my application will always have this error after running for a while. The app regularly pops up modeless dialog and closing it after a while. This cycle repeats itself. The background property page will always do OnPaint when this modeless dialog pop up and closes.
Need advise on what could be the problem and how to resolve it. Thanks.
|
|
|
|
|
post some code so we will be able to guide you.
Jaime
|
|
|
|
|
please see below for portion of code
pDC->GetClipBox(&m_rect);
CreateCompatibleDC(pDC);
m_bitmap.CreateCompatibleBitmap(pDC, m_rect.Width(), m_rect.Height());
m_pOldBitmap = SelectObject(&m_bitmap); // ASSERT here
setWindowOrg(m_rect.left, m_rect.top);
Thanks.
|
|
|
|
|
Are you placing it in OnPaint method? if you are, that CreateCompatibleDC used is the global ::CreateCompatibleDC that expects a HDC as the parameter. That way, be sure the pDC is casted correctly to an HDC. By using the global API function, you will be returned an HDC for the new DC, which MUST be deleted when the DC is no longer needed.
Second, You are creating a compatible DC but you are not using it. You just continue using the old one.
Third, are you DeleteObject the bitmap you are creating?
Finally, if you are implementing a sort of double buffering, why not using a well tested class such as CMemDC which you can find in CodeProject? This class does all those affairs by you.
Jaime
|
|
|
|
|
Hi Jaime,
thanks for your reply. Actually I'm already using CMemDC and those codes are from there and the ASSERT happen in that class.
This is the CGridCtrl Class from by Chris Maunder.
void CGridCtrl::OnDraw(CDC& DrawDC)
{
CMemDC dc(&DrawDC);
#else // Use normal DC - this helps in debugging
void CGridCtrl::OnDraw(CDC& dc)
{
#endif
CRect rect;
int row,col;
CRect clipRect;
if (dc.GetClipBox(&clipRect) == ERROR) return;
EraseBkgnd(&dc); // OnEraseBkgnd does nothing, so erase bkgnd here.
// This necessary since we may be using a Memory DC.
int nFixedRowHeight = GetFixedRowHeight();
int nFixedColWidth = GetFixedColumnWidth();
......
}
Hope this is clearer. Thanks.
|
|
|
|
|
NadAzur wrote:
Hope this is clearer
Not really. What is the ASSERT text you get? Which file? What Line?
Bikram Singh
|
|
|
|