By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,895 Members | 1,106 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,895 IT Pros & Developers. It's quick & easy.

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

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a


----- 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 discussion thread is closed

Replies have been disabled for this discussion.