Jump to content

Welcome to eMastercam

Register now to participate in the forums, access the download area, buy Mastercam training materials, post processors and more. This message will be removed once you have signed in.

Use your display name or email address to sign in:

draw_txt_on_screen()


wire123
 Share

Recommended Posts

draw_txt_on_screen(p_3d pt, char txt[], byte color);

Anybody have any experience with the above function, pg. 9-3 of the chook manual.

When I run it, my system throws a nasty error from unknown module and wants to shut down Mastercam.

 

Thanks.

Link to comment
Share on other sites

Sorry about that, here you are.

 

static void WR190( variables)

{

p_3d TxtLoc; //for draw_txt_on_screen() way below

char textOut[20] = {{'0'}};

strcpy ( textOut, "Flat: .562");

 

//many lines of working code

 

if( pt55[X]>0 )

{ TxtLoc[X] = pt55[X];

TxtLoc[Y] = pt55[Y] + 1.0;

TxtLoc[Z] = 0;

draw_txt_on_screen (TxtLoc, textOut, RED); //blows up

}

} //MyFunc() end

 

This program has performed and illegal operation and will be shut down.

 

LATHE8 caused an invalid page fault in

module at 00de:00000009.

Registers: blah, blah, blah

Link to comment
Share on other sites

I'm not sure why it's crashing for you. Perhaps try using sprintf() to add data to your string instead of strcpy(). I try to avoid character arrays whenever possible (the STL rocks!) and I can't recall if strcat() appends the terminator to the end of the string or not. sprintf() does, though.

 

But I've found that draw_txt_on_screen() doesn't write to the DB. So if it creates text on the screen, the moment the graphics window updates itself, your newly created text vanishes. If you want it to stay on the screen, look into creating a note or a witness.

Link to comment
Share on other sites
  • 4 weeks later...

Sorry for the delay, I was pulled to other projects.

Here are my date time stamps.

With the char array I also tried:

char txtout[]="some text to print";

 

m_init.obj 01/25/01 3:16pm

m_ptrs.obj 01/25/01 3:16pm

 

I really don't need the text to say around past the initial screen.

Link to comment
Share on other sites

Wire123,

We did indeed correct something in the C-Hook development kit related to draw_txt_on_screen() AFTER January 2001. Do you have a V8.1.1 CD? The correction is in the C-Hook kit on that CD (which is dated @ April 2001). Even better - do you have access to V9? If so, the fix is there too (and you'll get more help).

If you don't have anything beyond V8.1, e-mail me at [email protected] and I'll see what I can do for you

 

Pete Rimkus ("ProductDevelopmentGuy")

CNC Software, Inc.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.

Join us!

eMastercam - your online source for all things Mastercam.

Together, we are the strongest Mastercam community on the web with over 56,000 members, and our online store offers a wide selection of training materials for all applications and skill levels.

Follow us

×
×
  • Create New...