Go to Post it is easy. you will have to define "easy" in your own terms. - Mike Martus [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #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"
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
PBASIC language syntax WizardOfAz Programming 14 30-04-2003 10:23
Question Obtaining Pbasic 2.5 PyroPhin Programming 3 18-01-2003 01:26
pbasic question Mike375 Programming 14 15-01-2003 06:54
PBasic Question Melissa H. Programming 28 17-11-2002 18:53
Another PBASIC Question Ian W. Programming 4 31-01-2002 21:36


All times are GMT -5. The time now is 12:16.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi