Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
CopyMemory...where are you?
Message
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00155597
Message ID:
00155974
Views:
27
>>>>>OK, I give up. I've been trying (without success) to locate one of the documented functions in the Win32 SDK. The function (CopyMemory) copies a block of memory from one particular address to another. Unfortunately, I can't find what DLL it's in. Defining it as being "IN Win32API" results in a "Cannot find..." error.
>>>>>
>>>>>After doing some research, it, apparently, is in one of the Visual C runtime DLLs. But I can't find it. So this prompts two possible questions. Further, declaring it in any of the four Mscvrt dlls results in the same error.
>>>>>
>>>>>First, can this function be used from VFP?
>>>>
>>>>George, I believe that this is a part of a static library bound to the executable directly. To expose it, you'd have to write a .DLL that exposed the call.
>>>>
>>>>BTW, a quick look at Winbase.H shows it to be a macro referencing RtlCopyMemory, which is in fact defined in WINNT.H as a macro referencing memcpy(). IOW, I don't think we can get there from here...
>>>>
>>>>>
>>>>>Second, if so, where is it?
>>>>>
>>>>>MTIA,
>>>
>>>Hi Ed,
>>>
>>>Yeah, that's what I think too. Saw the references in the winbase and winnt header files. Guess I just didn't want to believe it. The SDK makes no reference to the macro business, so I was hoping against hope that I just couldn't find it. Sigh, back to lstrcpy.:-(
>>
>>Seeing this thread made me do some hunting in the MSDN library where I found Knowledge Base article #Q129947. It's written for Visual Basic but I think you will find it right on point. There's no reason you can't alias the function(s) in VFP as is suggested for VB.
>>Good Luck.
>
>Hi Dore,
>
>Thanks a heap (pun intended :-)). I meant to look in my MSDN library here at the office for information. Interestingly, I think I tried to declare the function as RtlCopyMemory, but it generated the same error. Must've misspelled it or something.
>
>Thanks again,

You're welcome. Puns are always appreciated. I think you and Ed Rauh are both seeing it but not letting it sink in. The KB article isn't just about the aliasing of CopyMemory, mempy and RtlCopyMemory it's that if you want to get the memory copying function you basically have to use RtlMOVEMemory (my empasis) which basically performs the same function except in cases of overlapping memory ranges. RtlCopyMemory won't work because it's still refers to an unexported C function. RtlMoveMemory is accessible, however.
-Dore
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform