|
Hi all:
How to get "general" tab info from "sys property" pragrammatically, I'm trying to identify Windows XP 64bit OS, but with GetVersionEx I always get "Windows Server 2003" instead of XP. But I saw the info on "General" tab was correct, So...
|
|
|
|
|
|
How are you using the returned structure?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I m trying to make a list control in sdi application using create function.
Like this...
Create(WS_CHILD|WS_VISIBLE|WS_BORDER|LVS_REPORT,
CRect(300,300,800,600), this, 1);
This is creating my list control in particular area(i.e the co-ordinates specified in CRect)
but i want that it should occupy my whole sdi window how to do it????
|
|
|
|
|
why dont u create a sdi application with listview. in the appwizard, u can find option for this in the last page.
nave
|
|
|
|
|
Are you using MFC?
"Approved Workmen Are Not Ashamed" - 2 Timothy 2:15
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi All
I am doing project in VC++ , in which i want to display messages in japanese. What changes i need to make in code and any other setting.
Regards
M.Atul
M.Atul
|
|
|
|
|
specify _UNICODE in the preprocessor directive.
nave
|
|
|
|
|
Hi, I am already completing this project ,actually with the help of unicode standard u can do it,i am sending u one site
http://www.unicode.org/charts[^]
Yes U Can ...If U Can ,Dream it , U can do it ...ICAN
|
|
|
|
|
Hi all,
How can i convert a TCHAR to a string?
for example:
<code>
TCHAR infoBuf[INFO_BUFFER_SIZE];
GetComputerName( infoBuf, &bufCharCount );
string pc;
... convert / assign the value of infoBuf to pc ...
</code>
Many Thanx
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
Hi,
There is no needed any conversion:
pc.assign( bufCharCount );
should work fine.
-----------
Mila
|
|
|
|
|
Sure about that ?
Error 1 error C2664: 'std::basic_string<_Elem,_Traits,_Ax> &std::basic_string<_Elem,_Traits,_Ax>::assign(const std::basic_string<_Elem,_Traits,_Ax> &)' : cannot convert parameter 1 from 'DWORD' to 'const std::basic_string<_Elem,_Traits,_Ax> &' c:\documents and settings\qx55246\my documents\visual studio 2005\projects\testsmsintferface\testsmsintferface\testsmsintferface.cpp 24
-- modified at 3:49 Wednesday 13th December, 2006
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
sorry my mistake not bufCharCount but infoBuf
pc.assign( infoBuf );
-----------
Mila
|
|
|
|
|
Sorry bro but:
Error 1 error C2664: 'std::basic_string<_Elem,_Traits,_Ax> &std::basic_string<_Elem,_Traits,_Ax>::assign(const std::basic_string<_Elem,_Traits,_Ax> &)' : cannot convert parameter 1 from 'TCHAR [32767]' to 'const std::basic_string<_Elem,_Traits,_Ax> &' c:\documents and settings\qx55246\my documents\visual studio 2005\projects\testsmsintferface\testsmsintferface\testsmsintferface.cpp 24
TCHAR infoBuf[INFO_BUFFER_SIZE];
DWORD bufCharCount = INFO_BUFFER_SIZE;
GetComputerName( infoBuf, &bufCharCount );
string pc;
pc.assign( infoBuf );
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
ok, you use VS2005 (I've just noticed it). There is UNICODE by default.
TCHAR is defined as a wchar_t and to cooperating with it is std::wsting.
If you really need convet it, you can use e.g. wcstombs or W2A
-----------
Mila
|
|
|
|
|
Thnx alot Mila for the help and quick replies ....
ANSWER:
wchar_t infoBuf[INFO_BUFFER_SIZE];
DWORD bufCharCount = INFO_BUFFER_SIZE;
GetComputerName( infoBuf, &bufCharCount );
wstring pc = infoBuf;
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
|
|
I would suggest some modifications to your code,
TCHAR infoBuf[INFO_BUFFER_SIZE];
DWORD bufCharCount = INFO_BUFFER_SIZE;
GetComputerName( infoBuf, &bufCharCount );
string a;
#ifdef UNICODE
size_t i;
char temp[INFO_BUFFER_SIZE];
wcstombs_s(&i,temp,(size_t)INFO_BUFFER_SIZE,infoBuf,(size_t)INFO_BUFFER_SIZE);
a.assign(temp);
#else
a.assing(infoBuf);
#endif
|
|
|
|
|
Thnx for the pointers Prasad ... I appriciate the help
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
One more way to achieve this. Save one function call,too.
TCHAR infoBuf[INFO_BUFFER_SIZE];
GetComputerName( infoBuf, &bufCharCount );
basic_string<TCHAR> pc(infoBuf);
|
|
|
|
|
Thnx Prasad,
But my fubction accepts a std::string and when I do this:
TCHAR infoBuf[INFO_BUFFER_SIZE];
GetComputerName( infoBuf, &bufCharCount );
basic_string <TCHAR> pc(infoBuf);
this would happen:
Error 1 error C2664: 'CIniFile::SetValue' : cannot convert parameter 2 from 'std::basic_string<_Elem,_Traits,_Ax>' to 'std::string' c:\documents and settings\qx55246\my documents\visual studio 2005\projects\testsmsintferface\testsmsintferface\testsmsintferface.cpp 32
The only programmers that are better than C programmers are those who code in 1's and 0's.....
Programm3r
|
|
|
|
|
If your language/tool supports WideCharToMultiByte and MultiByteToWideChar functions, you may use them for ASCII<->UNICODE string conversion.
Hope this helps.
Anand
|
|
|
|
|
how .tlh file get generated ? iam using vc 6.
|
|
|
|
|
You need to import valid type library in your project.
#import "MyComObj.tlb"
|
|
|
|