Programming

Programming questions? Ask a programmer for answers ASAP

Ask a Computer Expert,
Get an Answer ASAP!

I need to convert a function in C++ to Csharp would you help…

Customer Question
Yes please i need...

Yes please i need to convert a function in C++ to Csharp would you help me in that

Technician's Assistant: What's your objective for this C++ project?

I am integrating goldmine api in .net

Submitted: 4 months ago.Category: Programming
Show More
Show Less
Ask Your Own Programming Question
Answered in 4 minutes by:
3/26/2018
Programmer: Jeevan DSouza,
 replied 4 months ago
Jeevan DSouza
Category: Programming
Satisfied Customers: 172
Experience: Professor at DeVry University
Verified

Please attach the function here

Ask Your Own Programming Question
Customer reply replied 4 months ago
GMW_DS_Fetch in C++ is this, it is prototypefunction for goldmine:
Public Declare Function GMW_DS_Fetch Lib"GM5S32.dll" (ByVal iHandle As Long, ByVal sbufAs String, ByVal iBufSize As Long, ByValiGetRecs As Long) As LongI converted the above function to the followingin C sharp:
[DllImport("Gm7s32.dll")]
public static extern IntPtr GMW_DS_Fetch(IntPtriHandle, StringBuilder sbuf, IntPtr iBufSize,int iGetRecs);--Implementation in C++
{
long iHandle = 0;
long iOK = 0;
// Example 1:
// Get a small number of records and use a fixedsize buffer
//
// return all contact names at GoldMine Software
//
char *szSQL1 = "SELECT Contact FROM Contact1 "
"WHERE U_COMPANY LIKE 'GOLDMINE SOFTWARE%' "
"ORDER BY U_CONTACT";
// send DataStream SQL Query
if( (iHandle = GMW_DS_Query( szSQL1 )) > 0 )
{
// allocate buffer for 200 contacts at 40 charsper/name
long iBufSize = 200*40 +20;
char *szBuf = new char[iBufSize];// fetch first 200 records into buffer
iOK = GMW_DS_Fetch( iHandle, szBuf, iBufSize,200 );
// do whatever with the data
ODS( szBuf );
// make sure to delete the buffer
delete [] szBuf; szBuf = NULL;
// close the query
iOK = GMW_DS_Close( iHandle ); iHandle = 0;
}When I converted the code to Csharp, it throwsme an exception:
The error is at fetch function:
public static string searchContactByAccount(string account)
{
//lRes = GMW_DB_Read(lC2WA, "RecID",sRectID, (IntPtr)21);StringBuilder dataBuilder = newStringBuilder();IntPtr lC1WA, lRangeResult, lFetch;
lC1WA = GMW_DB_Open("Contact1");
int i;//MW_DB_Search(lC1WA, account,string sRecID);
//(GMW_DB_Seek(lC1WA, sAccount) ==1) returns right result; if (GMW_DB_Range(lC1WA, account, account, "") == 1)
//GMW_DB_Query("Select Contact FromContact1 Where Company LIKE 'deva'");
lRangeResult = GMW_DS_Query("SelectContact From Contact1 Where Company LIKE'deva'", "", "", "");if (lRangeResult != IntPtr.Zero)//if (GMW_DB_Search(lC1WA, "diva", "1") == 1)
{
GMW_DS_Fetch(lRangeResult,dataBuilder, (IntPtr)100, 3);return dataBuilder.ToString();
//return lFetch.ToString();
}
else
{
return "Not found";
}}
Customer reply replied 4 months ago
where is the answer please? My credit card had been debited by 95 dollars with no answer????
Was this answer helpful?

How JustAnswer works

step-image
Describe your issueThe assistant will guide you
step-image
Chat 1:1 with a programmerLicensed Experts are available 24/7
step-image
100% satisfaction guaranteeGet all the answers you need
Ask ATLPROG Your Own Question
ATLPROG
ATLPROG
ATLPROG, Computer Software Engineer
Category: Programming
Satisfied Customers: 7,677
7,677 Satisfied Customers
Experience: MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML

ATLPROG is online now

A new question is answered every 9 seconds

How JustAnswer works:

  • Ask an ExpertExperts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional AnswerVia email, text message, or notification as you wait on our site. Ask follow up questions if you need to.
  • 100% Satisfaction GuaranteeRate the answer you receive.

JustAnswer in the News:

Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.

What Customers are Saying:

My Expert answered my question promptly and he resolved the issue totally. This is a great service. I am so glad I found it I will definitely use the service again if needed.

One Happy CustomerNew York

Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help.

Mary C.Freshfield, Liverpool, UK

This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!!

AlexLos Angeles, CA

Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult.

GPHesperia, CA

I couldn't be more satisfied! This is the site I will always come to when I need a second opinion.

JustinKernersville, NC

Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around.

EstherWoodstock, NY

Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know.

RobinElkton, Maryland

< Previous | Next >

Meet the Experts:

ATLPROG

ATLPROG

Computer Software Engineer

7,677 satisfied customers

MS in IT.Several years of programming experience in Java C++ C C# Python VB Javascript HTML

LogicPro

LogicPro

Computer Software Engineer

7,175 satisfied customers

Expert in C, C++, Java, DOT NET, Python, HTML, Javascript, Design.

unvadim

unvadim

Computer Software Engineer

1,168 satisfied customers

Good knowledge of OOP principles. 3+ years of programming experience with Java and C++. Sun Certified Java Programmer 5.0.

lifesaver

lifesaver

Computer Software Engineer

950 satisfied customers

Several years of intensive programming and application development experience in various platforms.

ehabtutor

ehabtutor

Computer Software Engineer

936 satisfied customers

Bachelor of computer science, 5+ years experience in software development, software company owner

TheDoctor

TheDoctor

Software Engineer

893 satisfied customers

M.S. in Internet Information Systems

The-PC-Guy

The-PC-Guy

Software Engineer

848 satisfied customers

Extensive Knowledge in PHP, MYSQL, CSS & Javascript

< Previous | Next >

Related Programming Questions
Trying to help a friend with a business who wants a web site
Trying to help a friend with a business who wants a web site that integrates with Quickbooks. I have a friend that has a business selling promotional items. She is currently with Web.com , but she sta… read more
Techie_Ben
Techie_Ben
Software Engineer
Master\u0027s Degree
1,444 satisfied customers
I have a Vb6 app that set an object to call a function from
I have a Vb6 app that set an object to call a function from a .net dll. this function call an API. Once my app closes I lose that object. is there anyway I an keep this object open when my vb6 app clo… read more
Steven Caliendo
Steven Caliendo
Vocational, Technical or Trade Scho
99 satisfied customers
I need help with a C# XXXXX that takes an incoming email
I need help with a C# XXXXX that takes an incoming email that is a secured PDF and injects the password. Then converts the PDF into a .txt file and places this converted .txt file into another subfold… read more
Surreal_Software
Surreal_Software
9 satisfied customers
I am using the Google Maps API and when I use the geocode
I am using the Google Maps API and when I use the geocode function I receive a 610 Bad Key. I have tried regenerating an API key but it doesnt seem to work. Your help would be appreciated.… read more
sshaik
sshaik
Bachelor\u0027s Degree
Im reading some basics on API calls and Im just wondering
I'm reading some basics on API calls and I'm just wondering what program do I need to start making API calls?… read more
AAATom
AAATom
Software Engineer
Master\u0027s Degree
42 satisfied customers
For Eljoin, Hi Eljoin, I have a question for you. Do you
For Eljoin, Hi Eljoin, I have a question for you. Do you have an experience with C#. I have a sample ,can you modified it by my request? Thanks… read more
Eljon
Eljon
Software Developer Consultant
Associate Degree
562 satisfied customers
Hi, I am an expert hardware designer for specialised pc interface
Hi, I am an expert hardware designer for specialised pc interface cards such as digitisers & waveform generators. Each design requires some sort of simple(ish) menu-driven test programs. Typically a p… read more
Ingo U
Ingo U
Master\u0027s Degree
358 satisfied customers
Hi I am planning for online taxi/mini cab booking service
Hi I am planning for online taxi/mini cab booking service in my website for Greater London only. I have a problem to fix the prices because there are around 121 post codes and in each post code at lea… read more
Steve The IT Guy
Steve The IT Guy
Master\u0027s Degree
54 satisfied customers
I need to convert a net visual basic program to C# program.
I need to convert a net visual basic program to C# XXXXX How do I send you a file to convert.… read more
Alex
Alex
Sr. Software Engineer
Bachelor\u0027s Degree
332 satisfied customers
looking to hire a freelancer for developing a plug in in browsers
looking to hire a freelancer for developing a plug in in browsers for controlling images displayed What kind of expert do i need?web programmer ?plain programmer for what should i ask for?… read more
Alex
Alex
Sr. Software Engineer
Bachelor\u0027s Degree
332 satisfied customers
How do I access the google adwords api through MS Excel I
How do I access the google adwords api through MS Excel? I want to be able to pull the google adwords information in an excell sheet.… read more
Eljon
Eljon
Software Developer Consultant
Associate Degree
562 satisfied customers
how do I do a search with google api and retrieve values in
how do I do a search with google api and retrieve values in xml formats. I was to use c# XXXXX net… read more
Eljon
Eljon
Software Developer Consultant
Associate Degree
562 satisfied customers
C# Event Handling I am a C# noob, and I am using a DLL in
C# XXXXX Handling I am a C# XXXXX and I am using a DLL in a .NET environment. The Delegate that is in the DLL looks like this: public delegate void ResponseEventHandler(string ReceiverId, string Devic… read more
Dharmendra
Dharmendra
Master\u0027s Degree
275 satisfied customers
I need to extract a .csv into an array, and then search the
I need to extract a .csv into an array, and then search the array. How can I do this? So far I've gotten the .csv into the array but I can't search it without getting an error.… read more
Aaron
Aaron
Senior CRM Developer
Bachelor\u0027s Degree
28 satisfied customers
I need to create a button bar at the top of the screen that
I need to create a button bar at the top of the screen that is present all the time and thus I would like to restrict the client area for all following launched programs such as internet explorer etc … read more
Cherryl Lewis
Cherryl Lewis
Bachelor's Degree
180 satisfied customers
I wrote a Java (JDK 1.6 compliant) applet that runs embedded
I wrote a Java (JDK 1.6 compliant) applet that runs embedded inside a browser Window. The applet makes use of parameters (via the HTML tag), and uses the Java Swing API. I would like to convert this a… read more
NeOh
NeOh
Software Engineer
Bachelor's Degree
682 satisfied customers
I own and run a voice & video chat site....we host it all on
I own and run a voice & video chat site....we host it all on our servers...the chat is done in flash format, now my questions is....can I make it so that my chat can be downloaded to a computer then e… read more
Philip Chapman
Philip Chapman
Owner/Software Consultant
High School or GED
60 satisfied customers
I want to use an ordinary webcam focused on a subjects head. Either
I want to use an ordinary webcam focused on a subjects head. Either using markers or face recognition of some sort, I need the image to be fed into software that can tell if the subjects head is being… read more
brainbox nc
brainbox nc
Associate Degree
92 satisfied customers
Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Disclaimer: Information in questions, answers, and other posts on this site ("Posts") comes from individual users, not JustAnswer; JustAnswer is not responsible for Posts. Posts are for general information, are not intended to substitute for informed professional advice (medical, legal, veterinary, financial, etc.), or to establish a professional-client relationship. The site and services are provided "as is" with no warranty or representations by JustAnswer regarding the qualifications of Experts. To see what credentials have been verified by a third-party service, please click on the "Verified" symbol in some Experts' profiles. JustAnswer is not intended or designed for EMERGENCY questions which should be directed immediately by telephone or in-person to qualified professionals.

Show MoreShow Less

Ask Your Question

x