# C++ with Vb.NET



## sourcecode (Oct 15, 2005)

I want to pass parameters from a window application of vb.NET to a c++ code. How can I do this??


----------



## RCuber (Oct 15, 2005)

What exactly is u r requirement? if u can tell me than maybe i can answer you

Charan


----------



## sakumar79 (Oct 15, 2005)

You want to call c++ code that has been compiled into .exe right? Also, I am assuming that you are doing this by using a system call to run the executable... If so, u can simply include the parameters to the command to be executed and use the argument string of the main function in C++ to retrieve the parameters. 

Arun


----------



## sourcecode (Oct 15, 2005)

sakumar79 said:
			
		

> You want to call c++ code that has been compiled into .exe right? Also, I am assuming that you are doing this by using a system call to run the executable... If so, u can simply include the parameters to the command to be executed and use the argument string of the main function in C++ to retrieve the parameters.
> 
> Arun



what u assumed is true Bt I cudnt get it   
cud u plz elaborate...

Actually my C++ code askes for the values after its exetution (at runtime) that values are to be taken from the vb form


----------



## sakumar79 (Oct 15, 2005)

Is the C++ program started after the values in the VB form are available or before? If after, you can pass the values in the form as command line parameters (<execute> <prg name> <parameter list>) where <execute> indicates VB command for running a command, <prg name> indicates the C++ program to be run and <parameter list> indicates list of parameters that the program has to process...

If the C++ program will already be running, you may need to do some system level raising of events at the VB side and monitoring of events on the C++ side. Try googling for info on these... The only way that I can think of to pass data in this case would be to use a data file initialized which would be where VB would write and C++ would read.

Arun


----------



## sourcecode (Oct 15, 2005)

what is the execution command in vb?do i need to add the cpp file in the project or can execute it independantly?


----------



## The Incredible (Oct 15, 2005)

Dont mind but wat r these?

parameters

command line parameters

Vb.NET

system call

compiled into .exe


----------



## sakumar79 (Oct 15, 2005)

sourcecode said:
			
		

> what is the execution command in vb?do i need to add the cpp file in the project or can execute it independantly?



Refer *www.devx.com/dotnet/Article/7914 for information on running external programs. You dont need to add the cpp file into the project.

Arun


----------



## sakumar79 (Oct 15, 2005)

The Incredible said:
			
		

> Dont mind but wat r these?
> 
> parameters
> 
> ...



Parameters - data passed onto a function within a program that is taken as the input data. For example, in a function to calculate the square of a number n, n will be the parameter passed to the function...

Command line parameters - data passed onto a command such as those executed at the dos prompt. For example, in "copy a:\*.* c:\ ", the command is copy which takes two command line parameters a:\*.* (source) and c:\ (destination). 

VB.NET - Visual Basic.NET is a programming language

compiled into .exe - Program is written in high-level language that is understood by humans. Then, it is compiled by an assembler into binary language understood by the computer. For MS-based systems, typically compiling will result in a .exe file creation.


Arun


----------



## sourcecode (Oct 15, 2005)

thanx sakumar the link was of gr8 help


----------



## The Incredible (Oct 15, 2005)

sakumar79 said:
			
		

> compiled into .exe - Program is written in high-level language that is understood by humans. Then, it is compiled by an assembler into binary language understood by the computer. For MS-based systems, typically compiling will result in a .exe file creation.
> 
> 
> Arun



Hey Arun thanks for the info. u know to get such info here is a bit tough as most of ppl dont reply and say to GOOGLE but usually v want in a language which sum ppl who hav a bit bad english. also when ppl answer themseles they giv sum exmaples just like u.

Its very nice to see a person like u over here.


BTW as u said for MS-based systems there r sum programs to convert our language to binary lang of computer. so do u know of a software which does da opposite means converts binary language to our language.

i've sum .chk files created by scandisk n cant read 'em as they are in binary language perhaps. help needed.


----------



## sakumar79 (Oct 16, 2005)

The Incredible said:
			
		

> BTW as u said for MS-based systems there r sum programs to convert our language to binary lang of computer. so do u know of a software which does da opposite means converts binary language to our language.
> 
> i've sum .chk files created by scandisk n cant read 'em as they are in binary language perhaps. help needed.



Since any program is written in one of many possible languages, you will need to know the right decompiler for the program... Not sure if all languages have decompilers and if they do, how good they are since I have not used any...

For .chk files, you can try CHK-mate at *www.diydatarecovery.nl/chkmate.htm

Arun


----------



## puja399 (Oct 16, 2005)

The Incredible said:
			
		

> sakumar79 said:
> 
> 
> 
> ...



Then I guess u need to learn reversing.


----------



## The Incredible (Oct 16, 2005)

puja399 said:
			
		

> Then I guess u need to learn reversing.



I'm only 15 and I think it is da age of learning only. So, I want to learn. Teach ME.


----------



## puja399 (Oct 16, 2005)

The Incredible said:
			
		

> puja399 said:
> 
> 
> 
> ...



U can start by learning Windows API Programming in C/C++ (Use VC++) and then Win32 assembly language programming. U can find plenty of excellent free tutorials in the net, just use google.


----------



## The Incredible (Oct 16, 2005)

puja399 said:
			
		

> U can start by learning Windows API Programming in C/C++ (Use VC++) and then Win32 assembly language programming.



can u giv sum details.

also wat did u mt by saying in C/C++ n then visual C++. i think C++ and visual C++ are different things


----------



## puja399 (Oct 16, 2005)

U can program with WinAPI using any other 32 bit C++ compilers too (for Win platform of course), like Dev-C++ or GNU C++. But I recommend VC++ becuz of the intellisense support, good documentation and plenty of available books in the market, built-in MFC and ATL support, etc. Also the IDE for VC++ is the best u can get right now. Dev-C++ etc. are free though. 

C++ is the language and VC++ is the mammoth tool itself that supports C++. It is THE TOOL people are using all over the world for any serious programming. (However, nowadays, VB is also being used for some serious programming, but the underlying mechanism is still from C++).

BTW, what C++ compiler ru using now? I hope its not TC++.


----------



## The Incredible (Oct 18, 2005)

puja399 said:
			
		

> BTW, what C++ compiler ru using now? I hope its not TC++.



Yes......   Me is usin Turbo C++, why, anything wrong there???

Plz reply soon or i'll die worrying. Plz


----------



## puja399 (Oct 18, 2005)

Well...let me put it this way.....I have a computer in my home, its AMD athlon 64 3200+ with 1 GB RAM, and 200 GB SATA HDD. My video card is nVidia 6600GT, and I am running WinXP SP2. I use softwares like Photoshop CS2 and Visual Studio. But whenever I wish to view what files I have in a directory, I go to command prompt, cd\ to the desired directory and run a 'dir' command. And, thats not all, when I write any letter or something, I use the good old 'Edit' from the MS-DOS era. 

Perhaps u r thinking, 'What a nutcase!!!', still using dir to view files and 'edit' for text editing? What wont use windows explorer, or use MS-Word!!! There must be something wrong with this person!!!!!


Yes, everything is wrong with using tc++. I don't know where u live, what school u read in, or what computer u use. But I am pretty certain that u dont use any computer older than Pentium-I, and any OS older than Windows 95/98. So, if u still use TC++, I  would say there is something seriously wrong there. I would suggest that u drop the dead donkey and move along with the tide, unless of course, if u r not forced to learn it.  WHY? There are reasons...

First of all, TC++ is not fully compliant with the modern C++ standard. Its an old compiler, at least 10 years old, and not supported anymore. (Its developer 'Borland' now makes 'Delphi', not Turbo C++). C++ has evolved a lot since then. For example, TC++ doesn't support templates which is the life-blood of modern C++. It doesn't support structured exception handling. It doesn't support many other things that r very important. If u learn C++ with TC++, be sure that u have to relearn everything.

Second, its a 16 bit compiler. Why on earth would u use a 16 bit complier when everything is 32 bit and going on to 64 bit!!!Would u crawl if u can run? TC++ was released for MS-DOS, not for Windows, and certainly not for WinXP. 

Third, u can't use tc++ to program for windows. u can use it only to make some small programs that runs in a dosbox.
Other that writing some toy programs for showing off to ur friends or parents, its good for nothing, u cant use it to write any serious program. Learning computer programming, especially C++ is a serious task, too much time, labour, mindpower is required. Don't waste any of if on an obsolate system. TC++ has lived its life a long ago, served its purpose, and did it gracefully, it was a compiler of its class but it was back then. Now, its Visual C++ from microsoft. If u ever want to program for Windows with C++, its the only choice u have. In my opinion, if u decide to learn C++ for windows, learn VC++ or don't learn C++ for windows at all, no matter what others say or do.


----------



## The Incredible (Oct 19, 2005)

I'm really very very shocked.

I never knew that. I thought dat VC++ is just a language as C++. 

The actual problem is that in our school, the computers are really old. They seems to b P1 although i have a much better computer with AMD AthlonXP and WinXP.

Also, in our school, they use TC++ thats why I bought TC++.

Thanks for telling. I cant get what i shud do.

I'm really very much worried.
 

BTW I'm in 9th CBSE.

BTW can u gimme a link to get VC++. Also, are the tutorials for C++ in TC++ and in VC++ different???

Plz tel me some basic things which I shud know to work in VC++ just as one shud know to work in TC++.


----------



## puja399 (Oct 19, 2005)

