Ug.
OK, I need a bit of Direction :)
I've Got A .NET DLL That I've written in C#
I can call it in .NET VB / .NET C++ / .NET C# Without Issue.
It uses System.IO.Pipes To Communicate to the main Program (I believe Pipes Requires NET 3.5)
Now for the problem :cursing:
The Person Using the DLL in their Application Wants to use VC++ 6.0 without using any .NET Environments.
What / How do I make it available to them They're looking for an Unmanaged.DLL
DLL Heck
Started by PGP_Protector, May 26 2010 01:48 PM
6 replies to this topic
#1
Posted 26 May 2010 - 01:48 PM
|
|
|
#2
Posted 27 May 2010 - 05:56 AM
Rewrite it in C++
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics
#3
Posted 27 May 2010 - 11:41 AM
Davide said:
Rewrite it in C++
Will a DLL using .NET 3.5 written in C++ be usable by Visual C 6.0 ?
#4
Posted 27 May 2010 - 01:04 PM
If it's not using .NET, it's just C++, not Visual C++. Writing it in C++ means NOT using the .NET framework to write it, but native C++ with Win32 API and similar stuff.
DLL made for .NET can be used with .NET.
Native DLL can be used with native code (C++) and with .NET using [DLLImport("dllname.dll")].
They are different, but they have the same extension.
DLL made for .NET can be used with .NET.
Native DLL can be used with native code (C++) and with .NET using [DLLImport("dllname.dll")].
They are different, but they have the same extension.
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics
#5
Posted 28 May 2010 - 09:28 AM
ok, My C++ Is very Limited
In My .h File If I understand C++ Correctly This is where I would "define" the commands that are used correct ?
So For Example the User (in the C# Version ) Has two Commands
Now to Do This In C++ I've got 2 Files the MyDLL.cpp & the MyDLL.h Files (Pulled from a "Create a DLL in C++ Demo I found)
They have their functions "Defined" in the .h file like this.
So How do I define it in the .h file to receive an unknown size array, and return an unknown size array in the .H & .CPP Files ?
In My .h File If I understand C++ Correctly This is where I would "define" the commands that are used correct ?
So For Example the User (in the C# Version ) Has two Commands
- public static int SendConfig(string[] TestConfigurationReceived)
- public static double[,] RunTest(int TestParamater1,int TestParamater2)
Now to Do This In C++ I've got 2 Files the MyDLL.cpp & the MyDLL.h Files (Pulled from a "Create a DLL in C++ Demo I found)
They have their functions "Defined" in the .h file like this.
- static __declspec(dllexport) double Divide(double a, double b);
double MyDLL::Divide(double a, double b)
{
if (b == 0)
{
throw new invalid_argument("b cannot be zero!");
}
return a / b;
}
So How do I define it in the .h file to receive an unknown size array, and return an unknown size array in the .H & .CPP Files ?
#6
Posted 28 May 2010 - 09:33 AM
I'm not really good at C++ when it comes to classes. But I doubt you can declare an unknown size array in either C# or C++. You can declare a list though in C#.
Are you a newbie programmer trying to learn C#? Check out my small tutorial: Visual C# Programming Basics
#7
Posted 28 May 2010 - 09:47 AM
Davide said:
I'm not really good at C++ when it comes to classes. But I doubt you can declare an unknown size array in either C# or C++. You can declare a list though in C#.
This works for me in C# for
double[,] TempResultsBuffer = null;
TempResultsBuffer = DataParser(MyData);
return TempResultsBuffer;
[code]
Where DataParser is a function like this
[code]
private static double[,] DataParser(RawData)
{
// Process raw Data and Return a double[,]
}
But thanks for the pointers (Note I'd love to avoid using C++ * Pointers if possible :D )
Back to Google & my books for now.


Sign In
Create Account


Back to top









