Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > Return char* Fr...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 6 Topic 43124 of 48020
Post > Topic >>

Return char* From DLL

by "Samant.Trupti@[EMAIL PROTECTED] " <Samant.Trupti@[EMAIL PROTECTED] > Feb 6, 2008 at 03:29 AM

Hi All,

 I am facing a problem can anyone help.

I have a function in DLL
void getString(char *string)
{
   strcpy(string, "My String);
  printf("In Dll %s", string);
}

I am calling this function in my win32 consol app

char mystr[50];
strcpy(mystr, "Test");
getString(myStr);
printf("in main %s", mystr);

The result I am getting is:
In Dll My String
In Main Test

Why DLL is unable to retutn value?  If I use this function in main it
is working fine.  DLL not working.
Can anyone please explain?
Thanks
Trupti
 




 6 Posts in Topic:
Return char* From DLL
"Samant.Trupti@[EMAI  2008-02-06 03:29:21 
Re: Return char* From DLL
GArlington <garlington  2008-02-06 06:53:59 
Re: Return char* From DLL
GArlington <garlington  2008-02-06 07:01:17 
Re: Return char* From DLL
Joe Greer <jgreer@[EMA  2008-02-06 16:14:03 
Re: Return char* From DLL
fred.l.kleinschmidt@[EMAI  2008-02-06 11:33:37 
Re: Return char* From DLL
James Connell <jconnel  2008-02-07 01:09:14 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Oct 14 8:56:10 CDT 2008.