Solved

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

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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

765 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