Click here to Skip to main content
15,889,403 members
Home / Discussions / C#
   

C#

 
Questionhow to convert .pst files to .xml files using C# programming language? Pin
tchshiping28-Jul-09 22:54
tchshiping28-Jul-09 22:54 
AnswerRe: how to convert .pst files to .xml files using C# programming language? Pin
Nagy Vilmos28-Jul-09 23:11
professionalNagy Vilmos28-Jul-09 23:11 
GeneralRe: how to convert .pst files to .xml files using C# programming language? Pin
tchshiping29-Jul-09 13:17
tchshiping29-Jul-09 13:17 
AnswerRe: how to convert .pst files to .xml files using C# programming language? Pin
Mycroft Holmes28-Jul-09 23:23
professionalMycroft Holmes28-Jul-09 23:23 
GeneralRe: how to convert .pst files to .xml files using C# programming language? Pin
tchshiping29-Jul-09 13:22
tchshiping29-Jul-09 13:22 
GeneralRe: how to convert .pst files to .xml files using C# programming language? PinPopular
Mycroft Holmes29-Jul-09 14:09
professionalMycroft Holmes29-Jul-09 14:09 
GeneralRe: how to convert .pst files to .xml files using C# programming language? Pin
situ2110-Apr-11 22:19
situ2110-Apr-11 22:19 
Questioncalling unmanaged C++ dll from C#: return type double[] Pin
devvvy28-Jul-09 22:27
devvvy28-Jul-09 22:27 
hello

I'm trying to export a function which returns an array of double:
<br />
#ifndef _MATLAB_GENERIC_DLL_H_<br />
#define _MATLAB_GENERIC_DLL_H_<br />
<br />
<br />
#ifdef MATLABGENERICDLL_EXPORTS<br />
#define MATLABGENERICDLL_API __declspec(dllexport)<br />
#else<br />
#define MATLABGENERICDLL_API __declspec(dllimport)<br />
#endif<br />
<br />
// This class is exported from the MatlabGenericDll.dll<br />
<br />
extern "C"<br />
{<br />
<br />
MATLABGENERICDLL_API void FormatDrive();<br />
MATLABGENERICDLL_API void CopyFiles(char* Src, char* Tgt);<br />
MATLABGENERICDLL_API void ToUpper(char* Src);<br />
MATLABGENERICDLL_API char* ToUpper2(char* Src);<br />
MATLABGENERICDLL_API double* GetSomeDoubleArray(char* Src);<br />
}<br />
#endif //_MATLAB_GENERIC_DLL_H_<br />


The actual implementation looks like this:
<br />
MATLABGENERICDLL_API double* GetSomeDoubleArray(char* Src)<br />
{<br />
    double SomeArray[10];<br />
		<br />
		for(int i=0; i<10; i++)<br />
		{<br />
			if(i>0) {<br />
				SomeArray[i] = 1.1 * SomeArray[i-1];<br />
			} else {<br />
				SomeArray[i] = 0.5;<br />
			}<br />
		}<br />
		return SomeArray;<br />
}<br />


From dotnet/C# code:
<br />
class Program<br />
	{<br />
		[DllImport(@"C:\MatlabGenericDll.dll")]<br />
		private static extern string ToUpper2(string Src);<br />
<br />
		[DllImport(@"C:\MatlabGenericDll.dll")]<br />
		private static extern double[] GetSomeDoubleArray(string Src);<br />
<br />
		static void Main(string[] args)<br />
		{<br />
			string strTest = "abc";<br />
			string strResult = null;<br />
<br />
			double[] SomeArray= null;<br />
<br />
			try<br />
			{<br />
				strResult = ToUpper2(strTest); // okay<br />
				SomeArray= SomeArray("abcde"); // System.Runtime.InteropServices.MarshalDirectiveException!! <br />
			}<br />
			catch (Exception ex)<br />
			{<br />
				Console.WriteLine(ex.ToString());<br />
			}<br />
<br />
			return;<br />
		}<br />
	}<br />


Suggestion?!

Thanks

dev

AnswerRe: calling unmanaged C++ dll from C#: return type double[] Pin
Moreno Airoldi29-Jul-09 3:13
Moreno Airoldi29-Jul-09 3:13 
QuestionDownload a intranet site from a windows form (401 error) Pin
Succodimele28-Jul-09 22:14
Succodimele28-Jul-09 22:14 
AnswerRe: Download a intranet site from a windows form (401 error) Pin
Vimalsoft(Pty) Ltd29-Jul-09 2:03
professionalVimalsoft(Pty) Ltd29-Jul-09 2:03 
GeneralRe: Download a intranet site from a windows form (401 error) Pin
Succodimele29-Jul-09 4:11
Succodimele29-Jul-09 4:11 
GeneralRe: Download a intranet site from a windows form (401 error) Pin
Vimalsoft(Pty) Ltd29-Jul-09 4:34
professionalVimalsoft(Pty) Ltd29-Jul-09 4:34 
GeneralRe: Download a intranet site from a windows form (401 error) Pin
Succodimele29-Jul-09 19:56
Succodimele29-Jul-09 19:56 
GeneralRe: Download a intranet site from a windows form (401 error) Pin
Succodimele29-Jul-09 20:15
Succodimele29-Jul-09 20:15 
QuestionHow do I get the correct font height in Hindi fonts? Pin
Gywox28-Jul-09 22:05
Gywox28-Jul-09 22:05 
AnswerRe: How do I get the correct font height in Hindi fonts? Pin
Nagy Vilmos28-Jul-09 22:19
professionalNagy Vilmos28-Jul-09 22:19 
GeneralRe: How do I get the correct font height in Hindi fonts? Pin
Gywox28-Jul-09 22:30
Gywox28-Jul-09 22:30 
GeneralRe: How do I get the correct font height in Hindi fonts? Pin
Nagy Vilmos28-Jul-09 23:10
professionalNagy Vilmos28-Jul-09 23:10 
GeneralRe: How do I get the correct font height in Hindi fonts? Pin
Gywox28-Jul-09 23:20
Gywox28-Jul-09 23:20 
Questionhorizontal scroll bar move event... Pin
spalanivel28-Jul-09 21:21
spalanivel28-Jul-09 21:21 
AnswerRe: horizontal scroll bar move event... Pin
stancrm28-Jul-09 21:43
stancrm28-Jul-09 21:43 
GeneralRe: horizontal scroll bar move event... Pin
spalanivel28-Jul-09 22:00
spalanivel28-Jul-09 22:00 
GeneralRe: horizontal scroll bar move event... Pin
spalanivel29-Jul-09 0:53
spalanivel29-Jul-09 0:53 
AnswerRe: horizontal scroll bar move event... Pin
Alan N29-Jul-09 2:03
Alan N29-Jul-09 2:03 

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.