Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DLL Talk / Passing strings to a function

Author
Message
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 12th Apr 2009 22:52
Ok How do i pass a string to my function and call it with messageboxA or something like that?

New Site! Check it out \/
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Apr 2009 00:58


You can use LPCSTR or const char*. I use const versions as a reminder that I'm not supposed to change the contents of these strings - the compiler will throw an error out if you do anything that you shouldn't.

Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 13th Apr 2009 03:25
Oh duh lol thanks i'm dumb hahaha

New Site! Check it out \/
AndrewT
17
Years of Service
User Offline
Joined: 11th Feb 2007
Location: MI, USA
Posted: 13th Apr 2009 03:27 Edited at: 13th Apr 2009 03:27
Just make sure that your project is set to use multi-byte characters rather than Unicode; I think projects default to Unicode. However if for whatever reason you don't want to change the settings then just use MessageBoxA like you said.

i like orange
Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 13th Apr 2009 05:17
Well actually i had been using just plain messagebox but with the _T() function to pass strings. but i just realized while i was writing it it would be better to use messageboxa (or Whatever function A lol)

New Site! Check it out \/
IanM
Retired Moderator
21
Years of Service
User Offline
Joined: 11th Sep 2002
Location: In my moon base
Posted: 13th Apr 2009 13:02
AndrewT's suggestion is a better and easier way.

Caleb1994
15
Years of Service
User Offline
Joined: 10th Oct 2008
Location: The Internet you idiot!
Posted: 13th Apr 2009 18:52
I will just do it that way thanks.

New Site! Check it out \/

Login to post a reply

Server time is: 2024-04-20 01:28:59
Your offset time is: 2024-04-20 01:28:59