Discussion:
Memcpy
(too old to reply)
Greg Fox
2007-11-17 18:12:35 UTC
Permalink
Raw Message
Hi, sorry if this sounds really stupid but I'm trying to convert a
piece of source code from C++ to Delphi and I'm hitting a lot of
barriers..... is there a native Delphi function equivalent to MemCpy?

Also does any of this WinAPI stuff make any sense in the context of
Delphi?




BOOL WINAPI DllMain( HINSTANCE hDll, DWORD dwReason, LPVOID
lpReserved )
{
// Disables the thread-specific routines (DLL_THREAD_ATTACH and
DLL_THREAD_DETACH).
DisableThreadLibraryCalls( hDll );

// Perform actions based on the reason for calling DllMain.
switch( dwReason )
{
// Do process-specific initialization.
case DLL_PROCESS_ATTACH:
// Call the Initialize function.
Initialize( );
break;

// Do thread-specific initialization.
case DLL_THREAD_ATTACH:
break;

// Do thread-specific cleanup.
case DLL_THREAD_DETACH:
break;

// Do process-specific cleanup.
case DLL_PROCESS_DETACH:
break;
}

return TRUE; // Successful DLL_PROCESS_ATTACH.
}
4e4en
2007-12-29 22:57:27 UTC
Permalink
Raw Message
Post by Greg Fox
Hi, sorry if this sounds really stupid but I'm trying to convert a
piece of source code from C++ to Delphi and I'm hitting a lot of
barriers..... is there a native Delphi function equivalent to MemCpy?
Also does any of this WinAPI stuff make any sense in the context of
Delphi?
BOOL WINAPI DllMain( HINSTANCE hDll, DWORD dwReason, LPVOID
lpReserved )
{
// Disables the thread-specific routines (DLL_THREAD_ATTACH and
DLL_THREAD_DETACH).
DisableThreadLibraryCalls( hDll );
// Perform actions based on the reason for calling DllMain.
switch( dwReason )
{
// Do process-specific initialization.
// Call the Initialize function.
Initialize( );
break;
// Do thread-specific initialization.
break;
// Do thread-specific cleanup.
break;
// Do process-specific cleanup.
break;
}
return TRUE; // Successful DLL_PROCESS_ATTACH.
}
Maybe CopyMemory?

CopyMemory(Destination: Pointer; Source: Pointer; Length: DWORD);
CopyMemory is wrapper for procedure Move

so you can use

Move( const Source; var Dest; count : Integer );

Loading...