|
What do you need to know?
|
|
|
|
|
Application type? does these system that you try to run your program has same OS ?
|
|
|
|
|
The app is made with MFC Wizard and the OS where I have developed it is XP. The costumer computer has 2000 OS.
|
|
|
|
|
Since you're not getting the "missing DLL" error anymore, there must be something else that is missing (or not being initialized). Two obvious things to look at are external data files and registry settings. Are all of these present on the second computer?
Also, things might be in different locations on the second computer - check if there are any hard-coded paths in the program.
Unfortunately, it sounds like there is some code that is not checking for errors (e.g., missing resources). The next step would be to look at all the code that is trying to read the registry (or a file) and make sure it is logging something if an error occurs.
If everything else fails, you might have to strip down the program to a bare minimum, and then start adding stuff back in until you find what is failing.
|
|
|
|
|
The program uses Log files, that I took to the second computer too. It also uses config files that are in the second computer, both are in the same path.
I will do what you´ve told about stripping the program. It´s a good idea. Thanks for all.
|
|
|
|
|
|
How can alow the user to enter only numbers lets say with "4" into CEditBox ! for ex: 41,42,411,42222 !!!!!!
i have tried this :
CString sCod;
m_cod.GetWindowText(sCod);
if(!sCod.Left(1).Compare("4"))
{
//something
}
else
{
AfxMessageBox("Incorect number");
}
but is not working !
please help me !
Bravoone
|
|
|
|
|
In the dialog editor right click the edit box and check the Number property to true.
Somethings seem HARD to do, until we know how to do them.
_AnShUmAn_
|
|
|
|
|
Assign an integer variable to edit box.(See DDX_ )
And Use UpdateData accordingly.
Prasad
MS MVP - VC++
|
|
|
|
|
Use Dialog Data Exchange or Validate. This will not allow the user to enter anything other than number.
int iCod;
void CYourClassName::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
DDX_Text(pDX, IDC_EDIT, iCod);
DDV_MinMaxInt(pDX, iCod, 0, 1000); //Third and fourth parameter is min and max value.
}
Hope this will work.
Anurag Gandhi.
|
|
|
|
|
you can try the _ttoi function to determine if the string is actually an integer. The function will return 0 if the string cannot be parsed as integer. So you should also check if user actually entered 0 in the CEditBox . "What if user enters something like 0000 ?" question still remains, but this is better than nothing
int val = _ttoi(sCod);
if (val == 0 && sCod != _T("0"))
{
AfxMessageBox(_T("Incorrect number"));
}
|
|
|
|
|
First of all, I haven´t found a Left member inside the CString class
I would do that way:
char sCod[20];
strcpy(sCod,m_cod.GetWindowText());
if (strcmp(sCod[0],"4")==0)
{
//Here write your code
}
else
{
MessageBox("Incorrect number");
}
I hope it may help you!
Good luck from Bilbao! (SPAIN)
|
|
|
|
|
garfield185 wrote: First of all, I haven´t found a Left member inside the CString class
Here[^] it is.
Prasad
MS MVP - VC++
|
|
|
|
|
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++
|
|
|
|