|
Hello Everyone, I want to get user name. I changed user name. Now when I call GetUserName() I get old User name instead of new one. Is there any way to get new/current user name.
First deserve then desire. Let be deserved first.
|
|
|
|
|
GetUserName() gets the user name of the current thread. Perhaps you made the change in another thread.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Sorry, I think I gave uncomplete information. Scenerio is this : I am talking about Windows Log-In user. I changed name of User account and I logged in with that new name. But when I use GetUserName() I get old name of account and not new one with which I currently logged in. Any way out.
Thanks for reply.
First deserve then desire. Let be deserve first.
|
|
|
|
|
Shivaji Patil wrote: I want to get user name. I changed user name.
which username are you talking about.. is it the Windows user or your Application local user.. GetUserName reterive the UserName of Currently logged Windows user name
|
|
|
|
|
Sorry, I think I gave uncomplete information. Scenerio is this : I am talking about Windows Log-In user. I changed name of User account and I logged in with that new name. But when I use GetUserName() I get old name of account and not new one with which I currently logged in. Any way out.
Thanks for reply.
First deserve then desire. Let be deserved first.
|
|
|
|
|
What to do for changing ComboBox height ?
|
|
|
|
|
Your question is a bit unclear. Perhaps this article/code will help.
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
When I change pc to one that the screen size is big then my screen, i was the problem of size et position.
Since I use CLayoutHelp class I have solve this problem, but ComboBox control don't change their size. That my problem
|
|
|
|
|
Where is this article ? I don't see it
In zip file there are
two file smartDropdown.cpp and .h
send me this article please
I learn my self
|
|
|
|
|
It may posssible by setting font of the Combo box
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
I don't understand anything by to set font of combox.
Can you show clearly what i can do .
|
|
|
|
|
You just create the variable of the your combo box
CFont *m_font=new CFont();
m_font->CreatePointFont(200,"Tahoma");
m_Test.SetFont(m_font);
m_Test.AddString("1");
m_Test.AddString("2");
m_Test.AddString("3");
m_Test.AddString("4");
Knock out "T" from CAN'T
You 'CAN' if you think you 'CAN'
|
|
|
|
|
I have created a MDI application , such as "MDIEx".When I call function OnFileNew() in CMDIExApp,a MDI child will be created
How to creat a MDI child from CMDIExDoc? (Function CWinApp::OnFileNew() can't be accessed from CDocument)
Thank you!
Chao tat ca cac ban!
|
|
|
|
|
I guess you could do a AfxGetMainWnd( )->SendMessage( ) with WM_COMMAND and ID_FILE_NEW as parameters (look at the help for WM_COMMAND to figure out what WPARAM and LPARAM should be, I can't remember it from the top of my head...)
Wenn ist das Nunstück git und Slotermeyer? Ja! Beierhund das oder die Flipperwaldt gersput!
|
|
|
|
|
Hi all:
I am doing a OpenGL project. I want to create a function tracking the mouse motion so that the object in the window can spin or rotate according the mouse motion. I know there is a
void glutMotionFunc(void (*func)(int x, int y));
registration function. Does anybody know how to achieve the functionality please?
Thanks in advance!!!
Asura
|
|
|
|
|
Hi all,
I am using VFW.
I know i can set a call back message capSetCallbackOnFrame and then receive the callbak in:
LRESULT CALLBACK FrameCallbackProc(HWND hWnd, LPVIDEOHDR lpVHdr)
where lpVHdr->lpData is the buffer containing the video information to be shown(drawn)
my question is how do i add a drawing to that video? i want to see the captured frame from my webcam and ontop of that i want to draw something....
can any1 show me piece of code for that?
thanks in advanced
Yaron
Ask not what your application can do for you,
Ask what you can do for your application
|
|
|
|
|
I'd like to capture video from usb cam, what's the VFW?
9ine
|
|
|
|
|
|
hi
I am Working on a printing issue in MFC.I want the header to be printed in multiple lines.so I am using DT_WORDBREAK.It works fine when the string contains spaces(eg:1.Sample Print1 2.Sample Print2.....) but when the string contains no spaces the output is clipped at both ends
(eg input :1.SamplePrint12.SamplePrint2.....).
the output I am getting as follows:
mplePrint12.Sample
rint2.Sampl
the code I used is as follows
pDC->DrawText(String,rectArea, DT_CENTER | DT_WORDBREAK);
what could be the problem?Can anyone clearly explain me the functionality of DT_WORDBREAK.Am I using it in the correct way?
"Every morning I go through Forbes list of 40 richest people in the world. If my name is not in there, I go to work..!!!"
|
|
|
|
|
|
I can read in a notepad file in entirety, store it in a CString,
and then write it out. I cant do the same for a file in rich text
format. For some reason, I dont get all of the file and when I
write it out and then launch it, it shifted around. Any idea on
how to read in an entire RTF file to a CString and then write it
out?
I put together this code:
CString str; char c;
ifstream In("c:\file.rtf");
while (In)
{
In >> c;
if (In) str += c;
}
In.close();
ofstream Out("c:\\file1.rtf");
int len = str.GetLength();
for (int i=0; i
|
|
|
|
|
DanYELL wrote: I cant do the same for a file in rich text
format. For some reason, I dont get all of the file...
Probably because of the embedded '\0' characters (when using a CString object).
"Let us be thankful for the fools. But for them the rest of us could not succeed." - Mark Twain
"There is no death, only a change of worlds." - Native American Proverb
|
|
|
|
|
Try with a CFile:
1. Open the file
2. Allocate a buffer based on the file length
3. Read into the buffer.
4. Close the file.
5. Write the buffer to another file.
6. Delete the buffer.
This doesn't care about embedded nulls.
The tigress is here
|
|
|
|
|
I think your right that CFile is the solution. I sincerely appreciate
your feedback. My only remaining question is, how can I efficiency
read the entire file into a CString or something other than a buffer.
I have:
char buf[50001];
CFile cfFile ("C:\\Gille.RTF", CFile::modeNoTruncate | CFile::modeRead);
cfFile.Read(buf, 50000);
// open
CFile f;
CFileException e;
char* pFileName = "c:\\Gille2.rtf";
if( !f.Open( pFileName, CFile::modeCreate | CFile::modeWrite, &e ) )
{
#ifdef _DEBUG
afxDump << "File could not be opened " << e.m_cause << "\n";
#endif
}
f.Write(buf, 50000);
The
char buf[50001];
is really bad. I had char buf[501]; and that wasnt big enough for a
1-page file. So I made it bigger. Is there a way to read in exactly
enough and to make the buffer the exact size? Also, what happens if
I read in a 10-page RTF file? How big can a buffer get?
Please, any response you can give me will be greatly appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
|
I know I can use:
cfFile.GetLength();
How can I not use a buffer and instead use something else like
a CString?
|
|
|
|