I am sorry to know that u had to buy tc++, and u have to learn TC++ in ur school becuz they didn't care to upgrade. I think the people teaching u C++ in school learned C++ with TC++ a long long time ago, and didn't care to upgrade their knowledge too. Anyways, don't worry. There r ways 2 ovrcome that. First of all, if u learn VC++ at ur home, u can run most of the TC++ programs on VC++ (excluding those which use DOS specific fuction calls, like initgraph(), and those from dos.h). So long as the TC++ code contains functions and keywords that complies with ANSI C++, they will run in VC++. 

In that way, u can learn real C++ at home and manage TC++ in ur school. 

Now, u need a real C++ compiler like VC++. If u can get a copy of Microsoft Visual Studio.NET 2003, or even Visual Studio 6, it will b great. But they r quite costly and comes in multi CD pack. VS.Net 2003 comes in 7 CDs and VS6 comes in 5 CDs pack. So imagine the size of the thing. If u can't manage to buy it, u can borrow it from others.

If u cant get VC++, u can use GNU C++ which is also very good and ANSI C++ compliant. Moreover its freeware and u can download it from the net for free. I recommend Dev-C++ from Bloodshed software which includes a nice IDE and also the complete GNU C++ compiler. 
U can visit their page at *www.bloodshed.net
Download it from *ovh.dl.sourceforge.net/sourceforge/dev-cpp/devcpp-4.9.9.2_setup.exe. Its 9 MB.

Wht books ru reading for C++?

Dev-C++ IDE Screenshot
*www.bloodshed.net/images/devcpp5_scr.jpg


----------



## The Incredible (Oct 19, 2005)

Well, v r given a buk which dont have any thing in connection with C++ in fact da buk has nothing abt C++. 

While few days earlier I asked our librarian to get a copy of 9th class computer since some1 stole mine. he said dat its not there but if v want another computer buk for reading then he can lend us da computer buk of class 11th.

I opted for dat & found dat it contained every word in da same sequence in which our teacher made us write in our note buks. It is "Computer Science by Sumita Arora. 4th Edition 2003."

It contains following things:-

Computer Overview & DOS

Programming in C++

Data Representation

Computer Organisation

Event Programming

Software Concepts


while the school in which I studied earlier contained JAVA & MS Office a& HTML.

MS Office with OS was taught us in 8th while JAVA & HTML & Internet was decide to teach uu in 9th & 10th.

They were in association with NIIT & had really gud system while da new school in which I am currently studying is damn damn bad n its monitors seems to b 13 /11 inch. they have a switch at their bottom. da keyboards dont contain start button and da mouse dont works.

And one much more amazing things is dat they teach C++ from 9th to 12th in TC++ only. 

The most irritating thing is dat da teacher rarely meets student, half yearly exams had moved on n he had given us only three pages of notes. he dont even te;lls us which header files to include. wat is da use of header files & many more questions.

I'm just willing to suicide.             

Since, I cant liv w/o computer n thought dat I will continue Software Engineering after 12th but now I dont think dat they will not allow me to giv entrance exams for S/W Engineering. While da othe students will b knowing C++ & Java & HTML & JAVA2. I'll b knowing nothing.


----------



## puja399 (Oct 20, 2005)

There is no need to be so morbid, life certainly doesn't end here. However, u need 2 depend on urself, and know that self help is da best help. Isn't there any public library in ur city? If yes, u can try there 4 books. If not, then there is still a way. If u have access 2 da Internet, u can download all the eBooks and tutorials u need from the net itself. And if can manage to buy some C++ and othe computer books, thats even better, I can tell u a few books that wll b helpful. I think ur using dialup connexion frm ur home, in that case, u can try to convince ur parents to take Internet phone from BSNL, it gives u unlimited dialup access at a nominal cost. If u have any good cyber cafe having Broadband connexion in ur city (like Sify iWay), and if it has cd writing facility, u can download things from there and take them 2 ur home on a CD. U can certainly download the Dev-c++ that I gave u in my previous post and use it.
 There r so many ways 2 do things and there is no need 2 feel helpless. If u have internet, u will get all the help u need. So, cheer up and move ahead.


----------



## RCuber (Oct 21, 2005)

Hi,

Most Schools/Institutes might not be aware of the Microsoft Sells Almost all of its software at down to earth prices for educational institutes.Ranging from windows XP pro(upgrade)  to Visual studio .NET!!!

If a institute qualifies for its program then u can buy any of their software at lesser prices.

Whats there for students ?????

They can take home a copy and install it on their pc  !!! The Students get genuein copies        .

I had been approved to do my final year project on VB.NET in my college by microsoft, and guess what? they sent me a legal copy of "Microsoft Visual Studio.NET 2003 Academic edition" for free  . The copy which i recived had to be activated by internet or phone.

