C++ code in VB.NET / VB.NET straight code

sean_mackrory

New member
Joined
Dec 30, 2003
Messages
1
Im working on my own version of MacroMedia Flash MX. All the code for the File format is in C++ (just headers and code, no libraries), and everything else like the GUI, etc... is in VB.NET. How can I integrate the two so that my VB.NET GUI can access the functions of the C++ code. Im thinking DLL, but once I have the DLL, how do I call those functions from within my VB.NET code?

I also dont want to spend $2000 getting Visual Studio, so Im using MicroSofts .NET SDK, which is all command-line compilers. Now Im OK to do almost all the coding by hand, but how do I specify other things like the project file and the entry point of the program? Or does the SDK have a feature for doing that?

Thanks a lot,
Sean Mackrory
 
You use your AssemblyInfo.vb file to specify the project title, since youre working from the command line you probably havent got one, it looks like this:
Code:
Imports System.Reflection
Imports System.Runtime.InteropServices

 General Information about an assembly is controlled through the following 
 set of attributes. Change these attribute values to modify the information
 associated with an assembly.

 Review the values of the assembly attributes

<Assembly: AssemblyTitle("")> 
<Assembly: AssemblyDescription("")> 
<Assembly: AssemblyCompany("")> 
<Assembly: AssemblyProduct("")> 
<Assembly: AssemblyCopyright("")> 
<Assembly: AssemblyTrademark("")> 
<Assembly: CLSCompliant(True)> 

The following GUID is for the ID of the typelib if this project is exposed to COM
<Assembly: Guid("Add a GUID here")> 

 Version information for an assembly consists of the following four values:

      Major Version
      Minor Version 
      Build Number
      Revision

 You can specify all the values or you can default the Build and Revision Numbers 
 by using the * as shown below:

<Assembly: AssemblyVersion("1.0.*")>
To integrate with a DLL, what DLL type is it? Win32 or Managed C++?

If its Win32:
Code:
Public Class MyClass
      Private Declare Function MyCFunction Lib "MyCDLL.dll" (MyParam As String) As Integer
Managed programs do not have "EntryPoints" like C++, you can create a Public Shared Sub Main() which acts like an EntryPoint but you can also specify to just start the form, I dont know how to do this from the command line though.

You dont need to spend $2000 on VS.Net because you can buy the individual langauges, so you can get just Managed C++ or just VB.Net, they only come in Standard Editions though, you wont have the advanced features. VS.Net Purchase Options
 
Back
Top