Advertisement

04.15.2008 at 03:25AM PDT, ID: 23323177
[x]
Attachment Details

Help with unmanaged code

Asked by comadreja82 in Microsoft Visual C#.Net, C++ Programming Language

Tags: C#

I would be grateful if you could help me with my problem.

I have created a dll using C++  .net 2003 which contents a class of  methods.

Furthermore, i have created a gui application using microsoft visual C# 2008 exrpess edition.

I would like to use two class methods of the dll described before.

Therefore i have developed the following code in C# ( it takes an input string and returns void as output)

[DllImport("retrieval.dll", EntryPoint = "initialize")]
        [return: MarshalAs(UnmanagedType.BStr)]
        public static extern void initialize([MarshalAs(UnmanagedType.BStr)] string xml);

The code above responds to c++ dll as
void SIMPLE_RETRIEVAL::initialize(const char *param_xml)

In addition, i have developed a second method (it takes a string as input and returns an array of longs)  

The C# code that will respond to C++ dll method is
long* SIMPLE_RETRIEVAL::parse_query_and_retrieve(const char *image)

However i didn't managed to call this method above from C#....

How i could do this ?

Furthermore, when i call the first method

private string xml = "C:\retrieval_parameters.xml";

 private void InitializeComponent()
        {
                  this.initialize(this.xml);
                  ....
                  ....
         }
from the C# code
 
I take the following error :
Member 'WindowsFormsApplication1.Form2.initialize(string)' cannot be accessed with an instance reference; qualify it with a type name instead

Since i am newbie i would really appreciate your assistance!

Furthermore would i have any problems in C# if the C++ dll that i ve created has other dll dependencies.

Thank you

Best Regards

Comadreja 82
 Start Free Trial
 
Loading Advertisement...
 
[+][-]04.15.2008 at 06:08AM PDT, ID: 21358263

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2008 at 06:33AM PDT, ID: 21358502

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.15.2008 at 06:46AM PDT, ID: 21358613

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.15.2008 at 08:23AM PDT, ID: 21359517

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.15.2008 at 09:18AM PDT, ID: 21360044

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]04.16.2008 at 05:07AM PDT, ID: 21366796

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]04.16.2008 at 10:06AM PDT, ID: 21369890

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Microsoft Visual C#.Net, C++ Programming Language
Tags: C#
Sign Up Now!
Solution Provided By: TheLearnedOne
Participating Experts: 1
Solution Grade: A
 
 
[+][-]06.23.2008 at 05:55PM PDT, ID: 21851714

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]06.27.2008 at 07:25PM PDT, ID: 21888983

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628