dcsimg
Page 2 of 2 FirstFirst 12
Results 41 to 50 of 50

Thread: VB6 and .NET interoperability

  1. #41
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,307

    Re: VB6 and .NET interoperability

    Date is still in .NET, as well, but it's the DateTime structure, not the Double you are used to. However, there is the ToOADate method:

    https://docs.microsoft.com/en-us/dot...ew=netcore-3.0

    This appears to get the DateTime in the Double format you are used to. You can take it back to a DateTime, as well.
    My usual boring signature: Nothing

  2. #42
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    5,619

    Re: VB6 and .NET interoperability

    Isn't that assuming he will be using netcore 3.0?
    I figured he would be using the .Net framework.
    "Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930

  3. #43
    Frenzied Member jdc2000's Avatar
    Join Date
    Oct 2001
    Location
    Idaho Falls, Idaho USA
    Posts
    1,501

    Re: VB6 and .NET interoperability


  4. #44
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    34,307

    Re: VB6 and .NET interoperability

    Quote Originally Posted by passel View Post
    Isn't that assuming he will be using netcore 3.0?
    I figured he would be using the .Net framework.
    I might have linked to the wrong page, but I've used that .ToOADate as far back as VS2010, so it isn't Core only.
    My usual boring signature: Nothing

  5. #45

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,840

    Re: VB6 and .NET interoperability

    I initially tried to get TysonLPrice's example going in Net Core, but the "Assembly Information..." button was grayed out, which is where I needed to go to set the "Make Assembly COM-Visible" setting. So, I immediately went to to .NET Framework 4.8, and then I could set it. So, I'm thinking that Net Core isn't an option.
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  6. #46
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    5,619

    Re: VB6 and .NET interoperability

    Quote Originally Posted by Shaggy Hiker View Post
    I might have linked to the wrong page, but I've used that .ToOADate as far back as VS2010, so it isn't Core only.
    You're right. I made the mistake of trying to quickly see if the method existing by using the Class name, i.e. DateTime.xxx and intellisence didn't show it, but you can't check it that way in the IDE, you need an instance object. (Checked in VS2010, which I use most of the time).
    Code:
          Dim dt As New DateTime(Now.Ticks)
          Debug.Print("{0}", dt.ToOADate)
    "Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930

  7. #47

    Thread Starter
    PowerPoster Elroy's Avatar
    Join Date
    Jun 2014
    Location
    Near Nashville TN
    Posts
    5,840

    Re: VB6 and .NET interoperability

    Ok, I can see that ToOADate and FromOADate are going to be quite useful. They're going to save my bacon on parts of this translation. Ultimately, I suppose I should try and get rid of that stuff ... but, during a first pass, I'm hoping to do as little work as possible to just "get things running".
    Any software I post in these forums written by me is provided “AS IS” without warranty of any kind, expressed or implied, and permission is hereby granted, free of charge and without restriction, to any person obtaining a copy. Please understand that I’ve been programming since the mid-1970s and still have some of that code. My contemporary VB6 project is approaching 1,000 modules. In addition, I have a “VB6 random code folder” that is overflowing. I’ve been at this long enough to truly not know with absolute certainty from whence every single line of my code has come, with much of it coming from programmers under my employ who signed intellectual property transfers. I have not deliberately attempted to remove any licenses and/or attributions from any software. If someone finds that I have inadvertently done so, I sincerely apologize, and, upon notice and reasonable proof, will re-attach those licenses and/or attributions. To all, peace and happiness.

  8. #48
    Addicted Member
    Join Date
    May 2016
    Location
    China
    Posts
    195

    Re: VB6 and .NET interoperability

    The community work I most hope to upgrade to vb.net is Krool's vbflexgrid! This is a great work!
    But it was really difficult to upgrade VB6 to VB.NET. I wanted to upgrade my project to VB.NET, and eventually gave up ...
    QQ: 289778005

  9. #49
    Sinecure devotee
    Join Date
    Aug 2013
    Location
    Southern Tier NY
    Posts
    5,619

    Re: VB6 and .NET interoperability

    Quote Originally Posted by Elroy View Post
    ...
    I'd zip up and attach this test, but I'm not sure what to zip on the .NET side. Just for this little test, I wound up with 33 files and 13 folders (not counting the hidden ones). On the VB6 side, there are 2 files in a single folder.
    ...
    Generally, we just delete the obj and bin folders so we don't post any compiled files in violation of the forum's rules, then zip up the project from the top folder.
    "Anyone can do any amount of work, provided it isn't the work he is supposed to be doing at that moment" Robert Benchley, 1930

  10. #50
    PowerPoster ChrisE's Avatar
    Join Date
    Jun 2017
    Location
    Frankfurt
    Posts
    2,125

    Re: VB6 and .NET interoperability

    regarding DateTime I thought this was a good read
    https://blogs.msdn.microsoft.com/bcl...e-faq-entries/

    hth
    to hunt a species to extinction is not logical !
    since 2010 the number of Tigers are rising again in 2016 - 3900 were counted. with Baby Callas it's 3901, my wife and I had 2-3 months the privilege of raising a Baby Tiger.

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width