|
|
Hi all,
I have a crash dump which point to the following function :
string.erase()
does someone has any clue what could be the reason ?
I thought it a safe function , which is very straight forward to use
Thanks
|
|
|
|
|
hey guy, do you think you can help me if i give you such a line of code, just looking normal ?
give us the error/exception message and the context this line of code is called (provide a piece of the code around it - but not the entiere file !!!)
moreover, tell which string class you are using (CString, std::string, or any else...)
TOXCCT >>> GEII power [toxcct][VisualCalc 2.20] | soon : [VisualCalc 3.0]
|
|
|
|
|
|
Hello Sir,
in my application i have to interact with C from my VC++ GUI,i have to set intials to variables in C from VC++, and control the C program from GUI like compiling, sending intial values, read data, and output should again send to VC++.
How can link these two.
Thanking you.
sheshidar patnam
|
|
|
|
|
I dont understand what u what to do might be ur talking somthing about
IPC (inter process communication )
But if u mean to get some data from other exe file in vc++
then u can create a file and then store the data and retrive
the data from the file
something like Dll can also help u but not sure as i could not get ur question .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I am sorry that u couldn't understnad my question,
my question is i have some programs written C, and i have one GUI developd in VC, now i have to control C programs with GUI, like start c execution, assigning intial values to it.
|
|
|
|
|
How would you assign initial values to your C executable without the GUI. For example, does your C executable use command line parameters or an input file? Those two things would be very straight forward to do from your GUI app.
|
|
|
|
|
Normally, what you have to do is to modify the .h-files for the C-sources
Before the first function prototype add this:
<br />
#ifdef __cplusplus<br />
extern "C" {<br />
#endif<br />
After the last function prototype, add this:
<br />
#ifdef __cplusplus<br />
}<br />
#endif<br />
Now you can call the C-functions from your C++-source.
Kakan
|
|
|
|
|
Hi Kakan,
thx for ur message,
i did as you said, and now i have another question,
i want to retrieve a string from C code into editbox,
i added the code to header files as you said, now how i have to initialise string to editbox,
for instance mamber variable of edit box is m_strEdit1,
and a function in c code returns the string "Hello", so how can i bring this string into editbox in vc.
thanking you.
|
|
|
|
|
Hello.
It's really very easy.
The C program returns a char* or a const char*.
Simply put it in m_strEdit1, and thats it!
But, there is an issue with MFC (and/or Windows): The editbox won't change it's value!
You have to call ::UpdateData(TRUE or FALSE), I never remember which, check the documentation. Then, you will see the newly assigned value in your editbox.
So do this (I assume the C string is in (char *) C_value):
m_strEdit1 = C_value;
UpdateData(TRUE or FALSE);
And that's it.
Good luck.
Kakan
|
|
|
|
|
Thx Kakan,
i have some questions,
ok i will explain what i need,
i developed one GUI in VC++, and there are microcontroller hardware progams written in Keil(is like C)for a microcontroller. now i have to select data from GUI and assign them to keil programs and retrieve data from keil and send it back to GUI, and again i have to send some other information to keil from GUI.
and for this do i need to write path to communiucate with other programs.
how to call the keil(C) programs in GUI and how to send and receive data from there.
|
|
|
|
|
Hello.
The question about how to execute other programs is very frequent at CP.
One way is to use ShellExecute, but there is others as well.
When it comes to communication, frankly, I don't know.
How does the Keil-program interface with the outer world?
stdin/stdout or another way?
If it uses stdin/stdout, you *might* be able to use the old C-function popen(). Check it out.
But I'm not sure if popen still exist.
Kakan.
|
|
|
|
|
Hi kakan,
thx for ur message,
and keil is similar to C.
And one old report i found that they used printf and scanf to send and receive from VC++.
|
|
|
|
|
Hello shesidar. It seems as if we live in different time zones...
The keil-program is the key here. I can think of two different scenarios, with two different solutions.
Scenario 1:
You start the Keil-program for every message to it. You give it the input via the command line. The Keil-program returns it's output to sidout and terminates itself.
For example:
<br />
C:\>Keil_program Status<br />
Status=2<br />
C:\><br />
Scenario 2:
You start the Keil-program. It reads it's input from stdin and responds to stdout. Then it awaits your next command.
For example:
<br />
C:\>Keil_program<br />
Status<br />
Status=2<br />
Exit<br />
Exiting...<br />
C:\><br />
Do you see the difference?
For scenario1, you can create a command line and redirect the output to a (temporary) text file. (Then you read the text file from your VC-program, and display it's result).
Example:
<br />
Keil_program Status >C:\tmp\output.txt<br />
Then read the file C:\tmp\output.txt and display it's content.
For scenario 2:
Have a look at the documentation of the _popen-function.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vclib/html/_crt__popen.2c_._wpopen.asp[^]
Kakan
|
|
|
|
|
Hi Kakan,
Thx for ur message, but i am confused with how to call keil from VC, and how to send data from Keil to vc, i didnot understand your previous message.
Please donot mind, should i add any libraries in VC to communicate with kiel?
Thanking you,
sheshidar patnam
|
|
|
|
|
Hello.
I have taken for granted that the Keil program runs as a separate program in a DOS-box/command-prompt and you want to interact with it as such.
If you want to include the Keil-program INTO your Windows-program, then I don't know how to do it. You will have to read the manual(s) for Kiel, it should say something about how to do it.
Now, I will go on leave and I won't be back until the 2:nd of January 2006.
Maybe I will check out CP from time to time. But not on a regular basis, that's for sure.
Merry Christmas and Happy New Year to you.
Good luck.
Kakan
|
|
|
|
|
Thx , kakan,
and i wish you for merry christmass and happy new year, enjoy the events.. have a nice time.
bye.
sheshidar patnam
|
|
|
|
|
Dear Experts,
I need some information on dynamic updation of XML file.
Our application asks the user to insert a file by giving the user browsing option.
We want our XML file (which contains the information about the residing files) to be dynamically updated as soon user specifies the path of the inserted file.
The next task is to dynamically update the XML file once the user select the file to be deleted by clicking on the Application UI.
We have to develop the code in C++.
Kindly send across your suggestion, opinion and helpful codes.
Regards,
Mayank Srivastava
|
|
|
|
|
srimayank11_codeproject wrote: We have to develop the code in C++.
you don't need to develop/write any code, here this class will help :-
http://www.codeproject.com/soap/markupclass.asp[^]
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers,
Alok Gupta
VC Forum Q&A :- I/ IV
|
|
|
|
|
Dear sir,
i connect vritual com3 to com4.
i am writing one prgram for sending data to com port3 .and want to read at com port 4.i am able to write data from com3. but i am not able to read it at COM port 4
where is the problem
|
|
|
|
|
You can first test the port by connecting the com ports externally, then use HyperTerminal to test the connection. Run Hyperterminal twice, one for each port, and communicate between them; if it runs ok, then run your program on one end at a time, and communicate with HyperTerminal; that way you can find where the error is.
this is this.
|
|
|
|
|
I havent tried with the virtual ports
but it seens that the Hyperterminal solution is
good one to try .
Vikas Amin
Embin Technology
Bombay
vikas.amin@embin.com
|
|
|
|
|
I have grayed the dialog’s X button in traditional way by using pMenu->EnableMenuItem(SC_CLOSE, MF_BYCOMMAND | MF_GRAYED). The problem starts when I have two dialogs open at the same time. Normally if a dialog loses focus, the X button becomes dim. But if a dialog with grayed X button loses focus, the X button becomes red. It’s not as bright red as the unmodified X button, but certainly it doesn’t look dimmed. So every time when I’ve got two dialogs open the one with the focus will have dimmed X button and the unfocused dialog will have redder X button. How could I fix this?
|
|
|
|
|
Dear friends,
There are two object oriented languages. C++ and java.
which object oriented language is best and why. give me a
reply.
Regards
kedar
|
|
|
|