Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Basic
  4. API in vb 2008

API in vb 2008

Scheduled Pinned Locked Moved Visual Basic
debuggingjsonhelpquestion
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TheMrProgrammer
    wrote on last edited by
    #1

    when i tried using a few api functions like FindWindow they didn't work for me no error was produced in the debug mode(ie i ran using F5) how is that?? is there a new way to use api in vb 2008 cause in older vb it is working??

    TheMrProgrammer

    B H 2 Replies Last reply
    0
    • T TheMrProgrammer

      when i tried using a few api functions like FindWindow they didn't work for me no error was produced in the debug mode(ie i ran using F5) how is that?? is there a new way to use api in vb 2008 cause in older vb it is working??

      TheMrProgrammer

      B Offline
      B Offline
      Baran M
      wrote on last edited by
      #2

      Ya, using api in .net is different from VB 6.0. In VB 6.0 we often uses api call but in .net. Here is an example, <DllImport("KERNEL32.DLL", EntryPoint:="GetSystemDirectoryW", _       SetLastError:=True, CharSet:=CharSet.Unicode, _       ExactSpelling:=True, _       CallingConvention:=CallingConvention.StdCall)> _       Public Function GetSystemDirectory(ByVal Buffer _          As StringBuilder, ByVal Size As Integer) As Long             ' Leave function empty - DLLImport attribute             ' forces calls to GetSystemDirectory to             ' be forwarded to GetSystemDirectory in KERNEL32.DLL       End Function Please use google for futher clarification. :)

      1 Reply Last reply
      0
      • T TheMrProgrammer

        when i tried using a few api functions like FindWindow they didn't work for me no error was produced in the debug mode(ie i ran using F5) how is that?? is there a new way to use api in vb 2008 cause in older vb it is working??

        TheMrProgrammer

        H Offline
        H Offline
        Henry Minute
        wrote on last edited by
        #3

        The process is known as PInvoke or P/Invoke. If you search MSDN, or Google on those terms you will get lots of examples.

        Henry Minute Do not read medical books! You could die of a misprint. - Mark Twain Girl: (staring) "Why do you need an icy cucumber?" “I want to report a fraud. The government is lying to us all.”

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups