Solved

Help with: object contains non-primitive or non-blittable data

Posted on 2010-11-09
3
971 Views
Last Modified: 2012-05-10
Hello can anyone help me with the following error? I have attached a screen shot.
Also see the declaration statements of the pertinent functions.
GL-Functions.docx
Current-Error.bmp
0
Comment
Question by:sn1fflez
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 34128085
You can only marshal pinned delegates that have blittable types.  The following reference MSDN article talks about blittable and non-blittable types.

Blittable and Non-Blittable Types
http://msdn.microsoft.com/en-us/library/75dwhxf7(v=VS.100).aspx

Why are you using the delegates, instead of passing the arguments to the p/invoke declarations directly?
0
 

Accepted Solution

by:
sn1fflez earned 0 total points
ID: 34166917
I was able to solve my problem with the following code:
 Dim x_dim As Single = WorkC(1) * 0.5
        Dim y_dim As Single = WorkC(2) * 0.5
        Dim z_dim As Single = WorkC(3) * 0.5

        Dim vertices() As Single = { _
        x_dim, y_dim, z_dim, -x_dim, y_dim, z_dim, -x_dim, y_dim, -z_dim, x_dim, y_dim, -z_dim, _
        x_dim, y_dim, z_dim, x_dim, y_dim, -z_dim, x_dim, -y_dim, -z_dim, x_dim, -y_dim, z_dim, _
        x_dim, y_dim, z_dim, x_dim, -y_dim, z_dim, -x_dim, -y_dim, z_dim, -x_dim, y_dim, z_dim, _
        -x_dim, y_dim, z_dim, -x_dim, -y_dim, z_dim, -x_dim, -y_dim, -z_dim, -x_dim, y_dim, -z_dim, _
        -x_dim, -y_dim, -z_dim, x_dim, -y_dim, -z_dim, x_dim, y_dim, -z_dim, -x_dim, y_dim, -z_dim, _
        x_dim, -y_dim, -z_dim, -x_dim, -y_dim, -z_dim, -x_dim, -y_dim, z_dim, x_dim, -y_dim, z_dim}

        Dim indices() As Byte = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, _
                                 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24}

        Gl.glEnableClientState(Gl.GL_VERTEX_ARRAY)
        Gl.glVertexPointer(3, Gl.GL_FLOAT, 0, vertices)
        Gl.glDrawElements(Gl.GL_QUADS, 24, Gl.GL_UNSIGNED_BYTE, indices)
        Gl.glDisableClientState(Gl.GL_VERTEX_ARRAY)

Open in new window

0
 

Author Closing Comment

by:sn1fflez
ID: 34195041
I solved the problem
0

Featured Post

Instantly Create Instructional Tutorials

Contextual Guidance at the moment of need helps your employees adopt to new software or processes instantly. Boost knowledge retention and employee engagement step-by-step with one easy solution.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
If you're writing a .NET application to connect to an Access .mdb database and use pre-existing queries that require parameters, you've come to the right place! Let's say the pre-existing query(qryCust) in Access takes a Date as a parameter and l…
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…
This is a high-level webinar that covers the history of enterprise open source database use. It addresses both the advantages companies see in using open source database technologies, as well as the fears and reservations they might have. In this…

691 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question