|
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
|
|
|
|
|
dr.nokia wrote: just i need to pass args to the main function...
Then you're gonna need to change its signature to:
main( int argc, char *argv[] )
"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
|
|
|
|
|
ok! i changed the signature but the output only "Child process completed")
|
|
|
|
|
by the way : if(removed =1) it's if (background=1)
|
|
|
|
|
Until you have a firmer grasp of functions, pointers, arrays, etc, you'd be better served by simplifying your code down to something like:
void main( void )
{
execvp("ls", "- 1");
printf("Child process completed\n");
} Once you get that working, then you can start using scanf() to replace the string literals.
"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
|
|
|
|
|
The statement args = &inputBuffer; in the setup() function, does not change the args variable in main() . Also you have not split the input buffer into its separate components. I would spend some time parsing your input to ensure it's in the correct format before worrying about using the fork() and execvp() functions.
|
|
|
|
|
I did that it works fine but like execvp("ls",args);
not like your code execvp("ls","-1");
it's work perfect and execute the all ls command
but it's possible to put any command I prefer? for example ps -el or any another shell command for Linux O.S?
|
|
|
|
|
dr.nokia wrote: not like your code execvp("ls","-1");
I didn't post any code
dr.nokia wrote: but it's possible to put any command I prefer?
It's some while since I did this, or used Linux, but in theory I think you can put any command into the exec() functions. The key as always is getting your parameters organised correctly according to the version of the exec() call that you are making.
As I said before, I think the important thing is to get comfortable with parsing strings and using function calls and their parameters correctly. Once you have your head round those concepts then the second half is easy.
|
|
|
|
|
you mean to check my command then invoke it to execvp() ?
|
|
|
|