winforms - How to mix c and c++ form application in the same project? -
winforms - How to mix c and c++ form application in the same project? -
guys, i'm sorry bad english.
i want programme c programme c++ form application using in same project.
for example:
when clicked button send entered text c program. entered text within textbox in c++ form app.
c programme save text computer file operations.
so example:
textbox1="hello world" button=clicked string^ message = textbox->text; writerfunction(message); void writerfunction(char m[50]) { file *fp; fp = fopen("text.txt","a"); fprintf(fp,"%s",m); fclose(fp); }
it looks using c++ .net (managed c++) i'm guessing pointer operator. in standard c++ utilize '*' instead of '^'. please right if i'm wrong there.
two options.
you using managed c++ can phone call win32 api create work harder. if still intrested please check link. started. http://www.codeproject.com/articles/9714/win-api-c-to-netbut i'd suggest utilize c++ .net approach save string in file. google find many examples you. 1 start:
http://msdn.microsoft.com/en-us/library/19czdak8.aspx
if want utilize old style c++ can mix c , c++ without problems. need import libs project. libraries:c - stdio.h examples here (http://en.m.wikipedia.org/wiki/c_file_input/output)
c++ -ofstream: stream class write on files
-ifstream: stream class read files
-fstream: stream class both read , write from/to files.
more details here: http://www.cplusplus.com/doc/tutorial/files/
windows api - can utilize win32 api importing header windows.h
few examples here (http://www.daniweb.com/software-development/c/threads/31282/windows-api-functions-to-read-and-write-files-in-c)
good luck. if need more info please allow me know.
c winforms visual-c++
Comments
Post a Comment