View Single Post
  #3   Spotlight this post!  
Unread 18-08-2003, 13:33
Raven_Writer's Avatar
Raven_Writer Raven_Writer is offline
2004 Detroit & Pittsburgh Winners
AKA: Eric Hansen
FRC #0005 (RoboCards)
Team Role: Mentor
 
Join Date: Jan 2003
Rookie Year: 2002
Location: Melvindale
Posts: 1,549
Raven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really niceRaven_Writer is just really nice
Send a message via ICQ to Raven_Writer Send a message via AIM to Raven_Writer Send a message via MSN to Raven_Writer Send a message via Yahoo to Raven_Writer
Quote:
Originally posted by gwross
You're talking about the editor you're writing, right? My guess is that you're sending the wrong buffer length to the tokenizer.
Yes, I am

I don't know if this will help, but here is the code I use to tokenize the code:
Code:
void CMainFrame::OnDlcode() 
{
	CMainFrame *pFrame = (CMainFrame*) AfxGetMainWnd();    // Get frame window class
	CFIRSTEditorView *pView = (CFIRSTEditorView*) pFrame->GetActiveView();
	
	char *szBuffer = new char[66356];
	
	// Use if below fails to do memory right: char *szBuffer = new char[pView->GetWindowTextLength()];     // New 'char' pointer array based on window text length
	pView->GetWindowText(szBuffer, pView->GetWindowTextLength());     // Get view window text

	tModRec.SourceSize = strlen(szBuffer);

	Compile(&tModRec, szBuffer, false, true);

	if(tModRec.Succeeded == true){
		StatusBarMessage("Tokenize successful!"); // Tell the user it went smoothly
	}
	else{
		StatusBarMessage(tModRec.Error);
	}

	delete [] szBuffer;
}
char *szBuffer = new char[66356]; <-- 66356 is max amount of text that the TModuleRec source buffer can hold

pView->GetWindowText(szBuffer, pView->GetWindowTextLength()); // Get view window text <-- For some reason, I got a feeling it has to deal w/ this, or the szBuffer part.

This is in MFC also.

<<EDIT>>: I forgot to say that I was using the wrong way to do the STAMP, it's ' {$STAMP BS2p}, not ' {$STAMP S2p} :<</EDIT>>
__________________
AIM: wisprmylastbreth
EMail: nightskywriter@gmail.com
Y!: synsoflife

"ai yoru ga" -- "Love the nights"