Click here to Skip to main content
16,006,902 members
Home / Discussions / C#
   

C#

 
JokeRe: Printing a Window Form Pin
Nader Elshehabi6-Jul-06 5:58
Nader Elshehabi6-Jul-06 5:58 
QuestionInvalid Resx file, need to regenerate Pin
SeMartens6-Jul-06 1:24
SeMartens6-Jul-06 1:24 
AnswerRe: Invalid Resx file, need to regenerate Pin
VSush6-Jul-06 1:40
VSush6-Jul-06 1:40 
GeneralRe: Invalid Resx file, need to regenerate Pin
SeMartens6-Jul-06 1:53
SeMartens6-Jul-06 1:53 
GeneralRe: Invalid Resx file, need to regenerate Pin
SeMartens6-Jul-06 3:12
SeMartens6-Jul-06 3:12 
QuestionRetreiving network password in c# Pin
Phanindra Kumar6-Jul-06 1:07
Phanindra Kumar6-Jul-06 1:07 
AnswerRe: Retreiving network password in c# Pin
stancrm6-Jul-06 1:46
stancrm6-Jul-06 1:46 
QuestionExporting dll variable from c++ to c# client Pin
Tugberk_Kara6-Jul-06 1:00
Tugberk_Kara6-Jul-06 1:00 
I have a cpp code and its header file as below.And I can export the functions DLLfun1,DLLfun2 and Add. But the problem is that although I can export DLLArg variable ( I check it with dumpbin.exe) , I can not use it from DLLClient witten in c#. I will paste my c# code also below.
Secondly, I want to ask that can I export and array such as byte [] or int [] as a variable like DLLArg.

I need help urgently.

Here DllCode.h --->

#ifdef DLLDIR_EX
#define DLLDIR __declspec(dllexport) // export DLL information
#else
#define DLLDIR __declspec(dllimport) // import DLL information
#endif

// The extern "C" declaration allows mixed languages compactability,
// it prevents the C++ compiler from using decorated (modified)
// names for the functions
extern "C" {
void DLLDIR DLLfun1(char*);
int DLLDIR DLLfun2(int);
int DLLDIR Add(int, int); // Class function Add

};
extern int DLLDIR DLLArg;

class __declspec(dllexport) DLLclass
{
public:
DLLclass(); // Class Constructor
~DLLclass(); // Class destructor
int Sub(int, int); // Class function Subtract
int Arg; // Warning: you should not
// import class variables
// since the DLL object can be dynamically unloaded.
};

Here DLLClient.cs --->

using System;
using System.Runtime.InteropServices;
using System.IO;


namespace DllClient
{
///
/// Summary description for Class1.
///

///

class Class1
{
[DllImport("main.dll")]
public extern static int parseFile(int a);

[DllImport("main.dll",EntryPoint="?deneme@@3HA")]
public extern static int deneme;

static void Main(string[] args)
{

int j= parseFile(5);



Console.WriteLine("Press any key to continue..."+deneme );
Console.ReadLine();
}
}
}
AnswerRe: Exporting dll variable from c++ to c# client Pin
S. Senthil Kumar6-Jul-06 1:45
S. Senthil Kumar6-Jul-06 1:45 
QuestionCalling COM from C# Pin
sony alex6-Jul-06 0:46
sony alex6-Jul-06 0:46 
AnswerRe: Calling COM from C# Pin
led mike6-Jul-06 5:46
led mike6-Jul-06 5:46 
JokeRe: Calling COM from C# Pin
Nader Elshehabi6-Jul-06 5:54
Nader Elshehabi6-Jul-06 5:54 
Questionhow to combine 2 exe ? Pin
hdv2126-Jul-06 0:43
hdv2126-Jul-06 0:43 
AnswerRe: how to combine 2 exe ? Pin
J4amieC6-Jul-06 0:55
J4amieC6-Jul-06 0:55 
AnswerRe: how to combine 2 exe ? Pin
stancrm6-Jul-06 1:36
stancrm6-Jul-06 1:36 
AnswerRe: how to combine 2 exe ? Pin
Dave Kreskowiak6-Jul-06 2:50
mveDave Kreskowiak6-Jul-06 2:50 
AnswerRe: how to combine 2 exe ? Pin
Kevin McFarlane6-Jul-06 8:53
Kevin McFarlane6-Jul-06 8:53 
QuestionMake NotifyIcon without a Form [modified] Pin
synunn6-Jul-06 0:42
synunn6-Jul-06 0:42 
AnswerRe: Make NotifyIcon without a Form Pin
Nader Elshehabi6-Jul-06 1:36
Nader Elshehabi6-Jul-06 1:36 
GeneralRe: Make NotifyIcon without a Form Pin
synunn6-Jul-06 2:45
synunn6-Jul-06 2:45 
JokeRe: Make NotifyIcon without a Form Pin
Nader Elshehabi6-Jul-06 5:04
Nader Elshehabi6-Jul-06 5:04 
QuestionDecompile .NET Pin
Sabry19056-Jul-06 0:35
Sabry19056-Jul-06 0:35 
AnswerRe: Decompile .NET Pin
Kevin McFarlane6-Jul-06 0:39
Kevin McFarlane6-Jul-06 0:39 
GeneralRe: Decompile .NET Pin
Sabry19056-Jul-06 0:48
Sabry19056-Jul-06 0:48 
GeneralRe: Decompile .NET Pin
Paul Conrad6-Jul-06 6:42
professionalPaul Conrad6-Jul-06 6:42 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.