473,465 Members | 1,931 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Calling DLL export function(unmanaged visual c++ code) from managed code(Visual c#,.net)

class xyz{

public void somefunction{

if(this.folderBrowserDialog1.ShowDialog() == DialogResult.OK)
{
m_varFolderPath = this.folderBrowserDialog1.SelectedPath;
m_varFolderPath += "\\Iamlucky.txt";


System.String a =(String)strVariable1;
System.String b =(String)strVariable2;
System.String c =(String)m_varFolderPath;

try
{

/* DidData is the dll export method created in class clsCallDllBackup*/
if(clsCallDllBackup.DigData(a,b,c))
MessageBox.Show("yyyyyyyyyyyyy");
else
MessageBox.Show("00000000");
}
catch
{
MessageBox.Show("xxxxxxxxxx");
}

}

}//end of function

}//end of class


public class clsCallDllBackup
{
public clsCallDllBackup()
{

}

[DllImport("DigInfo.dll", EntryPoint="ExtractJobDigData")]
public static extern bool DigData(String strProjectName,String strJobName,String strFilepathname);
}

problem: the intended exported dll function 'DigDat'(unmanaged code) is not creating a binary text file on a
choosen folder, Iam calling the DLL exported function from managed code.

description:

I created a class for the dll as class clsCallDllBackup which is having the prototype
for exported fuction ExtractJobDigData.

Diginfo.dll will creat a txt file with binary information in selected folder, but in c# the
selected path will be as @"D:\\somefolder\\mylucky.txt",

but the input folderpath for the dll function will be as "D:\\somefolder\\mylucky.txt" without
the symbol "@", is it any problem for the dll function in creating the text file on my choosen folder

how to give the input to dll exported function without "@" ie, as "D:\\somefolder\\mylucky.txt"

the signature of dll export function is ExtractJobDigData(LPSTR strVariable1,LPSTR strVariable2,LPSTR m_varFolderPath)

when i run the program iam getting the true statement MessageBox.Show("yyyyyyyyyyyyy"); but the required out put of the
dll ie, a text file is not getting created on the choosen folder
Nov 15 '05 #1
1 3691


----- seash wrote: ----

class xyz

public void somefunction

if(this.folderBrowserDialog1.ShowDialog() == DialogResult.OK

m_varFolderPath = this.folderBrowserDialog1.SelectedPath
m_varFolderPath += "\\Iamlucky.txt";


System.String a =(String)strVariable1
System.String b =(String)strVariable2
System.String c =(String)m_varFolderPath

try
/* DidData is the dll export method created in class clsCallDllBackup*
if(clsCallDllBackup.DigData(a,b,c)
MessageBox.Show("yyyyyyyyyyyyy")
els
MessageBox.Show("00000000")

catc

MessageBox.Show("xxxxxxxxxx")


}//end of functio

}//end of clas


public class clsCallDllBacku

public clsCallDllBackup(


[DllImport("DigInfo.dll", EntryPoint="ExtractJobDigData")
public static extern bool DigData(String strProjectName,String strJobName,String strFilepathname)


problem: the intended exported dll function 'DigDat'(unmanaged code) is not creating a binary text file on a
choosen folder, Iam calling the DLL exported function from managed code

description

I created a class for the dll as class clsCallDllBackup which is having the prototyp
for exported fuction ExtractJobDigData

Diginfo.dll will creat a txt file with binary information in selected folder, but in c# the
selected path will be as @"D:\\somefolder\\mylucky.txt"

but the input folderpath for the dll function will be as "D:\\somefolder\\mylucky.txt" withou
the symbol "@", is it any problem for the dll function in creating the text file on my choosen folde

how to give the input to dll exported function without "@" ie, as "D:\\somefolder\\mylucky.txt

the signature of dll export function is ExtractJobDigData(LPSTR& strVariable1,LPSTR& strVariable2,LPSTR& m_varFolderPath
when i run the program iam getting the true statement MessageBox.Show("yyyyyyyyyyyyy"); but the required out put of th
dll ie, a text file is not getting created on the choosen folde
Nov 15 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Andreas Hoetker | last post by:
Hello I'm currently developing a project, that contains one .net (VB) executable and a C++ (MFC) DLL. Now, what I want to do is to call the functions in the dll out of my managed code //managed...
4
by: Ed Debrot | last post by:
This seems incredibale to me but I've done some testing and it appears I can't pass in a long and than an int to a function. The int is not passed in correctly. extern static int...
1
by: Zapbbx | last post by:
I have a 3rd party application that can reference external dll's. The dll's have to be written in unmanaged code with an exported function I can reference and call. I would like it to call a C# dll...
3
by: Gustavo L. Fabro | last post by:
Greetings! I'm a newbie in Visual C++ .NET (have programmed in Borland C++ and Builder for long) and I am trying to do a very simple thing, but I'm stuck. I created an (unmanaged) DLL project...
8
by: Brett Robichaud | last post by:
I understand how code-behind can handle events for a page, but can I call a code-behind method from within a <script> tag in my ASP.Net page, or can I only call methods defined in other <script>...
0
by: monika.saxena | last post by:
Hi all, In one of my projects which is a web based application in asp.net, a third party tool - "Frontline Solver DLL" (It is an unmanaged DLL and ..NET is calling it using the PInvoke) is used....
4
by: Peter Schmitz | last post by:
Hi, I've got a rather old DLL that compiles properly with the 'Multi byte charset' option under VS2005. Now, I cannot call any functions of this dll out of a VB .net application (would need 'Use...
6
by: guxu | last post by:
I have a managed C++ code which calls some methods in unmanaged C++ DLL. In my unmanaged DLL, I have a PROTECTED virutal function in a base class and derived class has a PRIVATE function which...
1
by: MC-Advantica | last post by:
Does anyone have a simple "Hello World" like application that demonstrates unmanaged C++ calling managed C++ developed in VS2005? I'm confused by many posts as they discuss managed extensions from...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.