|
Hi all,
I want to get language of my system through coding, like if my system is supporting English or chinese then i should get the specified value....
I am not getting how to do it???
can anybody tell me how to do it???
thanks in advance
|
|
|
|
|
VCProgrammer wrote: I want to get language of my system through coding, ... if my system is supporting English or chinese
See GetLocaleInfo()[^] and EnumUILanguages()[^]
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
hey thanks... it solved my problem...
|
|
|
|
|
Hi Every body...Iam sending Hello World Text From Flex To Html component ...but its displaying in Html like this
<TEXTFORMAT LEADING="2"><P ALIGN="LEFT"><FONT FACE="Verdana" SIZE="10" COLOR="#0B333C" LETTERSPACING="0" KERNING="0">Hello World!</FONT></P></TEXTFORMAT>
But i need only For Hello World ...
how to display Hello World only in Html component ..any body help me..
|
|
|
|
|
How did you send it? can you show your code?
|
|
|
|
|
Hi all,
I m using Droplist combobox because i want to use uneditable combobox.
but when i want to show particular string of combobox then it is blank.
I m using here SelectString but it is not working.
Please tell me how can i show the selected string in droplist combobox.
Thanks in advance.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Can you please show us your code?
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
But is working in case of Dropdown.
in my code at input side i m save a string from Combbox.and at the time output i m showing the saved string.
CCombobox m_mnts_combo;
m_mnts_combo.SelectString(0, (CString)m_PayMonth);
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
Have you checked the return value of SelectSring?
The documentation says that the return value would be:
The zero-based index of the selected item if the string was found. If the search was unsuccessful, the return value is CB_ERR and the current selection is not changed.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
someone wrote: m_mnts_combo.SelectString(0, (CString)m_PayMonth);
What type is m_PayMonth ?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
it is string which we want to show.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
He asked you what type of variable it is. (LPCTSTR, LPTSTR, TCHAR*, CString, etc?)
Ok, everytime I enter aa code with anny of the #include starters, i get 103 errors and 2 warnings, and then I look for them, and it opens a new window "tab" thingy, and otsream, or istream or math or w/e i am using comes up. It makes testing fully written programs impossible to test. Does anyone know how to fix it?? - A query asked on the VC++ board[ ^]
|
|
|
|
|
CString type varialble.
IN A DAY, WHEN YOU DON'T COME ACROSS ANY PROBLEMS - YOU CAN BE SURE THAT YOU ARE TRAVELLING IN A WRONG PATH
|
|
|
|
|
He will get notified only if you reply to him.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
Then why the unnecessary cast?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Hey what happend for your posts(are you toxxct? ) of course I give you 5 vote ,but its question for me why 1 without any explain?
|
|
|
|
|
Thanks a lot for the vote.
Nobody can give you wiser advice than yourself. - Cicero
.·´¯`·->Rajesh<-·´¯`·.
Codeproject.com: Visual C++ MVP
|
|
|
|
|
You're welcome.
|
|
|
|
|
ThatsMe. wrote: I m using here SelectString but it is not working.
Why its not working?whats the return value?
|
|
|
|
|
CComboBox m_Cmb;
m_Cmb.SetCurSel(0);
|
|
|
|
|
Hi All,
i want to capture Video by using Web camera. For this i am using
capCreateCaptureWindow API to capture Video. but there is fatal error as
rror LNK2019: unresolved external symbol _capCreateCaptureWindowW@32 referenced in function "public: virtual int __thiscall CVideoCaptureDlg::OnInitDialog(void)" (?OnInitDialog@CVideoCaptureDlg@@UAEHXZ)
i am using this API in OninitDialog() function of DialogBox class. The code is as
BOOL CVideoCaptureDlg::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
HWND hWndC = capCreateCaptureWindow((LPCWSTR)"My Capture Window",WS_CHILD | WS_VISIBLE,
0,0,240,240,m_hWnd, 0);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
Though i include header file Vfw.h and link lib file Vfw32.lib in my project.
So Is there any setting required to execute Above API correctly?
Thanks
Atul
|
|
|
|
|
I have written a simple Stash of string program, I used the Stash header file from the book "Think in C++", but when I tested the program, it didn't run well. The Stash can hold each line from the file, but when I cout each line from Stash, it outputs some unknow characters, could you please tell me why? And what's wrong in my program, many thanks.
#include <vector>
struct Stash {
int size;
int quantity;
int next;
unsigned char* storage;
void initialize(int size);
void cleanup();
int add(const void* element);
void* fetch(int index);
int count();
void inflate(int increase);
};
#include "stash.h"
#include <iostream>
#include <cassert>
#include <vector>
using namespace std;
const int increment = 100;
void Stash::initialize(int sz) {
size = sz;
quantity = 0;
storage = 0;
next = 0;
}
int Stash::add(const void* element) {
if(next >= quantity)
inflate(increment);
int startBytes = next * size;
unsigned char* e = (unsigned char*)element;
for(int i = 0; i < size; i++)
storage[startBytes + i] = e[i];
next++;
return(next - 1);
}
void* Stash::fetch(int index) {
assert(0 <= index);
if(index >= next)
return 0;
return &(storage[index * size]);
}
int Stash::count() {
return next;
}
void Stash::inflate(int increase) {
assert(increase > 0);
int newQuantity = quantity + increase;
int newBytes = newQuantity * size;
int oldBytes = quantity * size;
unsigned char* b = new unsigned char[newBytes];
for(int i = 0; i < oldBytes; i++)
b[i] = storage[i];
delete []storage;
storage = b;
quantity = newQuantity;
}
void Stash::cleanup() {
if(storage != 0) {
cout << "freeing storage" << endl;
delete []storage;
}
}
int main() {
ifstream in("stash.h");
Stash t;
t.initialize(sizeof(string));
string s;
int i = 0;
while(i < 6) {
getline(in, s);
cout <<"s:" <<s<<endl;
t.add(&s);
i++;
}
i = 0;
cout <<"------------------"<<endl;
while(i < 6) {
cout <<"+" <<*(string *)(t.fetch(i))<<endl;
i++;
}
|
|
|
|
|
quboo wrote: ...it outputs some unknow characters...
Are the strings nul terminated?
"Love people and use things, not love things and use people." - Unknown
"To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne
|
|
|
|
|
Suppose there is a class ClassTest with one argument constructor (no default constructor).
ClassTest
{
Public:
ClassTest(int i); //no default Cotr
}
A non heap array of objects of above class can be created as below
int ID1, ID2, ID3;
ClassTest ArrayClassTest [] = { ID1, ID2, ID3};
How to create an array of object of class ClassTest. If its Ctor takes two args
ClassTest
{
Public:
ClassTest(int i,int j); //no default Cotr
}
VIBIN
"Fool's run away,where angle's fear to tread"
|
|
|
|
|
vibindia wrote: int ID1, ID2, ID3;
ClassTest ArrayClassTest [] = { ID1, ID2, ID3};
How to create an array of object of class ClassTest. If its Ctor takes two args
ClassTest
{
Public:
ClassTest(int i,int j); //no default Cotr
}
ClassTest ArrayClassTest [] = {ClassTest( 1, 2), ClassTest( 1, 2)};
Nibu thomas
Microsoft MVP for VC++
Code must be written to be read, not by the compiler, but by another human being.
Programming Blog: http://nibuthomas.wordpress.com
|
|
|
|