Because C++ does not allow implicit cast from void* to something that is not void*. Just add (Char*) before MemHandleLock, and it will compile. This same line will compile in C as is, because C is more lenient with void* casts
On 7/23/07, Jeremy Swanson <[EMAIL PROTECTED]> wrote:
Mystring is initialized with Char* mystring; It is a pointer by definition, and as far as I know, would not require any conversion. Why is this happening? -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Ravi.Patel Sent: Monday, July 23, 2007 6:41 PM To: Palm Developer Forum Subject: RE: Using MemHandleLock in C++ implicit conversations are forbidden. explicit conversations are not mystring = (std::string*/char*) MemHandleLock((void *)mhandle); or better yet use static_cast<string*>(MemHandleLock((void *)mhandle)); Ravi -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of [EMAIL PROTECTED] Sent: Monday, July 23, 2007 6:32 PM To: Palm Developer Forum Subject: Using MemHandleLock in C++ I am now using C++ properly thanks to all of your help. However, when I use the following statement, mystring = MemHandleLock((void *)mhandle); it returns the errors, ANSI C++ forbids implicit conversion from 'void *' in argument passing ANSI C++ forbids implicit conversion from 'void *' in assignment When I use... mystring = MemHandleLock(mhandle); I only get the assignment error. I tried enclosing that single statemtent in an extern "C" block, I got all kinds of other errors, so that is out. Is MemHandleLock() just not useable in C++? -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/ -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/ No virus found in this incoming message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.11/909 - Release Date: 7/20/2007 4:39 PM No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.5.476 / Virus Database: 269.10.11/909 - Release Date: 7/20/2007 4:39 PM -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
-- Best Regards, Dmitry Grinberg Software Engineer, http://PalmPowerups.com (847) 226 9295 AIM: DmitryGrinberg MSN: [EMAIL PROTECTED] ICQ: 165589894 Y! IM: dmitrygr2003 -- For information on using the ACCESS Developer Forums, or to unsubscribe, please see http://www.access-company.com/developers/forums/
