OpenGL Shaders in SolidWorks problem

Hi,

 

I've been trying to draw some custom 3D objects in SolidWorks using OpenGL. This works when I use the immediate mode in OpenGL or VBO.

However, I want to use shaders. I am using the glad library for the OpenGL.

I create and load the data in the VBO's in the swBufferSwapNotify event handler. When I call a method to draw the objects using the VBO's - everything looks ok. But if I use a fragment shader, I get a full screen fill, which remains until the first hover over the component and appears again when I try to rotate the camera (image 1, image 2). 

If I also use a vertex shader, then objects belonging to SolidWorks fall into it.(image 3)

What can be wrong?

image 1

  

image2

image3

SolidworksApi/macros