|
This is my first time to post here. Here's my problem. I've written a code to modify my menu text from english to japanese. Translation of text was succesful but after the translation, the translated submenus were disabled. Anybody who got any idea on how I will solve this. Thanks in advanced.
|
|
|
|
|
Why is it getting disabled in the first place?
How does the chaging the text of the menu looks like?
-prakash
|
|
|
|
|
Thanks for the reply.
Here's what I did.
I don't have any idea why its getting disabled. It got disabled after translating the text from english to japanese.
First I open a text file which contains the original text and its translation.
The contents were read and was stored to a map(STL). I've also created a recursive function to traverse the menu and translate the text.
From that recursive function I get the submenus and the number of items under that submenus.
Here's the code:
void CTranslator::TranslateMenu(CMenu* pMenu, int MenuCount)
{
CMenu* SubMenu;
CString String;
char MenuString[50];
int SubMenuCount = 0;
int Index = 0;
do // while (MenuCount != Index)
{
ZeroMemory(MenuString, 50);
pMenu->GetMenuString( Index, MenuString, 50, MF_BYPOSITION);
String.Format ("%s", MenuString);
if(! String.IsEmpty())
{
pMenu->ModifyMenu(Index, MF_BYPOSITION, MF_POPUP, GetTranslation( String ) );
}
SubMenu = pMenu->GetSubMenu(Index);
if(NULL != SubMenu)
{
SubMenuCount = SubMenu->GetMenuItemCount ();
TranslateMenu(SubMenu, SubMenuCount);
}// if(NULL != SubMenu)
pMenu->EnableMenuItem (Index, MF_ENABLED);
Index++;
}while (MenuCount != Index);
}// CTranslator::TranslateMenu(CMenu *pMenu)
|
|
|
|
|
romuzu wrote: pMenu->EnableMenuItem (Index, MF_ENABLED);
try pMenu->EnableMenuItem (Index,MF_BYPOSITION | MF_ENABLED);
-prakash
|
|
|
|
|
Thanks for the reply.
I did that before but still did not enable the menu.
|
|
|
|
|
romuzu wrote: pMenu->ModifyMenu(Index, MF_BYPOSITION, MF_POPUP, GetTranslation( String ) );
I could not understand this function call and does not fit in any of the sig provided
did you mean
pMenu->ModifyMenu(Index, MF_BYPOSITION | MF_STRING,, GetTranslation( String ) );
-prakash
|
|
|
|
|
I have got so many classes in my VC++ project that I feel they are very complicated. so I want to illustrate their relationship clearly with UML. is there any software can be used to draw a diagram of the relationship of these classes for me?
or, is there any other way to do this?
thank you very much!
-------------------
I am learning C++ and English
|
|
|
|
|
|
for the moment I have no RationalRose, can I use the Microsoft Visual Modeler instead, which, you know, is a tool in the visual studio?
-------------------
I am learning C++ and English
|
|
|
|
|
I dont know much about visual modeler, I know that in RationalRose you can import the C++ files and it generates the UML which you can straighten up.
You can download the evaulation version and see if it meets your requirement.
-prakash
|
|
|
|
|
thank you very much
-------------------
I am learning C++ and English
|
|
|
|
|
I usally use 'malloc' and 'new' to allocate memory.
And I know 'free' or 'delete' should follow them.
If I forgot to release the allocated momory, I could see
a warning message (like below) for memory leak
which is displayed by MFC Tracer.
[2872] Detected memory leaks!
[2872] Dumping objects ->
[2872] G:\WORK\CaptureManager.cpp(211) :
[2872] {320}
[2872] normal block at 0x003775D8, 4 bytes long.
[2872] Data: < > CD CD CD CD
[2872] Object dump complete.
However, in some codes, LocalAlloc is used instead.
Even though LocalFree is not called to free memory,
warning message wouldn't appear.
I wonder if LocalAlloc doesn't need LocalFree,
and memory leak warning message from MFC Tracer is unreliable.
any idea is welcomed,thanks
|
|
|
|
|
plowstar wrote: I wonder if LocalAlloc doesn't need LocalFree,
and memory leak warning message from MFC Tracer is unreliable.
From[^] here, it is clear that localalloc will need its corresponding free call.
-prakash
|
|
|
|
|
Most memory trackers work by hooking the new/malloc and delete/free operators and tracking allocations versus deallocations. LocalAlloc and LocalFree are Win32 API functions which *directly* manipulate the heap, I guess that's why the Tracer doesn't detect them.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
I need some help. I’m working on a project with some schools that involve Windows and “hosts” file work. The network I’m working on requires several pre defined domains that need to be assigned to a different IP address which is achieved through using the hosts file.
The problem that I’m running into is that a hosts file over 150K will start to crash the Dnscache service under Windows 2000 and XP. I have to disable this service in order to have everything work. The problem with doing this is that resolving a host without Dnscache has considerable latency issues and an overall slow connection time without the Dnscache service running. It doesn’t matter if the hosts file is 1K or 300K, without DNS caching, it is very slow.
I would very much appreciate it if someone could assist me or even just write a small C or C++ win32 console app that can be run and installed as a service through the command line using the “sc config” and “net start” commands. It would need to be able to replace the Dnscache “dnsrslvr.dll” service. This service is nice but not very robust when it comes to actually using the hosts file for what it was designed for.
Really, it doesn’t have to load the whole hosts file into memory like the Dnscache “dnsrslvr.dll” service does. All this program would need to do is pre allocate a small chunk of memory and then just monitor domain name requests. When the IP address is returned from the DNS server out on the web or from the hosts file, it would just need to cache it into memory. The initial connection would still be the time required to ask the DNS server or hosts file for the IP address but after that, the site would load faster because all of the graphics, applets and so on would already be pointing to the IP address.
I would even be willing to compensate a bit for the time spent doing this. I know time is valuable. Please contact me at jamie@unitedcomputerservice.com
I will also keep checking the post here. Thank you in advance for anyone who could help me in this effort. I write code but this one is a bit out of my area to be comfortable. Is there any way that someone could help or at least point me in the right direction?
Thank you very much!!!
|
|
|
|
|
Writing a DNS client service should be no problem since the DNS protocol is defined in a RFC (search w3c.org)
The thing is, as u said, u should monitor name requests.
So to start with, try and find any MS docs about the DNS client service.
U'll need it to follow its protocol with apps if u write eyour own service. And who knows - maybe u'll find a way to config it not to crash...
|
|
|
|
|
I found that ExtractIcon returned the handle for the large icon,not the small.
But I just need the small icon ,and then add it to a image list.
How could I do so?
Much simple much better;P
|
|
|
|
|
Use ExtractIconEx[^]
its pretty straight forward to use, let me know if you have any problem?
-prakash
|
|
|
|
|
Thank you first.
yes, i have tried this way. but there is always a black shadow behind the icon.
I used ExtractIconEx to get the small icon handle,and then add it into a image list.
I don't know that why there is always black shadow.
Could you please give me a help?
Thank you.
|
|
|
|
|
I think you are working on windows XP, the icon's showdow quality is lost.
Try includeing a manifest to your project.
If you are not aware on how to do that, search in CP, there are articles to manually include the manifest file in VC6
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<description>tool description</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="X86"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>
-prakash
-- modified at 22:37 Tuesday 1st November, 2005
|
|
|
|
|
Hi!
I want to use the root finding routine "gsl_root_fdfsolver_newton" that comes with the Gnu Scientific Library (short: GSL; see e.g. http://gnuwin32.sourceforge.net/packages/gsl.htm).
First of all: I am using GSL-1.6. under Windows XP plus Microsoft Visual Studio. Net 2003 (Version 7.1.3088).
When I take a standard example from the reference document "gsl-ref.pdf", then add
"libgslcblas.a libgsl.a"
under
"Configuration Properties->Linker->Input->Additional Dependencies"
(following the suggestions made on http://sources.redhat.com/ml/gsl-discuss/2004-q2/msg00000.html)
and finally compile the project under VC++, I obtain the following error message:
------ Build started: Project: Test 0, Configuration: Debug Win32 ------
Linking...
libgsl.a(roots_secant.o) : error LNK2019: unresolved external symbol _finite referenced in function _newton_iterate
H:\Test Project 0\Test 0\Debug\Test 0.exe : fatal error LNK1120: 1 unresolved externals
Build log was saved at " file://h:\Test Project 0\Test 0\Debug\BuildLog.htm"
Test 0 - 2 error(s), 0 warning(s)
---------------------- Done ----------------------
Build: 0 succeeded, 1 failed, 0 skipped
Does anyone know what the problem might be???
At
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/HTML/_crt__finite.asp
I read that the function _finite() is declared in float.h and should become available via the automatically linked library "msvcrt.lib".
What could be the reason that the program still doesn't know _finite???
Already in advance: THANK YOU VERY MUCH FOR YOUR HELP!
Cheers
Lebesgue
|
|
|
|
|
Only thing that i can think of is that there could be a problem of function decoration,
Are you sure that the 3rd party lib can be used with C++?
-prakash
|
|
|
|
|
Thanks for your reply!
How could I track down the problem of function declaration?
Do you mean by "3rd party lib" the GSL Package?
If so: yes, this should work with C++.
Strangely enough, the whole thing actually works when I
compile with DEV-C++.
Cheers Lebesgue
|
|
|
|
|
Although this is a very old question it may still be of interest. I have just been running GSL (1.8) in Visual Studio 2005, and had much the same problem with unrecognised symbols, even though I could see they were in the Libs, libgsl_dll_d.lib, libgslcblas_dll_d.lib. In my case I was using the Hybrid and Newton root finding algorithms. The symbol that was missing was gsl_multiroot_fdfsolver_gnewton.
Eventually I found that I had to add GSL_DLL to the Property Page: Configuration Properties: C/C++: Preprocessor, Preprocessor Definitions.
That surprised me, but clearly it is the way to link up with the GSL code.
Raymond Mercier
|
|
|
|
|
Can someone tell me why I can't get my output lined up.
#include <iostream><br />
#include <cmath><br />
#include <iomanip><br />
using namespace std;<br />
<br />
int main(void)<br />
{<br />
double l;<br />
double arate;<br />
int n;<br />
<br />
cout << " Enter the loan amount: ";<br />
cin >> l;<br />
cout << " Enter annual interest rate: ";<br />
cin >> arate;<br />
cout << "Enter total number of payments:";<br />
cin >> n;<br />
cout<< endl<< endl;<br />
double mrate = (arate /12 ) / 100 ;<br />
<br />
double numerator= pow(1 + mrate , n)* mrate;<br />
double denominator= pow(1 + mrate , n) - 1;<br />
double mpayment = (numerator / denominator) * l;<br />
double apb=mpayment * 36;<br />
double ip=apb-l;<br />
int mi= arate/12;<br />
<br />
cout << setiosflags (ios_base::internal)<<"Loan amount:"<< setw(30)<< setprecision(2)<< fixed<< "$" << l << endl;<br />
cout << "Monthly interest rate:"<< setw(30)<< mi << "%" << endl;<br />
cout << "Number of payments:"<< setw(30)<< n << endl;<br />
cout << "Monthly payment:"<< setw(30)<< "$"<< mpayment << endl;<br />
cout << "Amount paid back:" << setw(30)<< "$"<< apb << endl;<br />
cout << "Interest paid:"<< setw(30)<<"$"<< ip << endl; <br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
return 0;<br />
}
BINARY
|
|
|
|