|
sonualex wrote: can u plz mention where exaclty i have to add these changes for making this work..
You call SetWindowText() wherever you want the contents of the edit control changed.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
thanks david for ur help...
SetLimitText is giving an assertion failure once i keep it in OnInitDialog()...
SetWindowText and GetwindowText as per my understanding should be kept where we change the text in edit box.. as i told earlier i have not created any function for editbox...
my understanding is the text we enter in editbox is
m_sedit1 = _T("") which is in
CNoteDlg::CNoteDlg(CWnd* pParent /*=NULL*/): CDialog(CNoteDlg::IDD, pParent)
and the ::DoDataExchange(pDx)
DDV_MaxChars(pDX, m_sedit1, 1000);
plz letme knw if im not giving u the correct picture of my code...
hope u wud continue helping me..
thanku so much
|
|
|
|
|
sonualex wrote: SetLimitText is giving an assertion failure once i keep it in OnInitDialog()...
What does the suspect code look like?
sonualex wrote: SetWindowText and GetwindowText as per my understanding should be kept where we change the text in edit box.. as i told earlier i have not created any function for editbox...
I'm not sure what a "function for editbox" is.
sonualex wrote: my understanding is the text we enter in editbox is
m_sedit1 = _T("") which is in
I indicated here that you should use a CEdit object instead.
sonualex wrote: plz letme knw if im not giving u the correct picture of my code...
I know exactly what you are doing, but you have to be willing to implement my suggestions.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi david ...
Iam following ur suggestions truely...thanku so much for ur patience...
Asserion faliure is showing in AFXWIN2.lnl line 881....
Dont know how to solve that...
OnInitDialog is not allowing to keep CEdit m_edit1;
m_edit1.SetLimitText (1000); in it....
What i meant by function is if we click on EN_CHANGE it will ask for add function OnChangeEdit1()..
Presently iam stuck with CEdit SetlimitText,SetWindowText and GetWindowText..
plz bear with me
|
|
|
|
|
sonualex wrote: Iam following ur suggestions truely...thanku so much for ur patience...
Asserion faliure is showing in AFXWIN2.lnl line 881....
Dont know how to solve that...
You should start by looking at line #881 of afxwin2.inl. It is asserting that a valid window handle exists, which obviously does not.
sonualex wrote: OnInitDialog is not allowing to keep CEdit m_edit1;
Are you declaring this variable in OnInitDialog() ?
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
hello david .. im in right track now.. thanks for ur immense support..
now im able to limit the text.. cursor pblm is solved..
but at the same time.. i have been using CString for saving and opening the contents in edit box now how can i do that using CEdit..
hope u remembr my piece of code for OnSave and OnOpen earlier posted ....
|
|
|
|
|
sonualex wrote: ...i have been using CString for saving and opening the contents in edit box now how can i do that using CEdit.
By using SetWindowText() and GetWindowText() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
thanks a lot David... it worked perfectly...
thanku so much...
|
|
|
|
|
hi der David... it worked perfectly...
thanku so much... thanks a ton
|
|
|
|
|
I have written Installation using Visual Studio 2008 Setup project. I have created a GUI for installing specific product (using check box dialog). but I need the same gui for uninstallation also.
Means if unchecked that product should be uninstalled. all other products should remain same. any suggestion how to do it in Visual Studio 2008 setup project.I used only C++ base installation. No .net dependencies.
|
|
|
|
|
Hi,
I have been using DDX_CONTROL to Attach My Cricheditctrl to my resource multiline edit control
For some reason this stops the CRichedit.Streamin from working
With ::Create no problem
Was wondering if anybody had any insights
As I always like to know the reason why things work or Don't
thankx...
|
|
|
|
|
Please explain what you mean by "stops from working". Does it crash, does it stop on an assert, does it simply not load the content? How and where did you try to use it?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
The content doesn't load
Maybe the FrameWork expects me to use DDX
to read and write data after connecting the
resource item to the CRichEditctrl object don't
know
but If I do CRichedictrlptr *CRicheditrl =
CDialog.GetDlgItem(IDC_RICHEDIT)
I able to populate the Richedit using the
Streamin method
|
|
|
|
|
ForNow wrote: Maybe the FrameWork expects me to use DDX
to read and write data after connecting the
resource item to the CRichEditctrl object
I highly doubt that.
Could it be that maybe you are trying to load that content before DoDataExchange runned?
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
I have a call to the Default
CDialog::DoDataexchange
In my overridable version
Not sure what that does I'll comment that out
and See what happens
Thankx
|
|
|
|
|
I believe you misunderstod something.
> The problem with computers is that they do what you tell them to do and not what you want them to do. <
> Sometimes you just have to hate coding to do it well. <
|
|
|
|
|
The streamin method should work after DDX_CONTROL
I have to have a closer look at my Code
at this point I am thinking that I dont have to Call UpdateData as that is
Done automatically by the default CDialog::Oninitdialog
Which I have in my OnInitdialog
I'll take a closer look
thankx
|
|
|
|
|
I need to get OS info,
1. name: i.e. Windows XP, WinNT 4 etc.
2. edition: i.e. Server, professional, standard etc.
The info should start from Win98 (or Win2K) and up to latest one.
- is the latest one Windows 7 now?
I have C code to show up to XP, do you have code for new OS?
|
|
|
|
|
Use the GetVersionEx[^] API to get the version of the running OS.
Look into the remarks section of the documentation for OSVERSIONINFOEX[^] for the list of OS codes.
|
|
|
|
|
Hi all,
I have a problem in implementing tree traversal using c++, i want to display the output of tree traversal: inorder, preorder, postorder in tree form, this means i should include some graphic codes so as to display the tree format on the screen. I don't have idea how to use graphics to display the output on the screen.
Please help me
|
|
|
|
|
See here.
I've also seen implementations where the tree was laying on its side. It's a recursive approach.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
First you need to learn how to draw lines on the screen. If you're using MFC, look at OnDraw and the CDC class. Then you can look at writing text if you need to do that.
For arranging the binary tree on the screen, a good approach is to space the leaf nodes out evenly horizontally. Then each parent node goes halfway between its sons, on the row above.
|
|
|
|
|
Hi guys ,
I've problem with C in Linux, and just i need to pass args to execvp(args[0],args) to the main function and after creating child process and the code is :
#include <stdio.h>
#include <string.h>
#include <signal.h>
#include <stdlib.h>
#include <sys/wait.h>
#include <sys/types.h>
#include <unistd.h>
#define MAX_LINE 80
void setup(char inputBuffer[],char *args[],int *background)
{
int i;
int cmd=0;
int l;
scanf("%s",inputBuffer);
if("%d",strlen(inputBuffer)>80)
{
printf("error the maximum size is 80\n");
exit(-1);
}
else
{
args = &inputBuffer;
}
}
int main(void)
{
char inputBuffer[MAX_LINE];
int background =0;
char *args[MAX_LINE/2+1];
char *command;
while(1)
{
background=0;
printf("Command ->");
setup(inputBuffer,args,&background);
pid_t pChild;
pChild = fork();
if(pChild <0){
printf("Error\n");
exit(-1);
}
if(pChild==0)
{
execvp(args[0],args);
}
else {
if(background=1);
wait(NULL);
printf("Child process completed\n");
}
exit(0);
}
}
|
|
|
|
|
So what's the problem?
dr.nokia wrote: if("%d",strlen(inputBuffer)>80)
What's this?
dr.nokia wrote: if(removed=1);
Your compiler should at least be warning you about this, if not outright complaining.
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Im trying to update the args to pass into main function to (execvp) and run the command for example
ls - 1
or sh> cat pro.c
just i need to pass args to the main function to execute the command
|
|
|
|