|
|
Killing a process should only be a last resort and can be dangerous; better to ask it to close down. That said, you can use the TerminateProcess API to kill a process given a HANDLE to the process. The OpenProcess function can be used to get a process HANDLE from its id.
Steve
|
|
|
|
|
I have made a simple MFC exe..in VS 6.0...which has all the resources in the english language...
I have to create a Resource Only DLL in some other language say..German...so...when i click on a resource and insert a copy of it in German language..(Insert -> Resource copy....which..opens a Dialog where I can choose the resource language)....then the resource still has the text in english...but the microsoft articles say it should be translated to German.....(Point no.8 in the article http://support.microsoft.com/kb/198846)
The other way is ....I create a fresh MFC exe choosing German language from the beginning and copy its German Resources script file to the english mfc exe..
Wats going wrong in the former..approach....plzzz help me out..
Thnx...
...A Master Programmer may or may not be the master of the programming language grammar...
|
|
|
|
|
To use a resource only dll, you need to create a dll that contains all of your string resources an whatever else for each language. Each dll should have same 'type' header file, which means each ID for the resource should be the same for each language. All your exe needs to do is load the appropriate dll for the specified language then use the string ID's as normal.
Is it possible you are forgetting to update the current windows when hot-switching between languages?
|
|
|
|
|
Thnx for the response...
jas tell me one simple thing...
This is my basic doubt
If I right click on a resource in the Resource view and then on 'Insert copy' and choose some other language...say German..then a copy of that resource will be added...but will it have be in English or German.....? Please do me the favor by checking this thing on ur machine...
On my VS 6.0...it always comes in English....they don't get translated to German on the fly...
All this while I do not change the language from Control Panel->Regional Setting n langs..to some other language...it is english...always...
And, wat language hot switching hve u referred to in ur response......?
Maybe, I am missing some locale setting change...
Thnx...
-- modified at 13:47 Thursday 1st February, 2007
...A Programmer may or may not be the master of the programming language grammar...
|
|
|
|
|
When you choose the language while adding resources, it will not perform any translation. Infact, all it will do is add the new resources under a different codepage. You will need to translate all the text strings yourself. Also, when using two languages and two codepages in the same resource, you will still need to add code to your exe to be able to switch between the two.
Whenever I build a multi language app, I will always create a dll for each language. All the dll's need to contain are the dialogs and strings, with the same ID's, translated into various languages. Then in the exe, I will add code to scan the dll folder hence checking for what languages are available. I then dynamicaly link to a single dll, depending on the OS's language.
This way, I can add more languages simply by creating a new dll. The exe is also able to hot switch between languages by simply unloading the dll and loading a new one in it's place.
|
|
|
|
|
Hi....
I think I got my answer that there will be no automatic translation and I have to edit them manually....ok...rest of the theory is clear to me..like using that dlls n all...
Well...thanx a lot for the answer....
...A Programmer may or may not be the master of the programming language grammar...
|
|
|
|
|
How to show Video Preview from Video Packets in VC6?
OR How to use VLC in VC6? Is there any ActiveX Control of VLC that can be used in VC6?
|
|
|
|
|
|
See here[^] if its helpfuls
|
|
|
|
|
Hi
All
I am doing multilingual application in which i am loading string from DLL in client application, but i want to set this string to Static text of Dialog box. So how can done it.
Thanks and Regards
Atul Mahajan
Atul
|
|
|
|
|
M. Atul wrote: but i want to set this string to Static text of Dialog box. So how can done it.
How far have you done.
|
|
|
|
|
This forum is here to help, not give you answers to homework assignments. Perhaps if you could show us what you have already tried we would be able to help you a little more.
|
|
|
|
|
M. Atul wrote: i want to set this string to Static text of Dialog box. So how can done it.
With SetWindowText() .
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Do you want to set text you can use of SetWindowText or WM_SETTEXT
|
|
|
|
|
I have a code as follows:
CSpanLoad *pBDLd;
CSpanLoad *pA3DLd;
---
---
--
pBDLd = pA3Ld;
//this assignment has to call the function:
void CSpanLoad::operator=( const CTRYObject &src ).
CTRYObject is inherited from CObject class.But now the assignment is not calling void CSpanLoad::operator=( const CTRYObject &src ) instead is calling the operator= of CObject.
If i give *pBDLd = *pA3Ld then it shows the compilation error as:
error C2248: 'CObject::operator =' : cannot access private member declared in class 'CObject'"
see declaration of 'CObject::operator ='
see declaration of 'CObject'
This diagnostic occurred in the compiler generated function 'CPtrArray &CPtrArray::operator =(const CPtrArray &)'
Why the error?
**NOTE:
*pBDLd = *pA3Ld was working in VC6 properly without error.The error came in VS2005(.net).For correcting that only i changed into
pBDLd = pA3Ld;//which is not working as intended
Plz help..
Thanks and Regards
|
|
|
|
|
sheetal_06 wrote: If i give *pBDLd = *pA3Ld then it shows the compilation error as:
In this case assignment operator for CSpanLoad will be called.
|
|
|
|
|
sheetal_06 wrote: error C2248: 'CObject::operator =' : cannot access private member declared in class 'CObject'"
see declaration of 'CObject::operator ='
see declaration of 'CObject'
This diagnostic occurred in the compiler generated function 'CPtrArray &CPtrArray::operator =(const CPtrArray &)'
This error is due to,You are using CPtrArray object(which you have ot mentioned) in your app. in way its assignment operotor is is being called.
You need to show CPtrArray class object usage in your application.
|
|
|
|
|
This simply copies a pointer:
pBDLd = pA3Ld;
CObject hides the assignment operator to protect you from making a mistake.
Therefore, you need to define and implement an assignment operator for classes derived from
CObject:
class CSpanLoad : public CObject
{
...
public:
CSpanLoad &operator=(const CSpanLoad &Src);
};
CSpanLoad &CSpanLoad::operator=(const CSpanLoad &Src)
{
return *this;
}
Then *pBDLd = *pA3Ld will work.
Mark
-- modified at 20:36 Thursday 1st February, 2007
|
|
|
|
|
//.h
class CCGMObject : public CObject
{
-----
};
class CSpanLoad : public CCGMObject
{
...
public:
void operator=( const CCGMObject& );
};
//.cpp
void CSpanLoad::operator=(const CCGMObject& Src)
{
// copy Src object to this object
}
Above code is not working..
Now when i made the code as follows according to ur suggestion it is working....Why?Could u plz explain..
class CCGMObject : public CObject
{
-----
};
class CSpanLoad : public CCGMObject
{
...
public:
void operator=( const CSpanLoad & );//changed
};
//.cpp
void CSpanLoad::operator=(const CSpanLoad & Src)//changed
{
// copy Src object to this object
}
CSpanLoad *pALd,*pBLd;
*pBLd = *pAld;
Thanks
-- modified at 0:27 Friday 2nd February, 2007
|
|
|
|
|
What do you mean by not working? Didn't compile? Didn't link? Didn't run?
What error messages?
|
|
|
|
|
It didn't compile..Shows error as:
error C2248: 'CObject::operator =' : cannot access private member declared in class 'CObject'"
see declaration of 'CObject::operator ='
see declaration of 'CObject'
This diagnostic occurred in the compiler generated function 'CPtrArray &CPtrArray::operator =(const CPtrArray &)'
This error is coming only when i compile in VS2005.In VC6 it is not coming!
|
|
|
|
|
sheetal_06 wrote: This diagnostic occurred in the compiler generated function 'CPtrArray &CPtrArray::operator =(const CPtrArray &)'
Where are you using a CPtrArray? I haven't seen that in your code so far.
Are you trying to assign one array to another with the = operator?
|
|
|
|
|
CPtrArray is a compiler generated function..
I am trying to copy the contents of one pointer into another...
|
|
|
|
|
Ok. In order for a CPtrArray to be copied, the objects in the array need to be copyable.
The assignment operator isn't virtual which is why your code didn't compile.
If copying CSpanLoad objects then the CSpanLoad class needs to have an assignment operator, even
if it is derived from a class which has an assignment operator defined.
Mark
|
|
|
|