Solved

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

Posted on 2010-11-09
3
970 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

726 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