How to export a string in DLL?

H

huey_jiang

Hi All,

I have learned a number of demos of DLL creating, but all demos showed
only how to export integer in DLL. What I need is to wrap my new HASH
into a DLL that needs to export a string to APP. Simply speaking, my
hash in C looks like:

char *myHash(char *hashResult)
{
........
return hashResult;
}

and in C++ looks like:

class funHash
{
public:
char *hashResult;
void doHash(char *mesg);
}
void funHash::doHash(char *mesg)
{
.........
strcpy(hashResult,...);
}

Whatever, I need my Application to receive the hashResult. Then, while
I made my funhash.dll, I tried to export the string of hashResult with:

char *myDLL::GetHashVal()
{
......
return hashResult;
}
My VC++ 6.0 did not take this kind of return. I knew people succeeded
at exporting integer by simply doing *return*. Anybody can help me out
at this string exporting? Thanks a lot!

Huey
 
B

BigBrian

The C++ language does not support DLL's. VC++ is a particular vender's
implementation of C++ and thus discussion about it specifically is off
topic in this newsgroup. This newsgroup is about the C++ langauge
itself.

-Brian
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,291
Messages
2,571,491
Members
48,148
Latest member
Benzed8701

Latest Threads

Top