ZBrushCentral

ZBrush crashes after running DLL

Hello,

I’ve written a DLL for ZBrush using Purebasic. I tested the DLL from another program and it worked fine. But when I called the DLL from ZBrush it causes ZBrush to crash and burn.

The DLL is just a test for now and only displays a message requester of a passed string from a equally simple ZScript:

[IButton,“Test”,“Testing 123”,
[IPress, Tool:Export]
[FileExecute,TestDLL.dll,TestDLL,[FileNameGetLastTyped]]
]

Any ideas please?

Just guessing here:

Try putting the FileNameLastTyped into a variable first, then include that in the FileExecute command?

[VarSet, FName, [FileNameGetLastTyped ] ]

Maybe you also need to include a test that a filename was actually recovered before making the FileExecute command?

Sven

Thanks for your suggestions, Sven!. I tried them but they didn’t have any effect.

The DLL actually runs fine and carries out its mission to display the passed Filename. The ZBrush crash only occurs the moment I close the message requester that my DLL displays.

Umm… Perhaps message requesters are illegal in DLL’s?. I’ll go test! :slight_smile:

Nah, still no luck. Instead of a message requester, I made a DLL that just creates an empty file and ZBrush still crashed. There’s obviously something drastic happening after the DLL is returning control back to ZBrush.

DLLs for ZBrush are best written following the guidelines in this thread, post #12:
http://www.zbrushcentral.com/zbc/showthread.php?t=24066

The instructions are for C++, specifically for Visual Studio. I’ve no idea whether you can adapt your PureBasic code, or whether it will compile appropriately.

Thanks for the link, Marcus!

I never did get it working, but one of these days (when I got my strength back) I’m gonna have another go! :slight_smile: