|
Any where, but you need to take care, because move window need a HWND, if your window is not created yet, you will get an Assert....
Cheers!!!
Carlos Antollini.
Today is Friday?
No Bob...
|
|
|
|
|
Thanks all.
I have found the reason.
I call the MoveWindow function with parameters (0,0,200,200),
if i change it to (1,1,200,200).it will locate rightly.
if the first and the second parameters are both zero
then this function will only modified the Dialog's Width and Height,don't modified the window's left_top corner coordinate
but how i enforce the dialog move to (0,0) ?
|
|
|
|
|
Try the windows API version of the function. There's nothing (that I saw) on the MSDN CD about this.
Try this and see if it will position correctly:
::MoveWindow(this->GetSafeHwnd(), 0, 0, 200, 200, TRUE);
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
With SetWindowPos....
BOOL SetWindowPos(
HWND hWnd,
HWND hWndInsertAfter,
int X,
int Y,
int cx,
int cy,
UINT uFlags
);
Cheers!!!
Carlos Antollini.
Is Today Friday?
No Bob!!!
|
|
|
|
|
Not when you're in a CWnd class to begin with.
To hell with those thin-skinned pillow-biters. - Me, 10/03/2001
|
|
|
|
|
CDialog automatically calls CenterWindow() for you after OnInitDialog() returns if the dialog is at coordinates (0,0). You'll need to put it at some other position (like (1,1) or (0,1) or whatever) to avoid CDialog repositioning it for you.
--Mike--
http://home.inreach.com/mdunn/
This posting is provided "as was" with no warranties, guarantees, lotteries, or any of those little bags of peanuts you get on planes. You assume all risk for crossing the street without holding mommy's hand. © 2001 Mike's Classy Software. Member FDIC. If rash develops, discontinue use.
your with and
|
|
|
|
|
VC++6, W2K
Hi,
I am trying to use #import for 2 simliar components.
#import "E:\tools\x\Record.dll" no_namespace
#import "E:\tools\x\AudioFile.dll"
I am getting an error
d:\lab\try2rec\debug\audiofile.tli(59)... overloaded function differs only by return type
can someone please let me know the problem
San
|
|
|
|
|
Probably record.dll and audiofile.dll both define a function with the same name but with different return types. You can avoid this by using namespaces.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Thanks Steen,
I tried using namespaces but still I am getting the error
San
|
|
|
|
|
I am in desperate need of some good advice. I am trying to implement a dynamic menu system but the trouble is that I never know how many menu items i will have/need until run-time. Every item runs a standard algorithm (so it needs to be mapped to the same function), which is basically loading a particular file (which is why I don`t know how many items I need til runtime). Do I have to use dynamic message mapping? if so how could I implement it? or is there a function which gives me a handle to the menu? I have tried using WM_MENUSELECT, and this does pretty much what I need except it works as soon as you put the mouse of the item (i.e. you don`t have to even click the item for it to run the algorithm). Is there anyway of getting it to run only after I`ve clicked the item? Sorry, I don`t have any code examples because I`m still scratching my head wondering which direction to take. I would definately appreciate your thoughts on this guys, as it`s really holding me back and is stressing me out beyond belief.
Thanks,
Alan.
AEGC
|
|
|
|
|
If you can assign your menu items consequetive identifiers you can use ON_COMMAND_RANGE.
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Thanks for the response, I think that is a good idea, but I don`t know what the ON_COMMAND_RANGE would be until run-time, so how would I be able to set it then? Also can you explain how to assign consequtive identifiers to the menu items? I`ve tried using a UINT called count which increments, but rather sadly it failed me.
Thanks again Steen,
Alan.
AEGC
|
|
|
|
|
Well, I haven't actually done this myself so I guess it's on a rather academic level
The MRU in MFC works by using a range of identifiers for the MRU items on the file menu. You could look at the MFC source to get some ideas. But from the top of my head I think MFC reserves 16 identifiers (ID_FILE_MRU1 to ID_FILE_MRU16, not sure about the names). This of course means that there's a max of 16 items on the MRU list. It then maps this range to a function (OnFileMru maybe?). Since the ID of the selected item is passed to the message handler you can surely take it from there.
So what you'll need is a first identifier and a maximum possible last identifier (there's nobody preventing you from setting it to first id + 200, that should kindda cover it, right?), and some assurance that your IDs are not used by other menu items. Those identifiers that are not in use at any particular moment will not be selectable and will thus not generate any WM_COMMANDs, so there's no need to sanity-check the ID that caused the WM_COMMAND in the handler (but I would do it anyway, just out of paranoia
Cheers
Steen.
"To claim that computer games influence children is rediculous. If Pacman had influenced children born in the 80'ies we would see a lot of youngsters running around in dark rooms eating pills while listening to monotonous music"
|
|
|
|
|
Can anybody let me have the following files?
iphlpapi.h, iptypes.h,ipexport.h and iphlapi.lib
thank you in advance.
|
|
|
|
|
SORRY, My address is dvisan@forte.ro
|
|
|
|
|
PLEASE, STOP SENDING ME FILES!!!!!
|
|
|
|
|
HAhahahahaha. You should have suggested that whoever did it post here so no-one else did. I'm sorry, I was in bed, I was about to do it myself from your email but lucky I read the forum first.
Christian
As I learn the innermost secrets of the around me, they reward me in many ways to keep quiet.
Men with pierced ears are better prepared for marriage. They've experienced pain and bought Jewellery.
|
|
|
|
|
I am programing under WINDOWS NT4 with Visual C++6.0 and I use the MFC.
I would like to dynamicaly change the language of the standard windows as "Print setup dialog" or "Print preview view" and standard messages as "Please enter a number." when you type a character in a edit control wich is associated whith a real member variable .
I change the language ID with SetThreadLocal, it works for my own resources but not for these windows and stringtable.
I try to modify the path of the afxres.rc or afxprint.rc in my .rc file, it doesn't work better.
I found the print preview toolbar and the messages resources inside the mfc42loc dll so I maybe just have to find the English and German DLL for these resource but it doesn't work for the Print setup dialog wich depend of the System language.
The solution must work either under NT4 ,Windows 2000 and XP!!!
Thanks for help...
ZAZA
|
|
|
|
|
Yes, MFC42LOC.DLL contains the localized resources - it'll give you 'Please enter a number' and other UI elements implemented by MFC in your language. Note that MFC42LOC should be in the Windows system directory.
However, it will not change the strings in common dialogs for opening/saving file, print setup etc. - these are parts of the operating system itself. The only way to overcome that is to re-implement, but it would take a lot of effort.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
Hello Tomasz
I also found the messages and the print preview button text in the afxres.rc and afxprint.rc files. I try to include them in my own RC file but it still doesn't work.
|
|
|
|
|
You should include these files only if your app links to MFC statically - in such case there's no need to use MFC42LOC.DLL.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
I have an idea: if i find the mfc42loc.dll in english, french and german, could I rename them and load the apropriate one dynamicaly ?
I would like to try, I use a french version of visual C++, could anyone send other language versions of mfc42loc.dll.
For the standard .rc file could I built resource DLLs and load them dynamicaly with AfxSetResourceHandle(LoadLibrary(mydll)) ?
Do you think it could work ?
elisabeth.sever@europlacer.fr
|
|
|
|
|
if i find the mfc42loc.dll in english, french and german, could I rename them and load the apropriate one dynamicaly ?
Use 'Find in Files' to locate MFC code which loads MFC42LOC.DLL - just search for 'MFC42LOC' in vc98\mfc\src. Do not change MFC sources, rather copy the code into your application and load appropriate DLL at runtime, depending on language settings.
For the standard .rc file could I built resource DLLs and load them dynamicaly with AfxSetResourceHandle(LoadLibrary(mydll)) ?
If by 'standard .rc' you mean resources of your app, then yes, this is the way to go. Also, you can consider placing one (main) language in the .exe. This will make working with IDE easier - you'll be able to add command handlers from ClassWizard, etc.
Tomasz Sowinski -- http://www.shooltz.com
|
|
|
|
|
You need to make diferent .rc files.
Then you need to set te resource file where the resources will be load using the following function:
AfxSetResourceHandle(HINSTANCE hInstResource); Where hInstance is the HINSTANCE that you get using LoadLibrary or AfxLoadLibrary(LPCTSTR lpszModuleName);
Cheers!!!
Carlos Antollini.
|
|
|
|
|
I would like to load dynamicaly the mfc42loc.dll to choose the apropriate language. I use a french version of visual C++, could anyone send me the English (UK or US) and the German versions of the mfc42loc.dll file ?
Thanks
elisabeth.sever@europlacer.fr
|
|
|
|