OberonPlace.com Forums

OberonPlace.com Forums (http://forum.oberonplace.com/index.php)
-   Corel Photo-Paint CS (http://forum.oberonplace.com/forumdisplay.php?f=19)
-   -   PHOTOPAINT CorelScript cast error with C# (http://forum.oberonplace.com/showthread.php?t=7632)

lebaron 20-04-2011 05:09

PHOTOPAINT CorelScript cast error with C#
 
Hi,

I want to execute CorelScript function from C#.
but at the debug time this error is returned:
//
The Exception:
Unable to cast COM object of type 'PHOTOPAINT.CorelScript' to interface type 'PHOTOPAINT.ICorelScript'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{3B5A0001-F896-49B4-B985-37191F200B7A}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
//

and is my code (tested with X5):
public void MainSub()
{
if (AppcorelInst == null) { AppcorelInst = new PHOTOPAINT.Application(); }
PHOTOPAINT.CorelScript cs = (PHOTOPAINT.CorelScript)AppcorelInst.CorelScript();
MessageBox.Show(cs.GetDocumentName());


}

and is the same problem with this code(Tested with X4):

public static void voidtest( PHOTOPAINT.Application app )
{
PHOTOPAINT.CorelScriptClass cs = new PHOTOPAINT.CorelScriptClass();
try
{
string testy= cs.GetDocumentName();
MessageBox.Show(testy);
}
catch (Exception e) { MessageBox.Show(e.Message); }
}

( all this code use the Framework 3.5 ! )


What is the interface class for CorelScript and CorelScriptTool ?
It is possible to run it from C# !?

best regard

shelbym 20-04-2011 20:24

CorelScript and C#
 
I don't think it is possible to use CorelScript from C#. At least I have never seen is successfully done.

-Shelby

lebaron 28-04-2011 04:50

OK, shelbym!

Do you know the Photo paint Object Model function, equivalence for:
SetDocumentInfo
RectangleTool
FillSolid
Rectangle
MaskRemove
ToleranceSettings
FileImport
MaskRectangle
MaskFloaterTranslate
BitmapEffect
ObjectSelectNone


?

regards,


All times are GMT -5. The time now is 11:23.

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com