|
followait wrote: can't get it correctly
It should work, though.CAn you post your code ? What goes wrong ? Does the function return 0, or is the bitmap handle invalid ?
~RaGE();
|
|
|
|
|
all the test code is in the button click msg handler
void CTest_CImgaeListDlg::OnButton1()
{
CClientDC dc(this);
//create a CBitmap, a simple rect, (0,0,10,10)
CBitmap bmp;
bmp.CreateCompatibleBitmap(&dc,16,16);
CDC dcMem;
dcMem.CreateCompatibleDC(&dc);
CBitmap *pOldBmp=dcMem.SelectObject(&bmp);
dcMem.Rectangle(0,0,10,10);
dcMem.SelectObject(pOldBmp);
//save it in iml, and get it immediately, but there is something worng
CImageList iml;
iml.Create(16,16,ILC_COLOR24,5,5);
int idx=iml.Add(&bmp,RGB(0,0,0));
IMAGEINFO ii;
iml.GetImageInfo(idx,&ii);
CBitmap *pBmp=CBitmap::FromHandle(ii.hbmImage);
pOldBmp=dcMem.SelectObject(pBmp);
dc.BitBlt(0,0,16,16,&dcMem,0,0,SRCCOPY);
dcMem.SelectObject(pOldBmp);
}
|
|
|
|
|
This will not help you much, but this code works perfectly on my machine.
~RaGE();
|
|
|
|
|
|
bolia its possible to call javascript from an applet. but i'm not sure with active-x
He is like a one-legged man in a bum kicking competition. -Novjot Sidhu
--[v]--
|
|
|
|
|
|
JIANG, Sheng[MVP] wrote: http://support.microsoft.com/support/kb/articles/Q172/7/63.ASP[^]
Hello Sir,
Above link is not working ! thanks
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
This link works fine on my computer.
My blogs:
http://blog.joycode.com/jiangsheng
http://blog.csdn.net/jiangsheng
http://bloglines.com/public/jiangsheng
Command what is yours
Conquer what is not
---Kane
|
|
|
|
|
Does C++ have an API that gets the type of an object. I want to determine an object type during run time. Say for example, i have an object x ( which is of type CDialog), then i want to determine its type during run time. Thanks in advance!
|
|
|
|
|
Hava a look on CRuntimeClass, CObject classes in the help. I think they are what you are looking for.
|
|
|
|
|
typeid Operator
C++ Specific —>
typeid( type-id )
typeid( expression )
The typeid operator allows the type of an object to be determined at run-time.
The result of a typeid expression is a const type_info&. The value is a reference to a type_info object that represents either the type-id or the type of the expression, depending on which form of typeid is used. See type_info Class for more information.
|
|
|
|
|
Try:
CDialog dlg;
if (dlg.IsKindOf(RUNTIME_CLASS(CDialog)))
...
"Take only what you need and leave the land as you found it." - Native American Proverb
|
|
|
|
|
Hello!
I have a strange problem.
There are a TestApplication and a DLL.
DLL exports one function:
__declspec ( dllexport ) void StartTest (HWND hWnd)<br />
{<br />
AFX_MANAGE_STATE(AfxGetStaticModuleState());<br />
<br />
CWnd *pParent = CWnd::FromHandle (hWnd);<br />
g_pDialog1 = new CDialog1 ( pParent );<br />
g_pDialog1->Create ( IDD_DIALOG_1, pParent );<br />
g_pDialog1->ShowWindow ( SW_SHOW );<br />
}
There is only one ListCtrl on the dialog. And when a user doubleclicks on the ListCtrl, thete will be shonw a ExEditBox (inherited from CEditBox)
The TestApplication (Dialog based) calls StartTest:
StartTest ( this->m_hWnd );
The strange is, that when i press ENTER in the pop-up EditBox my TestApplication closes (i'm tring to catch WM_KEYDOWN in ExEditBox's PreTranslateMessage, but there are no messages and all messages are going to the TestApplication). Do you know why?
And it word exelent, if i'd make the same without DLL.
|
|
|
|
|
Hi,
The problem is not in the dll. It is a CEdit standard behavior;
when the focus is in a editbox and enter key is pressed, the dialog will call CDialog::OnOk method and close itself. The overcome that, you do the following:
* Override CDialog::OnOk method. So, you have:
void CMyDialog::OnOk()
{
CDialog::OnOk(); // default behavior
}
* Remove the call of baseclass's OnOk so that you have a dummy CMyDialog::OnOk
method.
* Now, the problem is overcome.
But if you have a button with IDOK handle on the dialog box, you need to change its id (say IDC_OK) and create a handler for that IDC_OK. So, you can
put CDialog::OnOk call in that handler.
--
======
Arman
|
|
|
|
|
I can't attach the project to this thread...
But my problem is not OnOK.
As i told above PreTranslateMessage of ExEdit does not receive any messages.
Sure i could get OnOK in main programm, then ignore it and send a user message to dll ( to child dialog ), so that the child dialog will hide this editbox. But i don't it is a good solution.
|
|
|
|
|
Fester_1977 wrote: Sure i could get OnOK in main programm, then ignore it and send a user message to dll ( to child dialog ), so that the child dialog will hide this editbox. But i don't it is a good solution.
Just a suggestion, don’t know if it will work or not but try DoModal() instead of creating a modeless window.
DEBUGGING : Removing the needles from the haystack.
|
|
|
|
|
How a text can be displayed in the language set in the Local.
anil
|
|
|
|
|
You need to first retrieve the local language set on the machine, and also provide strings in your string table for each language you want your app, and then load the according strings from your string table.
~RaGE();
|
|
|
|
|
Hi guys,
I need help.
Can you tell me how to know what are the ports that are currrently being occupied by a particular application.
I am writing an application which would tell the user what are the ports being occupied by an application.
Owner Drawn
--Nothing special
|
|
|
|
|
whenever I set a breakpoint and excute debug, a message box pops up displaying the following message:
one or more breakpoints can not be set and have been disabled, excution will stop at the beginning of the program.
I tried placing breakpoint at different place, but the same error occured.
what is wrong? how can I fix it?
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
This can happen if you put the break point in a dll project and you're application is loading that dll dynamically.
|
|
|
|
|
Check this[^]
Bye
Cool Ju
Vote for Cool Ju
|
|
|
|
|
thank you all very much, I find that it was because my project was compiled in release mode.
Thank you very much!!!
-------------------
I am learning C++ and English
|
|
|
|
|
I use a software (coreftp) which can read unix file permissions (such as drwxrwxrwx) by ftp connection.
but I don't know how to do that myself, please help.
thx
includeh10
|
|
|
|
|
Hello.
If I remember it right, the operating system at the ftp server returns a "dir" listing in it's native format.
A Unix FTP-server will (normally) return a ll-listing as a response on a FTP LIST-command.
Just find the correct positions in the returned ll-strings, and you will get the file permissions.
(As far as I remember, that's the only reason why you have to set what host type you are communicating with. The ftp client program has to know where to find the different pieces of information in the returned directory listing).
This isn't the sample you wanted, but if you find a source code of a FTP-client, then you will know where to look.
|
|
|
|