[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference abbott::visual_basic

Title:Microsoft Visual Basic
Moderator:TAMARA::DFEDOR::fedor
Created:Thu May 02 1991
Last Modified:Thu Jun 05 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2565
Total number of notes:10453

1484.0. "Neat way to access pointers from VB..." by TAMARA::PCMART::hull (Windows Consultant) Thu Jul 28 1994 16:12

T.RTitleUserPersonal
Name
DateLines
1484.1Has Copy moved to another lib ?GVPROD::MSTEINERWed Jun 04 1997 07:154
    Would you know where is "Copy" in Windows NT 4.0 ? (I've tried with
    gdi32.dll, but it tells me "can't find DLL entry point in gdi32" !)
    
    Michel.
1484.2Try Kernel32EVTSG8::TOWERSWed Jun 04 1997 08:276
    The main controversial aspect to NT4 was that Microsoft moved a lot of
    stuff from GDI to Kernel32, so that's the obvious place to look. There
    you'll find CopyMemoryLpToLp/Byte/Str etc.
    
    Cheers,
    Brian
1484.3No success... yet !GVPROD::MSTEINERWed Jun 04 1997 14:3523
    Re .-1
    
    I didn't find CopyMemoryLpToLP in kernel32, nor in any other standard
    DLL (How did you manage to find this name ?). However, I find a
    CopyMemory (alias memcpy, alias RtlCopyMemory, alias RtlCopyMemory32)
    in the VC++ DLL's (MSVCRT*.DLL). Now, the problem is that I don't find
    how to declare/use it so that it does not generate a "bad DLL calling
    convention" !!! :-(
    
    Declare Sub memcpy Lib "msvcrtl.dll" _
       (dst As Any, src As Any, ByVal nCount as Long)
    
    Dim ACE1 As ACCESS_ALLOWED_ACE
    Dim pACE as long
    
    ' Get pACE from a call to GetACE
    ...
    Call memcpy(ACE1, ByVal pACE, Len(ACE1))
    
    It looks like the first two parameters are declaired in C as VOID. Is
    that the problem ? (VB docs says this translates to a Sub !).
    
    Michel.
1484.4EVTSG8::TOWERSThu Jun 05 1997 04:3910
    Michel, CopyMemoryLpToLP came from a .tlb file (type library). I
    suspect that it is generated via aliasing something else. That is, the
    different flavours of CopyMemoryLPToxxx are generated by aliased
    declarations refering to the same underlying routine.
    
    I've used CopyMemory on a previous project I'll try and look up an
    example for you to put in tomorrow.
    
    Cheers,
    Brian
1484.5RtlMoveMemory does the jobGVPROD::MSTEINERThu Jun 05 1997 04:5313
    To make a long story short...
    
    - I did not manage to get this "memcpy" work !
    - I found a "RtlMoveMemory" in kernel32.dll, and it does the job I want
      (yes, it works... finally... !).
    
    I'll have a look at these type library files anyway. I'm interested to
    better understand the subject...
    
    Thanks for your help, it's appreciated.
    
    Cheers,
    Michel.