Question Passing Value from one app to another.

xRage

Member
Joined
Sep 22, 2008
Messages
11
Programming Experience
5-10
Hi, i have 2 applications, written in different languages, unavoidable, VB and C#, the VB Program is the main one, it opens the C# one, which then closes when its completed its task, and the VB one is then visible again.

The C# program is basically using the Camera on the IPAQ. the VB Program is the main program that needs to know the location of the picture that was just taken.

Its all working, a button in VB is clicked and the C# program runs, takes a picture and stores it in a defined location.
i need this string, stored currently as path = "/My Pictures/Image1.jpg" to be brought back to the VB Program. the name of the file will change, ie the next picture taken will be "/My Pictures/Image2.jpg"

How can i bring this string from C# back to the VB application ???
i dont wanna use database :/

THANKS!
 
Serialization?

Can you serialize a class in your VB app and pass the path to the serialized file to your C# app via command line and deserialize it.

I'm not sure if Serialization is available in CF.

Or simply pass the string of the path via a command line?
 
Last edited:
How can i bring this string from C# back to the VB application ???
i dont wanna use database :/

That really depends on if you have the C# source code, and how (if at all) the C# program makes it available that it has put the image in a certain place

What I must point out, because you seem mighty confused:
C# and VB.NET are the SAME LANGUAGE under the hood. THere is nothing stopping you from using the C# app like a DLL, or if you have the code, building it into your project and debug-stepping between the two languages. ALl .NET languages interoperate because they all compile to MSIL. You should stop thinking of your C# program as a separate app because you can integrate it into vb. At the worst, decompile it using Reflector, in VB>NET syntax and than you'll have a VB program that can use the camera..

Or man up and learn C#.. it's cooler anyways :D
 
lol, i know c#
im actually better at c# than vb but must use vb with the company im currently with.
thanks for your replies although im obviously not explaining well enough.
nice effort though.
if i ever find a way 2 fix, il post it here.
 
So what is the problem with converting your C# program to a DLL? they wouldnt even know it was C# originally
 
maybe try this

If you don't want to put it into a database then how about you write the 1 line to a text file that both apps will point to?

so VB calls C#, C# takes a photo, C# overwrites PictureFilename.txt, VB gets control back from C#, VB reads PictureFilename.txt and that should be it.

After VB has got it you can delete the file - PictureFilename.txt off your device if you wish.

Or you could use the registry I guess. I haven't done that but it could be done.

regards, Ricky
 
Back
Top