Right now, I am developing a demo Photoshop plug-in software to understand the way to implement Photoshop plug-in. However, I meet a issues that I can not create a Thread on Photoshop plug-in by CreateThread() API. I implement as below:
Main function:
CreateThread( NULL, 0, Test1Thread, NULL, 0, NULL);
Thread function:
DWORD WINAPI Test1Thread(LPVOID pParam)
{
/*Do something*/
return 0;
}
When I compile and load plug-in on Photoshop, it show an error message like this:
The instruction at ''0x09fd100a'' referenced memory at ''0x09fd100a''. The memory could not be ''read''
Click on OK to terminate the program
Click on CANCEL to debug the program
Can you give me some suggestions that I can create a Thread by CreateThread() API on Photoshop plug-in or not? And how can I create Thread?
I am looking forward your answer.
Thanks for your help,
Hieu Nguyen.
PS: I am developing on Window OS and Visual C++ development tool.
Create Thread on Photoshop Plug-in
Jus trying to figure out how to put multiple pics on one layer in photoshop . im actually trying to make a custom top 8 for myspace .
But when i open 1 pic and try and open another on the same layer , it closes
Create Thread on Photoshop Plug-in
Your sample does nothing in the thread. Is that the case when you
test?
I would speculate that you can create a thread, but it must not use
any Photoshop API methods.
Aandi Inston
Thanks Aandi Inston and Marcus Phillips for your answer.
In thread I just use Named Pipe inter-process communication mechanism to send signal to the other application. So I do not use any Photoshop API.
However, it is strange that I can not put my Thread in begin of PluginMain function:
DLLExport SPAPI SPErr PluginMain
( char* caller, char* selector, void* message)
{
SPErr error = kSPNoError;
SPMessageData *basicMessage = NULL;
SPPluginRef plugInRef = NULL;
SPErr err = 0;
basicMessage = (SPMessageData *) message;
sSPBasic = basicMessage-%26gt;basic;
gPlugInRef = basicMessage-%26gt;self;
MyThread();/*CAN NOT RUN THE THREAD!!!!*/
}
I must change my Thread function to position after checking caller parameter
Please show me the reason why?
Thanks,
No comments:
Post a Comment