473,569 Members | 2,634 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

return string to .Net application from c dll ?

how can i return string to .Net application from c dll ?

i have the text in
char sText[100] ;

and i want to return it from c dll to .Net application.

i tried : *char in the function, but the didnt saw the string i passed.

what type/way i need to do ?

thanks and have a nice day.
Nov 16 '05 #1
1 2109
In .Net routine use
[return: MarshalAs(Unman agedType.LPStr)]
public static extern string MyMethod(...)

In C char* MyRoutine(...);

"Daylor" <Da****@012.net .il> wrote in message
news:3f******** @news.012.net.i l...
how can i return string to .Net application from c dll ?

i have the text in
char sText[100] ;

and i want to return it from c dll to .Net application.

i tried : *char in the function, but the didnt saw the string i passed.

what type/way i need to do ?

thanks and have a nice day.

Nov 16 '05 #2

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

Similar topics

6
8832
by: Sunny | last post by:
Hi, I have a very serious issue at hand. I have created a small C# Console App (Csd.exe) that collects a list of files as its argument and generates their Md5 sets. This application is used by other applications in my dept, which simply call this Csd.exe app and passing a list of files. I want to ask how can I return a value from this...
12
4110
by: Jose Fernandez | last post by:
Hello. I'm building a web service and I get this error. NEWS.News.CoverNews(string)': not all code paths return a value This is the WebMethod public SqlDataReader CoverNews(string Sport) {
3
8635
by: Oberon | last post by:
How do I deal with this? I am getting an error for each get in the Game class (see code below). In the simplified example below I have reduced this to just 3 fields, one which can be NULL. I have added 3 records to the table and ran the program but it fails with the error above. The application is supposed to create the hashtable of...
3
3772
by: Agnes | last post by:
In my old vfp application, there is DTOS function to return 'yyyymm' ,in .net any similar function ?? DTOS(datetime.now) and return yyyymm, I know that I can CType(Year(datetime.now), String) & CType(Month(datetime.now), String) but if the datetime is Sep,04, it will return 20049 , but not 200409, Anyone got the idea ? thanks a lot
1
4405
by: Thomas D. | last post by:
Hello all, I'm using the IXmlSerializable interface for a project and encounter some problems when testing my webservice in a client application. I know this interface is undocumented and not intended for use, but I think this is the only solution for my situation. I searched the web, in the hope finding the answer, without any luck, so my...
22
3233
by: Michael Rasmussen | last post by:
Hi all, Not sure if this is OT? I have a function in a library written in C++ which returns a strdup(s.c_str()) to an application written i C. Running Valgrind on my C-application shows this results in memory leaks due to the c_str is never freed. Example:
6
1884
by: Tim Roberts | last post by:
I've been doing COM a long time, but I've just come across a behavior with late binding that surprises me. VB and VBS are not my normal milieux, so I'm hoping someone can point me to a document that describes this. Here's the setup. We have a COM server, written in Python. For completeness, here is the script: ----- testserver.py...
1
5922
by: mcstrini | last post by:
I'm trying to have my application use a special config file which is shared across servers, and want to include a custom section (for URLs of report services associated with database instances). However, my section doesn't seem to be recognized (GetSection("ReportServerUrls") returns null). I don't really see how what I'm doing differs from...
1
1272
by: RobRasti | last post by:
I'm trying to return a class that implements the IList interface and has a few other data members as well. // User Node class public class User { private string m_username = ""; private string m_userpassword = "";
0
7701
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
8130
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7677
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6284
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5219
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3653
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
1223
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
940
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.