Solved

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

Posted on 2010-11-09
3
964 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 Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
This video discusses moving either the default database or any database to a new volume.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

762 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now