Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CopyMemory

Status
Not open for further replies.

avni

Programmer
Jan 13, 2000
1
US
Hi,<br>
I have a user defined structure in a module. I am calling a function and then I want to copy the data from one structure to another so I am using CopyMemory.<br>
I am using two CopyMemory calls in one sub...When the program gets to the second copymemory call, it crashes.<br>
<br>
Any ideas on how i can fix this???<br>
Thank you.<br>
<br>
Avni
 
I would say that there was a problem with the first call to CopyMemory which only showed up when you made the second call. Can you post your actual code? <br>
<br>
What is usually the case is you are passing a pointer to the address of your structure, rather than just the address. So you are (probably) copying x bytes to/from an unintended memory address.<br>
<br>
Chip H.<br>

 
One thing to make sure of is that you've DECLARED CopyMemory as a SUB and not a FUNCTION. Declaring it as a function is usually instant death - often to the IDE as well!<br>
<br>
-Ian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top