Go to Post I'm excited. Probably too much, but eh, I'm a big geek. - Brandon Martus [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 19-01-2003, 12:27
Adam Shapiro's Avatar
Adam Shapiro Adam Shapiro is offline
Registered User
FRC #0555 (Montclair Robotics)
Team Role: Alumni
 
Join Date: Jan 2002
Rookie Year: 2001
Location: Montclair, NJ
Posts: 401
Adam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud ofAdam Shapiro has much to be proud of
Send a message via AIM to Adam Shapiro
C++ Code Error?

I'm trying to use memcpy to set a vertex buffer for Direct3D but when I send the vertex array, it shuts the program. The memcpy definition asks for a const void * but I am using code that has worked on different machines with a normal void *. I have even gotten it to work before but I just added something that changes the verticies after they have been declared and now it won't work...

Sample code:
struct D3DVERTEX
{
float x,y,z,nx,ny,nz;
};
VOID *pVertex;
D3DVERTEX cvVertex[]={{1,2,3,0.0f,0.0f,0.0f,},};
cvVertex.nx=5.0;
memcpy(pVertex,cvVertex,sizeof(cvVertex));
-->CRASH!!!

I have had the same problem when sending a dynamic string to MessageBox... I think it is a problem with sending dynamic to static but other people have gotten it to work!! Any suggestions?
__________________
Mentor to Teams 555, 1929, and 2070!
Currently working in hardware design at Cisco.
Cornell University DARPA Urban Challenge - http://www.cornellracing.com
Co-Captain Team 555 - 2003,2004,2005
Trust, Love, and Magic
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
What is your most prefered programming language? Hailfire Programming 156 19-01-2005 21:42
EMERGENCY! EPROM FULL error?!? CHSguard72 Programming 2 05-03-2003 20:51
Autonomous code PBoss Programming 7 14-01-2003 15:29
Does your team use the Default code. Jeff McCune General Forum 2 09-01-2003 14:46
Error found in programming for the pump and pressure switch sjharobotics Programming 4 06-02-2002 17:46


All times are GMT -5. The time now is 10:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi