|
ATypeOfPerson& ATypeOfPerson::operator=(const ATypeOfPerson& other) {
if(this != &other) {
CPerson::operator=(other);
}
return *this;
}
--
<british-accent>Pass the jam, would you?
|
|
|
|
|
Hi!
I'm having quite annoying problems when dynamically loading libraries of the type "MFC Expansion Dll".
After I load an optional dll at runtime via AfxLoadLibrary(), my main window fails to locate its resources. Interestingly enough, dialogs are constructed OK, but fail when doing data exchange (when using GetDlgItem() I assume). This happens even when I unload the optional dll again (AfxFreeLibrary()) before creating any main window dlls. As far as I understand it, this should remove the loaded Dll from the resource chain, but it never seems to happen (The AfxTermExtensionModule() function is called though).
I tried to 'correct' the resource handle via AfxSetResourceHandle() but nothing changed at all.
Has anyone had similar problems and can give me a hint what's wrong?
Thanks,
Nick
|
|
|
|
|
MFC keeps a CDynLinkLibrary linked list of dynamic DLL it has loaded. Your extension DLL probably has not properly removed itself from this chain. It also seems it has some resources with the same identifiers as your main program. You will have to walk this chain and manually remove the offending DLL's entry, if it is not being removed when you call the AfxUnloadLibrary.
MFC walks a chain of laoded DLL and stops at the first resource it find, from one of the dynamically loaded DLL, so you need to break the links so that the resources in your DLL are not used isntead of your main program. Now, not sure why the SetReosurceHandle is not working, except maybe MFC is still giving priority to one of the DLL, or you set the resource handle from a different thread, since it is thread-specific.
|
|
|
|
|
Thanks for the reply. It shed light on some details I wasn#t aware of. Anyway, I discovered that, for some reason, the dll was not unloaded at all (the statement was never executed due to some weird conditions I still don't get). Restructuring the code lead to unloading of the dll and now all works smoothly.
It can be so simple sometimes...
Nevertheless I got some more insight in the works behind the scenes, so this experience wasn't completely useless
Nick
|
|
|
|
|
I have write a SERVICE that displays an icon in system tray.
Now, i m starting the SERVICE manually thru SERVICE template..........and then LOG-OFF from the system .........and then RE-LOGIN to the system and i found SERVICE template that SERVICE is running and by looking at TASK MANAGER i found out that EXE of SERVICE is also running...but the problem is that program does not displays icon in system tray.
I wish to display icon in SYSTEM TRAY whenever user RE-LOGIN or restart the COMPUTER.
|
|
|
|
|
I guess that's because the taskbar where your Icon was registered is closed when logging off and thus your Icon is 'forgotten'.
Right now, I don't know of any smart way to determine when a user logs on, so the simplest approach would be a timer that (re-)registers the TaskIcon with the task bar in a reasonable interval, but I'm sure there are more elegant ways to do this via notifications.
Nick
|
|
|
|
|
Hi Nick,
Thanks for the answer.
But, i m switching between 3-4 icons to be displayed in system tray depending on situation and use of times creates the problem of repaiting the screen and which results into total distoration of screen.
So id there is another effective solution then pls let me know or any other friend knows about it then also it will be very thankful.
|
|
|
|
|
Hi Nick,
Thanks for the answer.
But, i m switching between 3-4 icons to be displayed in system tray depending on situation and use of timer creates the problem of repaiting the screen and which results into total distoration of screen.
So id there is another effective solution then pls let me know or any other friend knows about it then also it will be very thankful.
|
|
|
|
|
I don't understand what you mean. Timers should have no impact on repainting of the screen. you only call Shell_NotifyIcon from the timer routine... I don't see how that should distort your screen...
|
|
|
|
|
Hi everybody,
I try to use the class library for the DirectMusic MIDI created by Carlos Jiménez de Parga found on 'the code project', but I'm not use to C++.
I will need a interface: what would be the best solution ? Win32, ATL, MFC, Framework.NET. I have too many options. Can someone tell me the steps to create a new project who's working. It will be a good starting point.
Thanks a lot.
|
|
|
|
|
Hi guys
I've got an app where I only do a CenterWindow() in InitInstance and in w2000 it opens correctly and in XP the scrollbars appears and not all my main window is visible. Have you experienced something similar? DO you know why?
Best Regards
Doc
|
|
|
|
|
Maybe you have different resolution in defferent windows so it looks like that in XP.
Mazy
No sig. available now.
|
|
|
|
|
Same resolution in both SO. It's an amazing bug.
Doc
|
|
|
|
|
In fact I need to adapt some piece of code whether the application is running on Win2k+ or Win9x.
Thanks for your help
-MyttO
|
|
|
|
|
GetVersionEx()
Mazy
No sig. available now.
|
|
|
|
|
|
I found this true!
//------------------------------------------------------------------------
CString GetWinVersion()
{
CString Ver;
OSVERSIONINFO osinfo;
osinfo.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
GetVersionEx(&osinfo);
Ver.Format("Windows Version %1d.%1d", osinfo.dwMajorVersion, osinfo.dwMinorVersion);
return Ver;
}
//------------------------------------------------------------------------
I'll TRY my best
|
|
|
|
|
Thank you all for fast answers!!
-MyttO
|
|
|
|
|
Hi,
I would like to know how to make a copy of the file that i just opened.
what is the sytax for it????
Ehsan Behboudi
|
|
|
|
|
Look for CopyFileEx() in MSDN:
Mazy
No sig. available now.
|
|
|
|
|
What's the best way to go about "learning" the machines that are connected to a network? (as part of a LAN Workgroup, domain, etc.)
Let's say for instance that I have an app that can remotely connect to other machines to provide monitoring functionality. It would be nice to have a dynamic list of available machines that it could connect to. What all is involved here? I'm not sure if I need to look into SNMP or if just TCP/IP stuff will do the trick. Or maybe there are Windows API functions that handle all this?
[EDIT] Not sure if it matters, but I'm only interested in how to do this on Windows NT/2000/XP/2003 (not 95/98/ME). [/EDIT]
Thanks!
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|
|
Does WNetOpenEnum()/WNetEnumResource() help?
A rich person is not the one who has the most, but the one that needs the least.
|
|
|
|
|
Yes! Thank you David.
--
Edward Livingston
(aka ExtraLean)
--
"I still maintain that seeing a nipple is far less disturbing than seeing someone get their brains blown out." -- Chris Maunder
|
|
|
|
|
Hi all,
I would like to know how to insert a CDateTimeCtrl (DateTimePicker) into my ToolBar.
I use this way :
BOOL CMyToolBar::CreateDTPicker(CDateTimeCtrl& dtPicker, UINT nIndex, UINT nID, int nWidth)
{
// Create the DateTimePicker Control :
SetButtonInfo(nIndex, nID, TBBS_SEPARATOR, nWidth);
CRect rect;
GetItemRect(nIndex, &rect);
if (!dtPicker.Create(DTS_RIGHTALIGN | DTS_UPDOWN | WS_TABSTOP, rect, this, nID))
{
TRACE("Failed to create DateTimePicker Control\n");
return FALSE;
}
return TRUE;
}
taken from : http://www.codeproject.com/docking/ToolbarWithCombo.asp
but it doesn't work for the CDateTimeCtrl, the control doesn't appear.
Can someone help me ?
Thanks in advance,
Phil
|
|
|
|
|
hmmmmmmmmmmm, sh*t, I just forgot the WS_VISIBLE in the Create function !!!
So it works now.
BrutalDeath0
|
|
|
|