OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 12-01-2007, 10:14
Sasha
Guest
 
Posts: n/a
Default C# and CustomCommand("Boundary", "CreateBoundary")

Hi, I try to use CustomCommand("Boundary", "CreateBoundary") in C#, but C# asks me for argument "ref object[]".
How to fix problem?
Reply With Quote
  #2  
Old 12-01-2007, 11:06
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

You need to set a reference to CorelDraw and your version. There are several posts on this topic elsewhere in the forums and I am sure Alex will be happy to answer this question if you can't find anything.
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
  #3  
Old 12-01-2007, 12:37
Sasha
Guest
 
Posts: n/a
Default C# and customcommand

Thanks, but all references are OK, I can start Corel and import my file into Corel from C#. Actually I need to create boundary over my shape. All works great but this function
Reply With Quote
  #4  
Old 12-01-2007, 15:33
shelbym's Avatar
shelbym shelbym is offline
Senior Member
 
Join Date: Nov 2002
Location: Cheyenne, WY
Posts: 1,769
Blog Entries: 9
Send a message via ICQ to shelbym Send a message via AIM to shelbym Send a message via MSN to shelbym Send a message via Yahoo to shelbym
Default Ref Object

Have you tried Alex's example:
Code:
Sub CreateBoundary()
    Dim s1 As Shape
    Set s1 = ActiveSelection.CustomCommand("Boundary", "CreateBoundary")
End Sub
Best of Luck,

Shelby
Reply With Quote
  #5  
Old 12-01-2007, 15:53
Sasha
Guest
 
Posts: n/a
Default CustomCommand

Hi, in VBA I use exactly this code I found in forum, thanks Alex. But I want to create something similar in my C# application not in macros and can't do it. My application creates Corel document, imports there vector graphic etc.- all works great - and I stuck with "boundary" problem.
Reply With Quote
  #6  
Old 12-01-2007, 16:50
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Well, why don't you create the object array:

Code:
object args[] = new object[0];
draw.ActiveSelection.CustomCommand("Boundary", "CreateBoundary", args);
Reply With Quote
  #7  
Old 15-01-2007, 10:21
Sasha
Guest
 
Posts: n/a
Default C# and CustomCommand

Hi, ALex. Thanks. It works great with
Code:
object[] args = new object[0];
draw.ActiveSelection.CustomCommand("Boundary", "CreateBoundary", ref args);
Case is closed.
Reply With Quote
  #8  
Old 15-01-2007, 10:32
Alex's Avatar
Alex Alex is offline
Administrator
 
Join Date: Nov 2002
Posts: 1,940
Blog Entries: 4
Default

Yes, right.. You probably can see that I don't spend too much time with C# these days My syntax is not too strong. But I promise I'll improve
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 07:22.


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