• Welcome to World Machine Community. Please login or sign up.
 
July 15, 2019, 12:02:46 pm

News:

Read the Development Diary for an inside look at World Machine's progress!



Post reply

The message has the following error or errors that must be corrected before continuing:
Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.
Note: this post will not display until it's been approved by a moderator.
Other options
Verification:
Please leave this box empty:
Type the letters shown in the picture
Listen to the letters / Request another image

Type the letters shown in the picture:

Shortcuts: ALT+S save/post or ALT+P preview

Topic summary

Posted by howardzzh
 - July 14, 2007, 10:34:54 pm
Thank you, Alex. I just posted the first part of the plug-in series here, I will start working on the next part and hopefully, I can finish them before the WM Pro version comes out.
Posted by Alexander
 - July 13, 2007, 10:20:35 am
Just wanted to add that a lot of people are looking forward to your plugins Howard.  :D
Posted by howardzzh
 - July 10, 2007, 06:22:49 pm
Thank you for clarifying this.
Posted by Stephen
 - July 10, 2007, 03:04:24 pm
Yes.. I just looked into it, and TextOutput output was temporarily disabled. Text I/O is there on a "might be useful" basis rather than being actively used by WM devices right now, so its definitely off of the high traffic code path and I didn't notice. Fixed.


Posted by howardzzh
 - July 08, 2007, 10:08:12 pm
Thank you Remnant.
     After using WMAlloc() to allocate the memory for the TextPacket body, I no longer get any exception from switching between different views. However, I still have two questions.

1.  Was the function "void TextPacket::setText(const char *txt)" defined in the libraries included in the PDK? The reason I ask this question is because it showed up as an undefined reference for me when I built my device. That's why I have to write my own setText function which is probably incorrect. I would like to use the official version if somehow I just missed.


2. I probably used the text output device in an incorrect way since I still could not get it to write any text to a file.

Here is how I added a second output port in the constructor
    AddPort(0, 1, WMP_text, -1);

Here is how I tried to store the data to the output

bool PluginPPA::Activate(BuildContext &context)
{
    ...
    StoreData(txtBranchPoints, 1, context);
    ...
}


I also tried to simply link the "Text input" device to the "Text output" device and could not get it to output a text file.  What I did was to link it to a text output port, build the whole thing, specify the output filename, and then click the "Write ouput to disk!". I wonder if I did anything wrong with the "Text output" device. Thank you for the help.
Posted by Stephen
 - July 08, 2007, 05:31:15 pm
The text packet body text must be allocated from the WM Core's heap, otherwise there will be potential problems across DLL boundaries. Use WMAlloc() and WMFree() to allocate/delete text.

The Text Output device should output text to the file you specified if the above is correct.
Posted by howardzzh
 - July 07, 2007, 08:36:25 pm
Hi everyone,
    I encounted an linking error while outputing a TextPacket from a device that I am creating. The error message said that void TextPacket::setText(const char *txt) is an undefined reference. I wonder if it's because the library file wasn't included in the PDK or if the function is not defined yet.

I've temporarily bypassed this problem by defining my own inline function in the TextPacket.h to overide the default setText.

inline void TextPacket::setText(const std::string& txt)
{
   int len = txt.length();
   body = new char[len+1];
   memcpy(body, txt.c_str(), len);
   body[len] = NULL;
}

However, I could not get the "Text Output" device (which is hooked to the text output of my device) to write a file to the disk. There is no error or warning, just that the "Write output to disk" didn't do anything. Also, after the device is built, it will result an exception whenever I want to switch to either the "Layout view" or the "Explorer view". The device behaves fine if I just swith between the other views.

I wonder if I missed anything here. I would really appreciate your help if you've had similar experience. Thank you!