Where di my VB function go?

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hi all,

I've been working on an interprocess messaging system which is used by
VB to send messages to other VB apps. I designed a C++ DLL interface,
which takes care of the storing and transmission of messages to the
other processes. Everything works great, except, i want to be able to
call a VB Message handler function from within my C++ Message handler
thread. Essentially the VB app calls a C function i wrote to give the
address of the VB Mesage Handler function to the C++ DLL and store it
in the global area of the process's virtual memory space, then later on
when a message comes into the C++ Message_handler thread, the C++
Message_Handler calls the address of the Passed VB function (which was
placed into virtual memory earlier, as was just discribed) and passes
the relavent message parms to the VB Function (via the stack)

However, i get an access violation. Now, i did some Debugging, and i
found out that when i pass the address of my VB function; that when the
function address is being passed to C++ that the function's machine
code actually resides in memory (at the location of the function
address). Now when i have a message coming in (at a latter time) and i
attempt to call the VB function from C++ (i have the VB functions
address becuase it was sent to me earlier as described above), i find
out that the VB function no longer exists at the address of when the VB
function address was passed initially.

It's like the VB function is dynamically allocated when it is to be
ran, then destroyed afterward. Is there anyway i can force this VB
function to remain at a given place in the process's virtual memory
space, or is there a way to determine where the function will reside
when i need to call it from C++

Thanx for your help
Nate

.



Relevant Pages

  • Re: Where di my VB function go?
    ... VB to send messages to other VB apps. ... I designed a C++ DLL interface, ... call a VB Message handler function from within my C++ Message handler ... in the global area of the process's virtual memory space, ...
    (microsoft.public.vb.winapi)
  • Re: Many Apps = System Slowdown?
    ... But I notice that a lot of apps use more and more virtual ... eventually using 1 and even 2 gigabytes of virtual memory. ... would adding ram fix this? ...
    (comp.sys.mac.system)
  • Re: Virtual Memory Setting problems
    ... After 60 hours runing our apps, ... boss want to use virtual memory to let our apps run longer and meet our need ... Is it a hardware problem or software configuration problem? ... "Slobodan Brcin " wrote: ...
    (microsoft.public.windowsxp.embedded)
  • Re: Many Apps = System Slowdown?
    ... apps like mds and WindowServer). ... But I notice that a lot of apps use more and more virtual ... eventually using 1 and even 2 gigabytes of virtual memory. ...
    (comp.sys.mac.system)
  • Re: Many Apps = System Slowdown?
    ... But I notice that a lot of apps use more and more virtual ... eventually using 1 and even 2 gigabytes of virtual memory. ... Adding RAM would postpone it, but depending on how many apps you run ...
    (comp.sys.mac.system)