|
Wouldn't you have thought it could assert in the destructor if selected in the DC???
--
The Obliterator
|
|
|
|
|
Check your knowledge on DC b4 replying..
Sudip
Stupidity Sucks
|
|
|
|
|
Hello all,
I'd like ot copy from the screen to a bitmap. I have an MDI application that opens DIBs. After I open one, I'd like to get this DIB from the screen as a new bitmap in a new window.
I read the VC++ 6.0 Bible and they said just do this
void CDisplayDIBView::GetImage(int x, int y, CDC *pDC, CBitmap *pBitmap)
{
BITMAP bm;
pBitmap->GetObject( sizeof(BITMAP), &bm);
CDC MemDC;
MemDC.CreateCompatibleDC(pDC);
CBitmap *pOldBitmap = MemDC.SelectObject(pBitmap);
MemDC.BitBlt(0, 0, bm.bmWidth, bm.bmHeight, pDC, x, y, SRCCOPY);
MemDC.SelectObject(pOldBitmap);
}
Well when I do this, I get an error saying the instruction at
0x5f47c360 referenced memory at 0x000000e. The memory could not be "read."
How would I go about correcting this, or accomplishing what I want to do?
Thanks a whole lot,
NickOne
|
|
|
|
|
NickOne wrote:
Well when I do this, I get an error
which line gives you the error?
is pDC valid?
is pBitmap non-NULL?
-c
Being just contaminates the void. --Robyn Hitchcock
|
|
|
|
|
First make sure that your bitmap is not larger than your screen or the offset that you passed
(x,y) are not playing against you. Make sure your bitmap object is not null or too small.
Maybe you need to call CreateCompatibleBitmap(...) with your bitmap object.
Good luck!
Last Article:
Adding VBScript/JScript to C++ App
|
|
|
|
|
Hello everyone!
Does anyone knows how tu use the system tray ?
Thanks for your answers
|
|
|
|
|
If you refer to system tray icons, Chris Maunder's Adding Icons to the System Tray will probably cover all of your needs.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
yaa it is easy
NOTIFYICONDATA gl_sNotifyIconData;
gl_sNotifyIconData.cbSize=sizeof(NOTIFYICONDATA);
strcpy(gl_sNotifyIconData.szTip,"your Tool tip here");
gl_sNotifyIconData.uID=FTPTRAYID;
gl_sNotifyIconData.hIcon=AfxGetApp()->LoadIcon(ID of ur tray ICON);
gl_sNotifyIconData.uCallbackMessage=the Message ID of ur app here;
gl_sNotifyIconData.hWnd=this->m_hWnd;
gl_sNotifyIconData.uFlags=NIF_ICON|NIF_MESSAGE|NIF_TIP;
Shell_NotifyIcon(NIM_ADD,&gl_sNotifyIconData);
this will put the icon in to your system tray
and everythime u enter mouse over it it post some messages
so it is necessery to trap the message
by adding the ON_MESSAGE(messageID,onmessage) in your messagemap
and add a function like
onmessage(WPARAM wparam,LPARAM lparam)
{
wparam contains the trayID
and lparam caontains the message
handle them according to ur need
}
Renjith-CPian.
|
|
|
|
|
Hello
How can you make a dialog that doesn't take the control of the application (wait for the answer of DoModal)like the tool windows of psp for example...
|
|
|
|
|
These are called modeless dialogs. Search for these words on your documentation.
Joaquín M López Muñoz
Telefónica, Investigación y Desarrollo
|
|
|
|
|
|
Ok, I dont know what 'psp' means,
but what i think is you need something like
a modeless dialog ??
(Yeah, i know its a crime to even post such
awnsers, but that was the only thing i could
think of from your post! Need some more Data..)
|
|
|
|
|
Prem Kumar wrote:
Ok, I dont know what 'psp' means
Paintshop pro, I'd guess
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
hi benjymous(Alias i hope),
Thx for the Info.
|
|
|
|
|
Hi everybody!
I need help quickly to terminate a program at work.
I need to know how can I assign and change file icons in respect with their extension.
IE : I want to create a file with *.pof as exension then being able to assign an icon to it programmatically...
Thanks for your help!
Brind
If coding looks like drugs... I should go on therapy...
|
|
|
|
|
|
Thanks Joakin,
You point me directly at the right place!
Brind
If coding looks like drugs... I should go on therapy...
|
|
|
|
|
This may be a "dated" question but does anyone know where you can purchase Visual Studio 6.0? I've been unable to find it at any of the major software outlets. We've got lots of VC++ (and VB 6) code to maintain with a few new programmers coming on and I'd to do the right thing and purchase copied of VS6 for them.
Any Ideas?
mike...
|
|
|
|
|
Amazon UK still have copies of VS6
here
but they don't seem to want to ship to the US
--
Help me! I'm turning into a grapefruit!
|
|
|
|
|
HI, des anybody know, how to insert new line into string in the InnoSetup ?
For example :
[Regisrty]
Root: HKCU; Subkey: "Software\My Company\My Program\Settings"; ValueType: string; ValueName: "MyString"; ValueData: "line1???line2"
What to write at place of '???' to break the line ? \r\n does not work
Thanks
rrrado
|
|
|
|
|
When entering the text for \r\n have you tried typing in ALT+012 and ALT+013 (the ascii codes for the characters - these may not be correct, check them) directly into the edit control?
Roger Allen
Sonork 100.10016
If I had a quote, it would be a very good one.
|
|
|
|
|
I tried. It does not work (alt+13, alt+10)
rrrado
|
|
|
|
|
Use the preceding 0 (is a different character)
LPCSTR Dutch = "Double Dutch "
|
|
|
|
|
Just a technical note... If it starts with zero, you're using ANSI and not ASCII.
For instance...
ALT+65 is the ASCII letter 'A'
ALT+065 is the ANSI letter 'A'
Jeremy Falcon
Imputek
|
|
|
|
|
I have an integer (three possible form : as int ,CString ,or char* ), and i´d like to convert it to a CString but in hexadecimal. Any idea ?
~RaGE();
|
|
|
|