|
See Mike's article on Introduction to COM[^] it is specified "Definitions of the Basic Elements" section inside the article
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Pattern
|
|
|
|
|
I have installed Visual Studio 2005 and Internet Explrer 7.
I have created a Simple Dialog based MFC application.
For adding a control variable, i have used it's wizard.
Suddenly the dialog popped up and warned me that, "Error in the script" do you want to continue?" at teh top of wizard dialog, security warning appeared in Yellow Color. "I right cliked and allowed the ActiveX control to run". after a minute. the visual studio 2005 crashed and restarted
|
|
|
|
|
vs2005 in itself doesn't have any problem. may be IE7 induced problem.
Vipin
http://www.explorewindows.com/Blogs
|
|
|
|
|
Most of VS users working on WindowsXP. It seems same problem will occur for IE 6 on WinXP Sp2
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Pattern
|
|
|
|
|
Hello all,
I have created static text dynamically on a dialog box. But it is displaying in different font. How to change the font to normal static text. Thanks in advance
Regards,
Aj
|
|
|
|
|
First change the id of the static control from IDC_STATIC to some thing else say IDC_STATIC_NAME.
Then call GetDlgItem( IDC_STATIC_NAME)->SetFont(.. ) to change the font.
nave
|
|
|
|
|
You can use GetFont and SetFont for getting and setting fonts.
normally the child controls shows the font you have specfied in resource file. i.e. Dialog's font.
|
|
|
|
|
You can use like this m_YourControl.SetFont(GetFont()); or you can use CreateFont
|
|
|
|
|
If you are programming in plain win32, you will have to send a WM_SETFONT to the control to change the font.
Vipin
http://www.explorewindows.com/Blogs
|
|
|
|
|
I show an example of this in the Extras section of this article.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
I'm getting the following error
error C2664: 'PtrToInt' : cannot convert parameter 1 from 'size_t' to 'const void *'
at the line
sDirectory.assign(pszPath, PtrToInt((pCurrent-pszPath)/sizeof(TCHAR)));
The definition PtrToInt is present in the file basetsd.h as
#define PtrToInt( p ) ((INT)(INT_PTR) (p) )
where pCurrent and pszPath are both of type LPCTSTR. Any reason why is it so.
|
|
|
|
|
tom groezer wrote: pCurrent-pszPath
what are these values? seems you are caught with this.
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Pattern
|
|
|
|
|
Dividing by a size_t ( from sizeof ) is probably turning the pointer into a size_t. At least, that's my guess. Try
sDirectory.assign(pszPath, PtrToInt((TCHAR*)((pCurrent-pszPath)/sizeof(TCHAR))));
Christian Graus - Microsoft MVP - C++
Metal Musings - Rex and my new metal blog
|
|
|
|
|
The second parameter of assign() is the number of characters to copy to the string, so all you need to do is pCurrent-pszPath . Pointer subtraction using pointers to T returns their difference as multiples of sizeof(T) , so dividing by sizeof(TCHAR) is wrong. (Assuming pCurrent and pszPath are TCHAR* of course.)
--Mike--
Visual C++ MVP
LINKS~! Ericahist | PimpFish | CP SearchBar v3.0 | C++ Forum FAQ
|
|
|
|
|
Thanks for the input. The same is working on win32 platform.
|
|
|
|
|
I declared an int variable to an edit box.when i am trying to enter
-ve value it prompts that "please enter an integer".it is not allowing me to enter -ve sign.how can i prevent this prompt msg.
E-Ramu
|
|
|
|
|
You might have set range from 0-MAXINT
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Pattern
|
|
|
|
|
i didn't set any range and i didn't set the number proprty in the edit box properties as true
-- modified at 2:15 Wednesday 2nd August, 2006
E-Ramu
|
|
|
|
|
I am not sure but i think u cannot enter a -ve valu in a edit box whcih have number value set.
Another way is that derive class from the CEit and make that class as the member variable of the edit control. Overide the WM_CHAR message. This message will come when user enters a character into the edit box.
In that funtion check the character entered. Call the Base class( CEdit 's ) funtion only if it is a permitted character.
nave
|
|
|
|
|
Ramu.e wrote: I declared an int variable to an edit box.
Why? You need to use a CEdit variable for edit controls.
"Money talks. When my money starts to talk, I get a bill to shut it up." - Frank
"Judge not by the eye but by the heart." - Native American Proverb
|
|
|
|
|
Hi all,
OK, so yesterday some of you helped me with the the function LogonUser(). Thanx. But i'm struggling my but off with the last parameter. The thing is the last parameter is a Token, and I have no idea how to get this token a value. I have read all the documentation there is, but I would like a example. Plz someone help.
Thanx
Regards
Programm3r
|
|
|
|
|
It's an out variable, which means you need no pass any values for it. You will get a pointer to a to a token that represents the specified user.
You can pass like
HANDLE hUser = NULL;
LogonUser(....,...,&hUser)
SaRath.
"Where I am from, there is no plan B. So, take advantage of today becuase tomorrow is not promised. - 50 Cent"
My Blog | Understanding State Pattern
|
|
|
|
|
The last onr is an out parameter. I.e that varaible returnds some value from the function..
eg..
HANDLE hToken = 0;
LogonUser( ..., &htoken );
nave
|
|
|
|
|
|
Hi, everybody. I'm a little stuck. I have no experience with DLL's and I'm trying to make something with'em.
I'm programming a dll (that calls a windows dll) wich contains the functions I want to use in my app. It compiles fine. But when I build my program that uses my dll, I get the next linking stage error:
MyProgram.obj : error LNK2001: unresolved external symbol "public: unsigned short __thiscall CMyProgramApp::OpenFile(class CString)" (?OpenFile@MyProgramApp@@QAEGVCString@@@Z)
Little help?
Znx.
Did you checked your TCP/IP settings? Enabled cookies? D'you want this dog?
|
|
|
|