|
Hi
I'm trying to use the system image list through CImageList::Attach, buth without success. I can see in CImageLists' destructor that the attatched imagelist is destroyed when the CImageList object is destroyed. This isn't very appropriate, since 98 can't handle this. It results in an environment without icons. However, on 2k, everything is fine. Anyone knows how to solve this?
|
|
|
|
|
You're forgetting to detach your CImageList object from the system image list before the object is destroyed.
--Mike--
http://home.inreach.com/mdunn/
All your base are belong to ME~!
|
|
|
|
|
No, I'm not. If you look in ~CImageList, you will see that the imagelist is automatically detached. If you look in CImageList::Detach(), you will also see that the imagelist is destroyed when detaching, conclusion: shouldn't detach.
|
|
|
|
|
If you look in CImageList::Detach(), you will also see that the imagelist is destroyed when detaching
That is incorrect. Here's Detach():
HIMAGELIST CImageList::Detach()
{
HIMAGELIST hImageList = m_hImageList;
if (hImageList != NULL)
{
CHandleMap* pMap = afxMapHIMAGELIST();
if (pMap != NULL)
pMap->RemoveHandle(m_hImageList);
}
m_hImageList = NULL;
return hImageList;
}
There's no call to ImageList_Destroy() there. Compare with CImageList::DeleteImageList(), which is called from the CImageList destructor and does call ImageList_Destroy().
--Mike--
http://home.inreach.com/mdunn/
All your base are belong to ME~!
|
|
|
|
|
now, I can create button at run time, then I have some function for each button when it clicked. How can I get the message ???
I catch it at PreTransletMessage(), like so :
BOOL CTestDlg::PreTranslateMessage(MSG* pMsg)
{
if(pMsg->message = BM_CLICK)
{
MessageBox("Y");
}
return CDialog::PreTranslateMessage(pMsg);
}
but, seem not correct ???? plx tell me , thanks ....
Regards
Vistac ...
|
|
|
|
|
Hello, the codegurus around the world.;)
First of all, even though you creates the button at run time,
you can use Message Map to catch the button click message as long as
we know ID of the button, I think.
Second, if we use PreTranslateMessage function, we can check the current input focus
control or which control sends the message to the parent.
That is, if (pMsg->hwnd == GetDlgItem(ID_BUTTON)->GetSafeHwnd( )) works since
the button clicked must send the message to the parent.
or if (pMsg->hwnd == GetDlgItem(ID_BUTTON)->m_hWnd)....
The button clicked have the current input foucs.
so, if (GetFocus() == GetDlgItem (ID_BUTTON))....
However, I didn't check my old code, so...?
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Hello, the codegurus around the world.;)
I make a simple test.
BOOL CButtonDlg::PreTranslateMessage(MSG* pMsg)
{
if ((pMsg->message == WM_LBUTTONDOWN && pMsg->hwnd == GetDlgItem(IDC_BUTTON1)->GetSafeHwnd())
|| pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_RETURN &&
pMsg->hwnd == GetDlgItem(IDC_BUTTON1)->GetSafeHwnd())
TRACE ("Click or push the button");
return CDialog::PreTranslateMessage(pMsg);
}
</br>
These codes pick up the message if we click the button by PreTranslateMessage.
However, if we use MessageBox rather than TRACE, I got the strange behavior.
Window message stream is more difficult than I expect..
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
I would override OnCommand virtual function
CTestDlg::OnCommand(WPARAM wParam, LPARAM lParam)
{
if (HIWORD(wParam) == BN_CLICKED)
{
if (LOWORD(wParam) == myButtonID)
{
MessageBox("Y");
return TRUE;
}
}
return CDialog::OnCommand(wParam, lParam);
}
---
Multitasking: Screwing up several things at once.
|
|
|
|
|
Does anyone know where I can find GOOD DirectX 8 (C++) information, books, tutorials, etc. that go beyond spinning a cube in space ?
Thanks,
Thierry
|
|
|
|
|
Hi Guys !
I'm a newbie
i'm using Visual C++ 6.0 Prof.
i had to load a Word Document to edit some Data Fields.
After edtiting i'll print the Document.
Now my problem:
How can i load a Word Document into a buufer or something els to edit the text ???
THX for your suggestions
Joachim
|
|
|
|
|
Hello, the codegurus around the world.;)
If you print out Word doucemnt, you had better use Word Automation.
You find several sample codes for Automation in MSDN library.
However, Visaul Basic is easier tool to do this than Visual C++.
If you aren't familiar with COM by VC++, VB COM may be easy.
Have a nice day!
-Masaaki Onishi-
|
|
|
|
|
Thx for the help but i didn't have Visual Basic and COM isn't familiar.
But i had to realise this problem with VC++
|
|
|
|
|
Hello!
The question is :
There is computer with 2 network cards. Is it possible that this computer has two different hostnames? If yes, wich of them does the "gethostname" API function return? How can i retreive the second one ?
Thanks a lot.
Best regards,
Furer Alexander
Sentry-Com
alex_f@sentry-com.co.il
When a password just isn't secure enough,
and email confirmations don't quite cut it,
You need Voice authentication.
You need Sentry-Com.
|
|
|
|
|
A Windows computer can only have one name.
Of course it can have different names (records) in a DNS-Server, but it can only have one "real" Windows name.
- Anders
|
|
|
|
|
Hello, can anyone help find a resource site where I can pick up old C++ exams, and possibly notes. I want to test my knowledge. Thank you
|
|
|
|
|
Hi
I wan't to be able to get a filetypes icon, preferably the position in the system image list, and the description string. Is there any API for this?
OBS! I know that I can use SHGetFileInfo, but then I must supply filename. I need it on extension basis.
I prefer to be anonymous.
|
|
|
|
|
I think you can still use the SHGetFileInfo, but you have to specify the GFI_USEFILEATTRIBUTES flag in the uFlags argument, this way the function does not access the specified file, so you can pass a bogus file name with the extension you want.
If this does not work, you can still look for all the informations you want in the registry......
Good luck!
Rui Lopes
|
|
|
|
|
Thanks a lot! It worked perfectly except for the icons for directories!
|
|
|
|
|
My app uses Shlwapi.dll which I would like to include with my installer.
I understand this is part of IE.
Is there a redistributable IE I can include with my installer incase the user does not have this DLL?
--
The Obliterator
|
|
|
|
|
I think with things like this, you must redistribute IE.
Yes, you are groaning with the displeasure of it all.
Seems that that is the way MS like it. A damn good way of
ensuring that everyong has IE on their machine
Stephen Kellett
|
|
|
|
|
Thought as much
So, where do I get hold of a redistributable IE setup file for inclusion on my CD?
I cannot find a full version for download anymore - only a setup which downloads components from the net.
I need a full self contained setup for IE.
Also, anybody know of any legal issues which apply inorder to redist IE?
--
The Obliterator
|
|
|
|
|
Have downloaded the full version of IE many times but not for a while so my memory is sketchy. I can't remember exact button names but think I can fudge my way through.
When you download the setup.exe stay connected to the Internet, run setup.exe. Click your way past the force agreement section, you should then be presented with a screen with the choices of Minimal or Typical installation (mutually exclusive Radio Buttons). Select Minimal (as this is also custom) click Next, on this screen select everything (or what is required) BUT before clicking Next look for another button on the screen (I think at the top). This is something to do with associations or some crap, in the ensuing dialog select download only don't install (something like that) and sit back and relax as it is a ~60 MB download.
I have a fattish pipe to the net at work, if by extreme chance you happen to be in the Sydney Australia area send me an e-mail I can download it for you and burn it to CD.
Michael Martin
Pegasystems Pty Ltd
Australia
martm@pegasystems.com
+61 413-004-018
|
|
|
|
|
Thanks... Serves me right for not reading the install options fully!
You are right, choosing minimal allows you access to an advanced section which provides support to download rather than install. Perfect, thanks.
Still don't understand why MS couldn't just let you download the full thing directly like you used to be able to!
Oh well, thanks for your kind offer of the download BTW but I'm in the UK. Fortunately we have ISDN-128 at work so I guess their phonebill will just have to take a small hammering
Who knows, it might encourage them to get ADSL installed!
--
The Obliterator
|
|
|
|
|
I want to display data from an Access file in a List Control .For example ,a table in access has 2 fields name & address .I want to display it usng a List Control.Any such example will do
Rudra
|
|
|
|
|
Hi !
I have created my own ActiveX control, but I can not insert it on Word, what can I do to make it available for MS-Word document ?
Thanks for all, bye !
Braulio
|
|
|
|