1 Replies - 1544 Views - Last Post: 17 October 2012 - 06:12 PM Rate Topic: -----

#1 lacrue79  Icon User is offline

  • New D.I.C Head

Reputation: 2
  • View blog
  • Posts: 43
  • Joined: 12-August 09

VB.NET code to VB6 code

Posted 06 October 2012 - 09:30 AM

Hello I've inherited the task of converting code from a vb.net app to word VBA. I have most of the conversions done except this one statement...

ServicePointManager.ServerCertificateValidationCallback = New RemoteCertificateValidationCallback(AddressOf ValidateServerCertificate)


The above statement is how it is coded in vb.net. I get an error at the first parenthesis stating expected end of statement. How can I convert this line of code without losing the intent? Any help is appreciated. Thanks!

Is This A Good Question/Topic? 0
  • +

Replies To: VB.NET code to VB6 code

#2 BobRodes  Icon User is offline

  • Your Friendly Local Curmudgeon
  • member icon

Reputation: 571
  • View blog
  • Posts: 2,979
  • Joined: 19-May 09

Re: VB.NET code to VB6 code

Posted 17 October 2012 - 06:12 PM

VBA doesn't allow you to use this syntax, because it doesn't allow you to pass arguments to constructors. If you want to call a procedure as part of the process of instantiating an object, you'll have to create a method that either raises an event that the procedure handles, or have the method accept an object as an argument, which object has a method of its own that is the procedure that you want to call, and have the method call the accepted object's method. (Whew! No clearer way I can think of to put that.)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1