|
A TRUE programming genius would just include limits.h and use INT_MIN and INT_MAX ... :->
|
|
|
|
|
That's too simple. What's wrong with some good old bit manipulation?
|
|
|
|
|
The problem is that the range of int and unsigned int do not overlap. So to compare those two types, an implicit type conversion happens. By the language rules, the int gets promoted to an unsigned int , which means that -1 suddenly becomes 0xFFFFFFFF.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Michael Dunn wrote:
The problem is that the range of int and unsigned int do not overlap.
I'm not understanding this, Mike. If a signed int ranges from -2147483648 to 2147483647, and an unsigned int ranges from 0 to 4294967295, would they not overlap quite a bit?
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
Sorry, I used the wrong word there, that's what I get for posting when I'm sleepy
The two ranges aren't a subset of one another. The warning is there to say that the comparison may be doing something you're not expecting, like converting a negative value into a large positive value.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | NEW!! PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
I am using Windows 2000 Professional (English) and Visual Studio 6.0 (English, entrerprise edition) for the development.
I have created an SDI application for supporting Japanese language. In this SDI all menus are Japanese(this is what I needed). But the open dialog box still display in English. How can I change this too to Japanese?
Thanks in advance
Jahfer.
|
|
|
|
|
AFAIK, the open dialog box uses the language stated in the Windows settings (Region settings and languages from the control panel), and this is not something you can change programatically.
~RaGE();
|
|
|
|
|
Replace MFC71.DLL with MFC71JPN.DLL on your machine. Microsoft provides the translated MFC libraries with Visual Studio.NET 2003 and places them automatically in your System32 folder while installing Visual Studio. You can find separate MFC DLLs for most of the languages.
Regards,
|
|
|
|
|
Thank u for all replies.
Actually, the problem with me was that I didn't used UNICODE macro.
When I took a UNICODE build, the letters changed to Japanese.
But the "open" and "cancel" text on the button still remains same.
Is there any way to change this?
Jahfer V P.
|
|
|
|
|
Hi all,
How can i add a user control as a treenode to a TreeView control using C#.
What are all the steps that i need to take in order to accomplish the above task?
Any examples or links will be helpful.
Thanks in Advance
Phani Kiran K.
|
|
|
|
|
tyours bobby wrote: using C#.
Ask the user's of C#. There is a C# forum for this.
This is a VC++ forum.
Jesus Loves <marquee direction="up" height="40" scrolldelay="1" step="1" scrollamount="1" style="background:#aabbcc;border-bottom:thin solid 1px #6699cc">
--Owner Drawn
--Nothing special
--Defeat is temporary but surrender is permanent
--Never say quits
--Jesus is Lord
|
|
|
|
|
|
Hi,
This is my situation: I have created a project (MFC) which depends on a dll with a lib file (non-unicode). Everything compiles fine (for both debug and release). But I have to build my project again in UNICODE. I have corrected everything for unicode build (as to my source code). I have now a dll and lib file built in unicode. How to I add that dll and lib file to my project? I keep getting unresolved external symbol errors for Debug Unicode and Release Unicode(I think the compiler is looking for a specific function from the dll built in unicode. I would really appreciate it if you could tell me the steps in adding my unicode lib file to the project(not just the simple right click on project and add file, that still doesn't work).
Thanks,
Waxie
-- modified at 23:57 Thursday 19th January, 2006
|
|
|
|
|
|
Thanks for the reply.
Where will be I placing this snippet of code? In what file?
waxie
|
|
|
|
|
|
Another way to do this is to create a separate configuration for unicode debug. In that configuration link your unicode libs and that will work. Similar can be done for Unicode Release.
Regards,
|
|
|
|
|
Hi,
How to convert a .doc,.xls,.pdf etc..file to a CSV file format and then covert it back to .doc,.xls,.pdf file format.
Is there any utility/program available that can be directly integrated into my application for this job? Or Is there any support provided in MFC for the same?
Any Code snippet or function...please help.
your time and help is much appreciated.
Thanks & Best Regards,
Mahesh
|
|
|
|
|
Amarelia wrote: Is there any utility/program available that can be directly integrated into my application for this job?
Have you tried saving the word documents as a RTF file? The excel file can be resaved as CSV (Comma delimited) file? As those are really flat text files CVS should be fine with them and office can still use them (you wont be able to use the fancy formatting of office but it should work).
|
|
|
|
|
S Douglas wrote: Have you tried saving the word documents as a RTF file? The excel file can be resaved as CSV (Comma delimited) file?
That would be the route I'd choose.
"The words of God are not like the oak leaf which dies and falls to the earth, but like the pine tree which stays green forever." - Native American Proverb
|
|
|
|
|
DavidCrow wrote: That would be the route I'd choose.
Sometimes the simplest solution eludes even the best of us. No reason to re-invent the wheel when office is capable of working with the simpler formats. The PDF files now on the other hand well they would be just a pain in the but, unless your running subversion.
|
|
|
|
|
Hello,
I have an unmanaged C++ dll that I would like to load in a managed C++ application. I can call methods in the dll from an *unmanaged* program with no issues.
I set up the import using:
[DllImportAttribute("lib.dll")] int function();
The project is correctly set to find the libary files.
When I run the compiled program, it throws an execption at the line:
function();
The exception is:
An unhandled exception of type 'System.EntryPointNotFoundException' occurred in testManaged.exe<br />
<br />
Additional information: Unable to find an entry point named function in DLL lib.dll.
This error indicates that it cannot find the function in my libarary, but I know the function is there and accessible because I can access it from unmanged code. Is there something wrong with my import statement? Anything else?
Thanks,
--Jordan
-- modified at 23:40 Thursday 19th January, 2006
|
|
|
|
|
Try adding a ExactSpelling=true . I think the syntax would be like this:
<br />
[DllImportAttribute("lib.dll", ExactSpelling=true)] int function();<br />
But I'm not a dotNET guru...
Steve
|
|
|
|
|
The ExactSpelling attribute did not fix it (I get the same exception), but thank you for the suggestion.
--Jordan
|
|
|
|
|
Can you post the declaration of the unmanaged function (so I can check the calling convention) - The C++ code.
Steve
-- modified at 0:06 Friday 20th January, 2006
FIXED errors
|
|
|
|