Create WindowStream (C++ / C#)

Create WindowStream (C++ / C#)

denisT.MaxDoctor
Advisor Advisor
825 Views
4 Replies
Message 1 of 5

Create WindowStream (C++ / C#)

denisT.MaxDoctor
Advisor
Advisor

Is there any way to create a new WindowStream value?


C#

just doesn't have constructors for WindowStream or any Create method

 

C++
according to WindowStream.h there are two constructors:

 

 

 class WindowStream : public CharStream
 {
 public:
 	HWND		window;
 	int			cursor;
 	MSTR		title;
 	Listener*	listener;
 	CharStream*	log;
	MCHAR		wputs_buf[512];			// edit control output buffer
	MCHAR*		wputs_p;
	HWND		echo;
 
	// Constructor / Destructor
 				WindowStream(HWND iwin);
 				WindowStream(const MCHAR* title);		/* for background scripts; window with given title will open if output generated */
 			   ~WindowStream();

 

 


but neither of the two works...

 

but MXS:

 

newScript() 

 

 

makes it somehow.

 

Am I missing something?

 

Sure, I could execute MXS (string, script) from c# or c++, but that's not the point of the problem. I'm specifically interested in how to make an instance of WindowStream using SDK methods or know at least the way MXS does.

 

0 Likes
826 Views
4 Replies
Replies (4)
Message 2 of 5

klvnk
Collaborator
Collaborator

the_listener->edit_stream->window has a class of "MXS_Scintilla"

 

also...

 

 

 

 // Collectable::flags3 - bit 0 set if WindowStream is wrapping a MXS_Scintilla edit control. If not, standard
 // edit control is assumed

 

 

 

would suggest you have pass a window of class Edit Control (Collectable::flags3 - bit 0 not set) or a MXS_Scintilla edit control (not sure how this would be done) in the constructor with the bit set.

 

0 Likes
Message 3 of 5

denisT.MaxDoctor
Advisor
Advisor

@klvnk wrote:

the_listener->edit_stream->window has a class of "MXS_Scintilla"

 

also...

 

 

 

 

 // Collectable::flags3 - bit 0 set if WindowStream is wrapping a MXS_Scintilla edit control. If not, standard
 // edit control is assumed

 

 

 

 

would suggest you have pass a window of class Edit Control (Collectable::flags3 - bit 0 not set) or a MXS_Scintilla edit control (not sure how this would be done) in the constructor with the bit set.

 


As I understand, this flag is for WindowStream value in case it works with a Scintilla window. I just can't create a new stream as the constructors are not published:

denisTMaxDoctor_0-1696352762391.png

 



 

0 Likes
Message 4 of 5

istan
Advisor
Advisor

proper lib is included for linking?

0 Likes
Message 5 of 5

denisT.MaxDoctor
Advisor
Advisor

@istan wrote:

proper lib is included for linking?


sure... it's Maxscrpt.lib ... it's impossible not to include 😁 

0 Likes