|
Makes sense. Guess I just misunderstood the documentation. Thanks for the clarification.
- Aaron
|
|
|
|
|
Hi,
How can I print the icon?
DrawIcon()doesn't work with printer dc...
Regards
Neha
|
|
|
|
|
u can find nice stuff under bitmaps & palettes section...my favorite is Davide Pizzolato...
|
|
|
|
|
THis is the way I do it:
int xSize = (pDC->GetDeviceCaps(LOGPIXELSX) * 16) / 96;
int ySize = (pDC->GetDeviceCaps(LOGPIXELSY) * 16) / 96;
::DrawIconEx(pDC->m_hDC, x - (xSize / 2), y - (ySize / 2), m_pTemplate->GetIcon(), xSize, ySize, 0, NULL, DI_IMAGE | DI_MASK);
This will scale correctly for a preview and a print. although I have seen problems on some printers etc which do not use the mask correctly
Roger Allen - Sonork 100.10016
Strong Sad:
Clever I am? Next to no one.
Undiscovered and soggy.
Look up. Look down. They're around.
Probably laughing. Still, bright, watery.
Listed among the top. Ten.
Nine. Late night. Early morn.
Early mourn. Now I sleep.
|
|
|
|
|
Hi All
i have a CStringArray, which i had added 1500 items to
how can i loop through my array, retirving each individual item
please help, im being a bit thick today
ta
simon
|
|
|
|
|
durrr i said i was being a bit thick
for (int i = 0; i <= arr.GetUpperBound(); i++)
{
CString id= arr[i];
}
simon
|
|
|
|
|
for (int i = 0; i < cstra.GetSize(); i++)
{
CString s = cstra[i];
CString ss = cstra.GetAt(i);
}
|
|
|
|
|
Hi,
How to debug an application which is having multiple threads on windows paltform ?? Anybody got some clues??
Thx & Reg,
Satya
|
|
|
|
|
run it trough the debugger...?
/Magnus
- I don't necessarily agree with everything I say
|
|
|
|
|
put a breakpoint in each thread and press F8 to step through the execution context will toggle between threads... If you pressF5 then you may loose the control of debugging the threades.
MSN Messenger.
prakashnadar@msn.com
Tip of the day of visual C++ IDE.
"We use it before you do! Visual C++ was developed using Visual C++"
|
|
|
|
|
Debugging threads is always difficult. If at all possible try to debug with the minimum number of threads at any one time.
As has already been mensioned context switching will occur while debugging threads.
Ant.
|
|
|
|
|
I think you can use the ordinary "TRACE" inside each threads, and then use F5 to debug.
This will only show you the sequence of operations that really happen. But the advantage is that you will know what is happened on when
But don't use too many TRACE, on each thread, cause doing so will make the debug report is too long and hard to TRACE
does it help?
Programming or Die?
----C++ 4 ever-----
|
|
|
|
|
Guys,
I developed a simple console appliation using Visual C++ 6.0 for the purpose of exception handling. I developed a simple program:
#include <stdio.h>
class CFoo
{
public:
CFoo()
{
throw;
}
};
int main(int argc, char* argv[])
{
try
{
CFoo foo;
}
catch(...)
{
printf("Exception Occured");
}
return 0;
}
i.e i throw exception from the constructor of CFoo class and wants to catch this exception in the main().
But this is not happening, instead my program crashes when i encounters throw and show dialog box of Visual C++ debug library that "Abnormal Program Termination". Can any one tell me why program is unable to enter the catch(..) block ??
Imtiaz
|
|
|
|
|
You can't throw an exception in constructor of statically allocated object. For details, search 'exceptions in constructors' in MSDN.
Robert-Antonio
"Czech Railways discovered, that in case of disaster the most damaged wagons
were the first and the last. So they decided to create trains without them."
|
|
|
|
|
You've got to throw something. The statement
throw; does a rethrow, i.e. it throws again the exception that triggered a catch handler:
try{
...
}
catch(...){
printf("oops!");
throw;
} Try for instance throw "hello"; in CFoo ctor. The problem should go away.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
Does anyone know of a decent HTTP framework for C++? I want to include a simple HTTP server interface into a program, and would rather not code it by hand and so am looking for a suitable library. I've done a search but cannot find anything appropriate, and dont really want to start ripping code from Apache.
Note that it must be platform independant!
|
|
|
|
|
I dunno, have you tried searching in google?
Programming or Die?
----C++ 4 ever-----
|
|
|
|
|
Yes, thanks for that, who would have thought to use google.
|
|
|
|
|
Hi,
I have recently started working with a company that wants me to move an application from MAC to PC. They want to incorporate the MAC application into their newly created VB.NET application.
Is there an easy way to move the MAC C++ code to Visual C++.Net? The C++ code on the MAC should be mostly MAC independent (or so I have been told)!
Best regards
Pål Eilertsen
|
|
|
|
|
palei wrote:
Is there an easy way to move the MAC C++ code to Visual C++.Net? The C++ code on the MAC should be mostly MAC independent (or so I have been told)!
It all depends on what the code is made up of.
Obviously you'll have to scrap any GUI code, as the Mac API's are totally different to the Win32 API's.
If the other code uses standard C++, it shouldn't be too much trouble to recompile it on Windows. I've not taken code from MAC to PC, but I have taken PC code to MAC.
Michael
But you know when the truth is told,
That you can get what you want or you can just get old,
Your're going to kick off before you even get halfway through.
When will you realise... Vienna waits for you? - "The Stranger," Billy Joel
|
|
|
|
|
Hi,
My problem :
In my MFC-Dialog the funktion CMyProgDlg::OnInitDialog() starts a static Funktion in a thread (AfxBeginThread).
How is it possible to access a non-static member-variable (etc. m_txt) out of the static function?
The error: error C2597: illegal reference to non-static member 'CMyProgDlg::m_Txt'
Thanks!!!
|
|
|
|
|
you must pass the dialog as a parameter to the
static funtion.
in the static function you can cast the UserDefined
LPVOID parameter back to your CMyProgDlg and use
the m_Text member.
|
|
|
|
|
this[^] might help
C makes it easy to shoot yourself in the foot; C++ makes it harder, but when you do, it blows away your whole leg
|
|
|
|
|
Pass a pointer to CMyProgDlg instance as a parameter to the thread function:
void CMyProgDlg::ThreadFunc(LPVOID pParam)
{
CMyProgDlg* pDlg = (CMyProgDlg*)pParam;
}
void CMyProgDlg::OnInitDialog()
{
AfxBeginThread(CMyProgDlg::ThreadFunc, this);
}
Robert-Antonio
"A flower walked around a meadow. She saw a beatiful human and plucked off his head."
|
|
|
|
|
Hi
I'm trying to work with dialog boxes and I need to know if my needs are implementable.
As we all know when we want to register a window class (to create a window of it later), we set a value of "WNDCLASS" structure named "cbWndExtra", this value specifies number of the bytes to reserve for each window instance. These bytes can be accessed through "SetWindowLong" and "GetWindowLong" calls.
Since we don't register a "WNDCLASS" for a dialog box, I need to know if I can use these facilities while I'm working with dialog boxes!! Is it possible? How?
Thanks in advance
Mehran Ziadloo
|
|
|
|