|
hi all,
i want to ask if any one has an experience with localizing under vs6, i am working on an application with arabic interface, and i know that is the only way to change the resources files to arabic is by editing the .rc file and change the language from:
LANGAUGE LANG_ENGLISH, SUBLANG_ENGLISH_US
to
LANGUAGE LANG_ARABIC, SUBLANG_ARABIC_SAUDI_ARABIA
when i done this every thing goes fine, and i can compile the project with out any problem, but when i close the workspace and want to open it again it does not opened.
i tried to delete the workspace file and open the project one, but it does not opened to, and "out of memory" message box appears.
Please help me.
Razi.
|
|
|
|
|
You can change languages through the IDE. Right-click->Properties on any resource in the tree and the properties window will have a combobox where you can pick the language.
--Mike--
Visual C++ MVP
LINKS~! Ericahist | 1ClickPicGrabber | NEW~! CP SearchBar v3.0 | C++ Forum FAQ
Pinky, are you pondering what I'm pondering?
I think so Brain, but if we shaved our heads, we'd look like weasels!
|
|
|
|
|
Problem Solved. I was looking for the wrong EOF sign.
I have a while loop
bool fContinue = true;<br />
do<br />
{<br />
lLastError = serial.WaitEvent();<br />
Inside this loop, I receive data and process it.
<br />
if (eEvent & CSerial::EEventRecv)<br />
{<br />
DWORD dwBytesRead = 0;<br />
char szBuffer[101];<br />
do<br />
{<br />
lLastError = serial.Read(szBuffer,sizeof(szBuffer)-1,&dwBytesRead);<br />
if (lLastError != ERROR_SUCCESS)<br />
return ::ShowError(serial.GetLastError(), _T("Unable to read from COM-port."));<br />
<br />
if (dwBytesRead > 0)<br />
{<br />
szBuffer[dwBytesRead] = '\0';<br />
<br />
printf("%s", szBuffer);<br />
write2file(szBuffer);<br />
<br />
if (strchr(szBuffer,EOF_Char))<br />
fContinue = false;<br />
}<br />
}<br />
while (dwBytesRead == sizeof(szBuffer)-1);<br />
}<br />
}<br />
while (fContinue);<br />
now what happens, that it somehow never sets fContinue to false.
but the first function I call, serial.WaitEvent(); , doesn't get something either, and I can see that in fact all the expected data has arrived. Is it that code running on the other side of the comport does not send the proper EOF? or what could it be?
thanks for any suggestions
|
|
|
|
|
Hi all, I have a DLL written in MFC (and tested extensively with MFC client apps) that I am not trying to link to from a non-MFC app. The code crashes inside the CInternetSession constructor on a call to call to AfxGetAppName. Is this a sign that I can't use the DLL in a non-MFC app, or is there something more subtle to it? Is there any workaround?
Thanks
|
|
|
|
|
Actually 2 points I should mention -- this DLL works fine with the non-MFC app except for the portion of it that uses WinInet functionality. And also, I am linking indirectly to the DLL through an ActiveX object which is written with ATL. The application which is loading the ActiveX object, is written in Visual Basic.
|
|
|
|
|
|
Thanks -- I'll take a look.
|
|
|
|
|
Well when I put calls to AFX_MANAGE_STATE in, the compiler complains that I have multiple defines of __pRawDllMain and _DllMain@12 -- it is tring to link in dllmodul.obj in mfcs42d.dll and these symbols are defined in my own object code.
By the way, the crash is happening on a worker thread so there is no non-MFC code on the call stack. Don't know if that makes a difference.
|
|
|
|
|
OK -- I see now that my problem may be, that I don't have a CWinApp-derived class in my DLL -- just a DllMain. I am going to switch over to a CWinApp object and insert the AFX_MANAGE_STATE calls, hopefully that will clear it up.
|
|
|
|
|
This seems like a straightforward problem but I am totally stumped and just can't figure it out. It seems that whenever some changes are made in some of the classes in my project (Specifically a newly added function takes a parameter of a different type class from the Project), the "location" of the include line for that class must be changed inside the "stdafx.h". Otherwise the compiler complains that it does not know what the Object being passed in is.
Here's an example:
[stdafx.h]
#include "class1.h" //the order of files here seems to cause problems.
#include "class2.h"
[class1.h]
#include "stdafx.h"
..... //some code
void Test(Class2* pClass); << //C2061 error occurs on this line saying it does not know what Class2 is!!!!
However if I switched around class2.h to be followed by class1.h in the stdafx.h there would be no problem.
Maybe I am doing something wrong but if I put all the include files into the stdafx.h and them simply include it in every class header file, shouldnt the compiler be able to know what all the classes area?
Any help is greatly appreciated.
Sincerely,
Ilya
|
|
|
|
|
massad wrote:
shouldnt the compiler be able to know what all the classes area?
No. The order of the header files can be important. If a prototype in class1.h needs to know about a type defined in class2.h then class2.h normaly needs to be included before class1.h.
Most developers, now days, put a guard define# in there headers so that they will not be included twice (prevents include recursion). This also give you the advantage of allowing you to include any header files (w/guards) in any header file that needs the types defined in that header. It is also why C++ allows you to declare a class type, before it is define.
#ifndef _CLASS1_H_ // guard
#define _CLASS1_H_
#include "class2.h"
class class1 {...}
#endif // _CLASS1_H_
OR
#ifndef _CLASS1_H_ // guard
#define _CLASS1_H_
class class2;
class class1 {...}
#endif // _CLASS1_H_
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Thank you John,
I have fixed the problem. Before I posted here, I tried to use forward declaration and the guards but I still seemed to have the errors appear.
The problem seems to have stemmed from the fact that the code was all inline in the header file (this is the way it was given to me, I didnt write it) and no code was put into the .cpp file.
While trying to figure out what the problem was, I had become fed up with all the code being inline and split it up between a header and the source and the problems disappeared.
Out of curiousity, so that I know for future reference, is there a problem with forward declarations if all the code is inside a header file?
|
|
|
|
|
massad wrote:
is there a problem with forward declarations if all the code is inside a header file?
I would not think so. At least I have had no problems, resonantly.
INTP
"The more help VB provides VB programmers, the more miserable your life as a C++ programmer becomes."
Andrew W. Troelsen
|
|
|
|
|
Hello,
It seams that a problem with including to many headers. You should not include stdafx.h in your header.
The problem that you face is that you include stdafx.h in class1.h. In stdafx.h, you include class1.h, which in turn includes stdafx.h again. This is an infinite cycle and the compiler knows this. It just stops including and you get some errors.
If you don't use class1 in class2, you can include class2.h instead of stdafx.h in class1.h and you problem should be gone!
Behind every great black man...
... is the police. - Conspiracy brother
Blog[^]
|
|
|
|
|
#include "stdafx.h" is a signal to the compiler to use the precompiled header -- your compiler will perform better if you don't include stdafx.h in header files, instead include it as the first include file in your source files.
|
|
|
|
|
massad wrote:
[stdafx.h]
#include "class1.h" //the order of files here seems to cause problems.
#include "class2.h"
Why are you including class1.h and class2.h in stdafx.h ? In 12 years of using MFC, I've never had the need to include anything in that file except for system (e.g., Win32, MFC, STL) header files.
"One must learn from the bite of the fire to leave it alone." - Native American Proverb
|
|
|
|
|
in stdafx.h keep only those header files which are required by every .cpp which will save your compilation time.in your case if u put the header file in stadfx.h the order of these included file is imp as u r using an instance of a class into the other.in ur case its better u dont put up any include file in stadfx.h .rather than u put those header file in the .h file of a .cpp file which u require in that .cpp file
|
|
|
|
|
Is there any way to compile a simple console application with Visual Studio NET 2003 to run on a machine without NET Framework installed? I'd like the target application to run on any machine, not just those with NET installed.
I'm sure this is a simple thing, but I sure can't find it!
|
|
|
|
|
If you used Managed C++, then no, there is no way you can run those applications without the .NET framework.
Regards
Senthil
_____________________________
My Blog | My Articles | WinMacro
|
|
|
|
|
All I want to do is to create a simple console application, I can't believe it's impossible with VC++ NET.
|
|
|
|
|
|
All I want to do is to create a simple console application, I can't believe it's impossible with VC++ NET.
If a "win32" console application,you can do it.
If a ".NET" console application, you can't do it
Tiny dog is me.
|
|
|
|
|
Problem solved, I don't know how the /clr switch got set in the project, but there it is!
|
|
|
|
|
I have an option to make a Win32 Console Application in the New Project Wizard, that's close to what you're looking for. You could try making an empty project, too! Just include the basic dependencies you need.
|
|
|
|
|
Thanks, I figured it out. I started over with a basic W32 console application. I have no idea why my original attempt refused to function without NET installed, I started it the same way.
|
|
|
|