machine dependency

I wrote some code in Visual,
I find them machine dependency.
At some PC, itcan work properly,but in other it can’t properly work,
some key code is here

int imagewidth=GetDocument()->GetImage()->GetWidth();
int imageheight=GetDocument()->GetImage()->GetHeight();
void* imageposition=GetDocument()->GetImage()->GetBits(0);
//CMainFrame * pMainFrm=(CMainFrame *)AfxGetMainWnd();

How do you define “work properly”? Or in other words what result do you expect and what result do you get?

Anyhow if you check the documentation:

The object coordinates presented by glRasterPos are treated just like those of a glVertex command. They are transformed by the current modelview and projection matrices and passed to the clipping stage. If the vertex is not culled, then it is projected and scaled to window coordinates, which become the new current raster position, and the GL_CURRENT_RASTER_POSITION_VALID flag is set. If the vertex is culled, then the valid bit is cleared and the current raster position and associated color and texture coordinates are undefined.

Since you are calling glRasterPos2d(-1.0, -1.0) the position is mostlikly invalid (unless you have a modell view matrix/projection matrix that flips this around).

If things dont work the way you want them, it is always a good idea to check for errors with glGetError(). When your play with rasterpositions you may also want to check if the GL_CURRENT_RASTER_POSITION_VALID flag is set.