|
Hi all,
i want to find out values of language,computer name and user name through coding....
I am unable to find it in registry. How could i find them
Thanks in advance
|
|
|
|
|
char RemoteFileName[60];
TCHAR chrComputerName[MAX_COMPUTERNAME_LENGTH + 1];
DWORD dwBufferSize = MAX_COMPUTERNAME_LENGTH + 1;
if(GetComputerName(chrComputerName,&dwBufferSize)) {
// We got the name, set the return value.
strcpy(RemoteFileName,chrComputerName);
you may need to #include <windows.h>
|
|
|
|
|
try this,
TCHAR tszComputerName[MAX_COMPUTERNAME_LENGTH + 1];
DWORD dwBufLen = sizeof(tszComputerName);
DWORD nSize;
GetComputerName(tszComputerName, &dwBufLen);
AfxMessageBox(tszComputerName);
GetSystemDirectory(tszComputerName,MAX_PATH);
AfxMessageBox(tszComputerName);
tszComputerName[0] = TEXT('\0');
nSize = sizeof(tszComputerName) / sizeof(TCHAR);
GetUserName(tszComputerName, &nSize);
AfxMessageBox(tszComputerName);
|
|
|
|
|
|
I would like to put a copyright notice in the Help About box. I know how to change the text in this box in the Visual C++ environment, but I don't know how to put the copyright symbol (a circle with a c enclosed in the circle)into my text string. How can I put this special symbol in my text string. I'm using Visual C++ 6.0.
Thanks
|
|
|
|
|
Run charmap.exe and copy the symbol from there.
"It is better to remain silent and be thought a fool, than to open your mouth and remove all doubt."
--Groucho Marx
|
|
|
|
|
thanks both,
this is useful for me in many other contexts.
|
|
|
|
|
Typing Alt-0169 (on the number pad) will give you that symbol when using the ANSI character set.
Anyone who thinks he has a better idea of what's good for people than people do is a swine.
- P.J. O'Rourke
|
|
|
|
|
Hi!
One of my include file used to be like this:
my_include.h
<br />
struct tagInfo<br />
{<br />
int a;<br />
int b;<br />
} stInfo;<br />
Then I added the element c:
<br />
struct tagInfo<br />
{<br />
int a;<br />
int b;<br />
int c;<br />
} stInfo;<br />
My program goes something like this:
<br />
#include "my_include.h"<br />
MyProg ()<br />
{<br />
CString string1.Format("%d", stInfo.a);<br />
CString string2.Format("%d", stInfo.c);<br />
}<br />
In the string#.Format statement, when I type the . after stInfo, VC++ open a popup window with a list of all elements included in the structure stInfo. That list still shows a and b only. The element c is not showed but it compiles properly. I know I have the right file because if I change the element a to z in my include file, then the code does not compile because a is not a member of stInfo.
I guess I need to refresh something but I don't know what.
Thanks for your help.
jpyp
|
|
|
|
|
If you are using Visual C++ 6, Visual Studio .NET (2002), or Visual Studio .NET 2003, the IntelliSense file has gotten corrupted. This file has the extension .ncb, and will have the same name as your project file. Exit Studio, delete the .ncb file, and it will be recreated automatically when you open the project again.
Visual Studio 2005/2008 may use the same thing, but I don't use them regularly so I don't know for sure.
|
|
|
|
|
Im completely new to MFC and we got this project for creating a GSM cellular network ...what I want to know is how can I open a new dialog box on clicking a button that allows the user to enter some information. I know its a very basic question but I really cant figure it out !!!
|
|
|
|
|
Very basic stuff indeed. Have you done any Windows (API) programming before? Is it just MFC you have no experience with?
In any case, I recommend a good book like "Programming Windows with MFC" from Jeff Prosise.
"It is better to remain silent and be thought a fool, than to open your mouth and remove all doubt."
--Groucho Marx
|
|
|
|
|
You can use of CDialog class or CreateWindow for make a new dialog.
|
|
|
|
|
komalwaseem wrote: ...how can I open a new dialog box on clicking a button...
Well, how did you open the first dialog box?
"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
|
|
|
|
|
Mal ne doofe Frage :
Wie kann ich ein HWND in ein LPCWSTR casten, bzw. umwandlen?
|
|
|
|
|
In generale, non è una buona idea.
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I had to laugh at this - not the answers per se - just the fact he asked a question in German, on a site where 'lingua franca' happens to be english .. but he received an answer in italian, and german, both of which I understood !!
well done CP and all ..
|
|
|
|
|
Hey Garth, I'm quite impressed, how many languages do you understand?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
|
|
|
|
|
I can survive/get by in french speaking countries, I know enough Italian to survive in your lovely country (and did for 5 weeks on the road), although my Italian is slipping, I'll have to do something about that, a smattering of Spanish, German, basic Swahili
(and I can swear profusely in Greek and a few others - I had need to demonstrate this a long time ago when I was having my dislocated thumb repositioned - the poor doctor looked shocked and said he'd never been sworn at in so many languages .. then again, it was sans anaesthetic, thats my excuse)
Im actually looking at a trip for late 2009 which includes 15 days cycling Paris to Bruges, then maybe one week in Italy, although, I could easily spend two, Lucca, Sienna, Pavia perhaps (friend of my brother's there), Lake Como then possibly exit via Venice
..particularly for French, things Im 'thinking about' in English, I also try to remember the French for .. I should do the same with Italian
arriverderci !!
'g'
|
|
|
|
|
Wirklich eine schlechte idee! (This is a really bad idea!)
wchar_t szHandle[] = L"123456";
LPCWSTR p = szHandle;
HWND h = (HWND)(HANDLE)(DWORD)_wtol(p);
Beste Wünsche,
-David Delaune
|
|
|
|
|
Danke erstmal,
ich möchte zu debug-zwecken ein hwnd in einem Popupmenu ausgeben. Die AppendMenu funktion erwartet allerdings
ein PLCWSTR, daher meine Frage. Ich habs jetzt über den Klassennamen gelöst, ist wahrscheinlich besser ...
|
|
|
|
|
Wenn Du den Handle-Wert als string anzeigen willst, geht das nicht über einen cast, sondern über eine explizite Umwandlung mit sprintf, CString::Format oder auch _itot, z.B.
<br />
CString s;<br />
s.Format("%Xh", hwnd);<br />
Es gibt übrigens auch ein sehtr gutes deutsches Forum: c-plusplus.de[^]. Sei aber vorsichtig im "reinen" "C++" - Forum - alles Sprachnazis
We are a big screwed up dysfunctional psychotic happy family - some more screwed up, others more happy, but everybody's psychotic joint venture definition of CP blog: TDD - the Aha! | Linkify!| FoldWithUs! | sighist
|
|
|
|
|
|
Hi,
How can i design a class based on this situation.
There is a company C1. It has employees of type Contractors and Permanent. Contractors has a different salary calculation from that of permanent employees.
After creating the employees like some as contractors and some as an permanent. I need to change the contractor to permanent. How can i design a class structure in this way?
Is there any book or any site which gives some case studies on class designing?
If so, please tell me the book/site name.
Thanks in advance.
class employee
{
int salary;
virtual void claculatesal();
}
class contract: employee
{
voide calculate()
{ salary = 20*500 }
}
class permanent: employee
{
voide calculate()
{ salary = 7000; }
}
main()
{
permanent p1;
contractor c1;
I need to convert the C1 to P1 //i.e contractor to permanent
}
|
|
|
|
|
kk_mfc wrote: Is there any book or any site which gives some case studies on class designing?
No. No one knows anything about Object Oriented Design. And if they did they certainly would not write any books about it and you certainly could not find anything about it by searching with Google.[^]
led mike
|
|
|
|