|
Gosh!!
Next time remember me to write the name of the function like this "Left" and not like this "left".
I´m really ashamed...
|
|
|
|
|
i have 2 errors to your code :
1)error C2661: 'GetWindowTextA' : no overloaded function takes 0 parameters
2)error C2664: 'strcmp' : cannot convert parameter 1 from 'char' to 'const char *'
what is wrong ?
Bravoone
|
|
|
|
|
all i want is to enter only numbers that have 4 first number for example 48956687 the first number is 4 !!!!!!
Thank you !
Bravoone
|
|
|
|
|
Nope nothing,nothing is working i don t know what to do !
The first number in the string must be 4 !
this is a serious problem i dont expect to be so hard !
Bravoone
|
|
|
|
|
If you want to let the user only enter the number's that start with 4 you would need to override the EN_CHANGE notification. When the user hits anything except a 4 for the first time just discard the value else continue.
I hope I do get you correctly now and this helps you.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
void CBravooneTest::OnEnChangeEdit1()
{
CString str;
if(((CEdit*)GetDlgItem (IDC_EDIT1))->GetWindowTextLength()>0){
((CEdit*)GetDlgItem(IDC_EDIT1))->GetWindowText (str);
if(str.GetAt(0)!='4')
((CEdit*)GetDlgItem(IDC_EDIT1))->SetWindowText("");
}
}
See if this is what you need.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Hi Bravoone,
I have a hardware question do you know about DVD players?
|
|
|
|
|
the "Compare" function returns 0 (!!!) if the two strings are EQUAL, like strcmp(...)
|
|
|
|
|
Hi All,
I have created my own Regular Dll using MFC. I want to import it into C# project. Can anyone please tell me how to do that. Thanks in Advance.
Anurag Gandhi.
|
|
|
|
|
For use of a dll on the C# you can use like this for example
[DllImport("user32.dll")]
public static extern int SendMessage(
IntPtr hWnd,
int Msg,
IntPtr wParam,
IntPtr lParam);
I dont know it was helpful for you?
|
|
|
|
|
Hello
I want to find a method to get the string width. When I surf internet, I find the function GetTextExtent() is available to get string width. I try it in my program use MFC based on SmartDevice(Wince), but the function is not supported in MFC.
Someone can kindly tell me which function is available to get the string width.
Thanks a lot.
Any suggestion is useful!! Thanks!!
|
|
|
|
|
sdhtyjnniutnbjnhbghb wrote: but the function is not supported in MFC.
It is supported on WinCE. Or do you mean something else ?
Prasad
MS MVP - VC++
|
|
|
|
|
That function is part of the SDK (C code) and is supported. What exactly do you mean by string width? I am assuming the width in pixels. If so then say so, but you will probably get directed to the same function.
By the way, regardless of what the MS documentations says the string output functions are not limited to 8192 characters. The limit is dependant on the number of pixels required to draw the string (the width).
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
I am sorry for using the function in wrong way.
I want to paint string in AP and also to limit the range.
When I use the CString:: GetLength, I find it lsn't a good way to do it.
So I try to find a method to get the string width.
I use the GetTextExtent(string, string.getLength()) a moment ago and return CSzie.
I don't sure the CSize.cx value is pixels or not.
If it's true, maybe I can use the CSize.cx to limit the string number to paint in AP.
But are there more simple methods to do it??
Thanks a lot.
Any suggestion is useful!! Thanks!!
|
|
|
|
|
I am still not sure what you are asking, but ‘CSize.cx’ would be the width of the string in pixels. As far as I know there is no simpler method, although there are more complicated methods.
You can use the ‘GetTextExtent’ to determine the area you want to invalidate for drawing purposes, but I do not know what you mean by “limit the string number”.
‘GetLength’ returns the number of characters, provided it is not in Chinese or some other multi-byte language. That is if you are not using Unicode as the character type.
It has been a while but I have used ‘GetTextExtent’ and a few other methods while developing, for text editing and graphics string placement.
INTP
"Program testing can be used to show the presence of bugs, but never to show their absence."Edsger Dijkstra
|
|
|
|
|
Because I will draw the string in the AP and the width is 251 in logical coordinates. If the string size are more than the width, I will add "..." to reply the words beyond the width. For example, if the string is "ABCDEFGHIJK" and I suppose that it is beyond the width, so I will show "ABCDEF..." in my AP.
I will try to use ‘GetTextExtent’ to get the string pixels and will to find transfer it in logical coordinates. I think it should be a good way to solve it.
Thanks a lot for your help.
Any suggestion is useful!! Thanks!!
|
|
|
|
|
What API are you using to paint the string? Maybe using one that clips the string will work...
Also, if supported, see GetTextExtentExPoint() which "retrieves the number of characters in a
specified string that will fit within a specified space..."
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Dear all
i just created a simple project using vc++ 2005 express edition, but after i built this project, one issue occurred. output showed :"cl : Command line error D8016 : '/MT' and '/clr' command-line options are incompatible". so what happened?
second issue: when i add one item: windows form. pc showed me:you are adding a CLR component to a native project.your project will be converted to have common project language runtime support. so what happened? thanks a lot.
i am looking forward to your news.
Li Zhiyuan
5/10/2006
|
|
|
|
|
If you want to use the .NET framework in your C++ app then you'll need to create a managed
assembly.
If you want a native Win32 application then you won't be able to use any CLR/.NET/managed code.
Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
|
|
|
|
|
Dear all
i just created a simple project using vc++ 2005 express edition, but after i built this project, one issue occurred. output showed :"cl : Command line error D8016 : '/MT' and '/clr' command-line options are incompatible". so what happened?
second issue: when i add one item: windows form. pc showed me:you are adding a CLR component to a native project.your project will be converted to have common project language runtime support. so what happened? thanks a lot.
i am looking forward to your news.
Li Zhiyuan
5/10/2006
|
|
|
|
|
I have a DATE type variable and i am trying to display the date and time stored in it but i am not able to succeed. can anyone give me any suggestions? The date I am trying to display is in the form of FILETIME. Thanks in advance.
Regards,
Vijay.
God may not give us what we 'want', but he surely gives us what we 'need'.
|
|
|
|
|
Try FileTimeToSystemTime function.
|
|
|
|
|
Thanks. i had the problem solved immediately after i posted the question here.
fd0129002 wrote: Try FileTimeToSystemTime function.
yes, I used the same function. Thanks anyways.
Regards,
Vijay.
God may not give us what we 'want', but he surely gives us what we 'need'.
|
|
|
|
|
hi,
You can also use (in VC++, at least):
CTime time = CTime::GetCurrentTime ();
CString szEditTime = time.Format ( "%A, %d.%B.%Y, %H:%M:%S" );
Greetings.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
|
|
|
|
|
hi i have to get the user login path ie c:\documents and settings\allusers in a system. how to do this
Arise Awake Stop Not Till ur Goal is Reached.
|
|
|
|