473,385 Members | 1,324 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

C++ to C# Wrapper

Hi

How to write method in wrapper for method from C++:

HRESULT Add(WCHAR *wcPath)

???

I've write something like this

int Add(string wcPath)

and it's doesn't work :(

regards
kuba florczyk
Nov 15 '05 #1
2 1365
How about ...

public class MyWrapper
{
[DllImport("MyDll.dll", SetLastError=true, CharSet=CharSet.Auto)]
public static IntPtr Add(string wcPath);
}

Since, however, this is returning an HRESULT, is this method on a COM
object? If yse you must use COM Interop.

Hope this helps
Brian W

"Kuba Florczyk" <ch******@poczta.onet.pl> wrote in message
news:ep**************@TK2MSFTNGP11.phx.gbl...
Hi

How to write method in wrapper for method from C++:

HRESULT Add(WCHAR *wcPath)

???

I've write something like this

int Add(string wcPath)

and it's doesn't work :(

regards
kuba florczyk

Nov 15 '05 #2
Thx. It's work!

kuba florczyk

Użytkownik "Brian W" <brianw@gold_death_2_spam_rush.com> napisał w
wiadomości news:OU**************@TK2MSFTNGP11.phx.gbl...
How about ...

public class MyWrapper
{
[DllImport("MyDll.dll", SetLastError=true, CharSet=CharSet.Auto)]
public static IntPtr Add(string wcPath);
}

Since, however, this is returning an HRESULT, is this method on a COM
object? If yse you must use COM Interop.

Hope this helps
Brian W

"Kuba Florczyk" <ch******@poczta.onet.pl> wrote in message
news:ep**************@TK2MSFTNGP11.phx.gbl...
Hi

How to write method in wrapper for method from C++:

HRESULT Add(WCHAR *wcPath)

???

I've write something like this

int Add(string wcPath)

and it's doesn't work :(

regards
kuba florczyk


Nov 15 '05 #3

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

Similar topics

4
by: Edvard Majakari | last post by:
Hi, I was wondering what would be the most elegant way for creating a Python class wrapper for a command line utility, which takes three types of arguments: 1. options with values (--foo=bar)...
12
by: Egil M?ller | last post by:
Is there any way to create transparent wrapper objects in Python? I thought implementing __getattribute__ on either the wrapper class or its metaclass would do the trick, but it does not work for...
9
by: WithPit | last post by:
I am trying to create an Managed C++ Wrapper around an unmanaged library which contains C++ code. Some of the unmanaged methods returns an returntype which is of the abstract base type (for...
4
by: Stephen | last post by:
Hi I am currently developing a web application that has a third party component on it. The third party component is a graph component from Xceed that uses a number of dlls. The problems occur...
4
by: peterbe | last post by:
This works exactly as you would expect:: from time import sleep def foo(on='ABC'): for e in list(on): sleep(1) yield e When I run this on the command line It takes about 3 seconds to...
22
by: linwu02 | last post by:
I am trying to write a Wrapper for our web wrapping engine, Cameleon. Currently Cameleon is able to answer certain SQL queries but with a restriction that all SQL queries must have a predicate....
9
by: Julien Biezemans | last post by:
Hi! Here is the problem: I'd like to restrict local filesystem stream operations to one directory just like a root jail. fopen('/file.bin') would actually open /some/path/file.bin. One goal...
16
by: utab | last post by:
Dear all, In programming terminology, what is a wrapper and where is it used? Regards
4
by: a_agaga | last post by:
Hi! Do you know different alternatives to convert exceptions in many methods of some wrapper classes. User -Wrapper classes -LibraryClasses -... Wrapper classes catch an exception of only...
3
by: bobc | last post by:
Using SQL Server 2000... I wrote a wrapper to call a sub proc (code provided below). The intended varchar value returned in the output parameter of each proc is a string implementation of an...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

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.