Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » C++ language problems and code snippets » DLL and U++ type
Re: DLL and U++ type [message #2199 is a reply to message #2192] Mon, 03 April 2006 22:58 Go to previous messageGo to previous message
mauro.bottizzo is currently offline  mauro.bottizzo
Messages: 2
Registered: April 2006
Junior Member
Well,
it's running.

Last little question about that.

I need to keep the pointer of an object, returned from my DLL function, and use it in others DLL function.

First solution that i know is to include with the DLL the header with my class declaration; but I don't like that.
Second solution that i found is to return the pointer like a integer value, named "handle", and use it like a pointer when need again. I am thinking something like when using "new", but the pointer it's get from my integer var. Example:

bool MyDllFunction(unsigned int handle, ...) {
MyType *foo;
foo = (MyType *)handle;

MyType->....
...


}

All this now it's running well, but the question is: It's correct to use an integer for store an pointer? Or need to use an different var type??

thanks.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: capturing stdout/err/in of subprocess
Next Topic: Inverse palette conversion algorithm...
Goto Forum:
  


Current Time: Sat Jun 08 03:28:25 CEST 2024

Total time taken to generate the page: 0.01650 seconds