This applies  for Qualified Educational Institutes(Schools/PU Colleges/Engineering Colleges)/Students only. NOT FOR INDIVIDUALS.



Please chk the following link

*www.microsoft.com/india/education/

*www.microsoft.com/education/default.mspx


Microsoft Authorised Education Resellers
*www.microsoft.com/india/education/AER.aspx

I hope this information was useful


----------



## The Incredible (Oct 21, 2005)

puja399 said:
			
		

> Isn't there any public library in ur city? If yes, u can try there 4 books.



Yes, there is, but, it is useless. I visited it. There's nothing new. They have buks for MS-DOS, OS - Windows 95,  C++ balmer / bolmer, and many more things which we can consider as Golden History of Computers.



			
				puja399 said:
			
		

> If u have access 2 da Internet, u can download all the eBooks and tutorials u need from the net itself. And if can manage to buy some C++ and othe computer books, thats even better, I can tell u a few books that wll b helpful.



Yeah u r correct. Currently I'm downloading tuts for Flash. 

Yeah I can manage to buy computer and other buks and I can even giv a try for S/W.

Plz tel me abt those buks.



			
				puja399 said:
			
		

> Internet phone from BSNL



Plz gimme mor info on dat. 

BTW is it more profitable than BSNL DATAONE?



			
				puja399 said:
			
		

> U can certainly download the Dev-c++ that I gave u in my previous post and use it.



Yes, I will download it as I complete downloading Flash tuts.




@ charangk

Thanks a lot!

Your post is really helpful but who is gonna teach 'em when they dont even hav qualified teahers for teaching. I think that I will try a school in Lucknow if I pass 9th from this school and if I fail then also I will apply for a school in Lucknow. Don't think I'm weak in studoies. I have been a rocker in my old school. There wasnt any one to compete with me in Computer, Mathematics and English Language.

Me got First Rank plenty of times but u know, that no one can say whats gonna happen with him next. So, unfortunately a guy of 11th died in our school and many major teachers left da school and due to this I have to leave dat school. My father works very far from home and comes here once a month or two. My mother thought that this school will be gud as it was very close to my house and approximately it had 110 students per class. But I didnt knew that it has lots of students but no teachers. The school is named English Medium but the teachers even cant speak English.

The school is having a really amusing set of teacher, I think it will b better if V call it a ZOO instead since every teacher there is gr8 in some aspect. (Please try to understand the actual meaning  of gr8 there urself) Its name shud b added in Guiness Book of World Records for having the most weird set of teachers.

I will define some teachers in my next post.


Now, come back to topic, Mr. Gopi Charan K, I'm a student in 9th CBSE. Tel me if I can apply there as a student and can get Visual Basic as there is no way 2 confess the authority to get a license from them or to move from TC++ to C++. They even dont provide buks for C++ and till today v hav had only 3 theory classes. and three pages of notes. V havent been told abt Keywords yet v only know abt types of TOKENS.

They have taken exams and got a very bad result even though da students arent caring for it as they why to worry for it. It is a side subject. No problem even if v fail in it. So no one is worried abt it except me and two other students. They too agree with me but v hav no way to make changes as v r nothing for them. if v will ask for anything such then they can simply ask us to leave da school since they hav lots of students. 

Bye.


----------



## puja399 (Oct 22, 2005)

U wanted to know abt internet phone, its a separate phone line from which u can dial only internet calls (ie, 172XXX numbers) and there is no call charge except that u have to pay a fixed monthly rent of Rs.499/- no matter how much u use that phone. There is also a special scheme for students where the internet call charge is much less than normal, u hve to contact the local BSNL office for details. 

Yes, broadband connection is certainly better that dialup, where u get 256kbps connection, and u can download about 100MB of data in one hour.  If u take BSNL's Home 500 plan, u get a bandwidht of 1GB per month, also u get free download time from 2 am to 8 am everyday (u have to run computer overnight though, to take advantage of that). 

U can visit the website of ur local BSNL office or *bsnl.co.in. 
Regarding books, u can start by reading the Bruce Eckel's book 'Thinking in C++', it has got 2 volumes, the print version of the first volume is available in india (published by Pearson Education'), but before that I suggest that u download both the volumes (they r available for free download) and read them first 2 c whether u like them. I think it is a great book for learning C++. 
Usue the following link:
*mindview.net/Books/TICPP/ThinkingInCPP2e.html

For other links, PM me.

I hope this will help u mich.


----------



## The Incredible (Oct 23, 2005)

I think i'll like to have internet phone..

tel me its registration charges... & tarifff

btw i'm searching for da above on bsnl's site

lemme see those buks...
but when they r available freely then why shud i buy them instead of d/ling them???

what speed is offered by internet phone....

yup ur reply helped much noy *mich*


----------

