Using an object that has a method called New 
Author Message
 Using an object that has a method called New

Thanks in advance for any help anyone can lend me.  Here's what I'm
working on.

' Create the Image file object
ImageFileObject = CreateObject("Imaging.ImageFile")

' Create a new file
ImageFileOjbect.New()

The examples the creator of the API has the new method as the way to
tell this object to create a new image file.  This evidently worked in
VB 6, but is not cooperating in .Net, as it interprets it as a
constructor and raises the compilation error "Constructor call is
valid only as the first statement in an instance constructor."

Can anyone point me to some type of work around?  

Thanks,

Joel Cade, MCSD
The Computer Solution Company



Sun, 27 Feb 2005 04:50:30 GMT  
 Using an object that has a method called New
Hi.

Not sure if it could work, but have you tried this?:

   ImageFileObject.[New]()

Hope this helps,

   Adrian

This posting is provided "AS IS" with no warranties, and
confers no rights.

Quote:
>-----Original Message-----
>Thanks in advance for any help anyone can lend me.  
Here's what I'm
>working on.

>' Create the Image file object
>ImageFileObject = CreateObject("Imaging.ImageFile")

>' Create a new file
>ImageFileOjbect.New()

>The examples the creator of the API has the new method
as the way to
>tell this object to create a new image file.  This
evidently worked in
>VB 6, but is not cooperating in .Net, as it interprets
it as a
>constructor and raises the compilation

error "Constructor call is

- Show quoted text -

Quote:
>valid only as the first statement in an instance
constructor."

>Can anyone point me to some type of work around?  

>Thanks,

>Joel Cade, MCSD
>The Computer Solution Company

>.



Sun, 27 Feb 2005 17:00:42 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Using string to specify method to call on object

2. (Check this out) Calling Stored Procedures from Connection object WITHOUT using Exectue method

3. Calling a COM call back object's method fails if it is in Windows 98

4. How to call an Excel macro (contained in a xla ) having parameters using DDE

5. Having trouble sending multiple emails using outlook object

6. Extending Word - add new method which can be called from VB

7. extending Word - new method to be called from VB

8. kyduke(kyduke@yahoo.com)'s New Logic - New sorting, New paging method

9. replace method of MS-Word 2000 automation object introduces a new line

10. Quit method call to a Word object returns ambiguous Error in VB.Net

11. calling object methods on a variable with interface type

12. permission denied error when trying to call send method of NewMail object

 

 
Powered by phpBB® Forum Software