locked
STI Registration

    Question

  • Hi,
    I would like to register my application to the scanner events using Still Image.
    I tried using RegisterLaunchApplication in sti.dll but I get an exception that entry point cannot be found.

    What is the correct syntax? Are there other methods?
    Monday, October 15, 2007 12:19 PM

Answers

  • BuzzLightyear,

     

    According to your question on "Entry point cannot be found" when using RegisterLaunchApplication in sti.dll, I would like to provide you the suggestions as follows:

     

    1. "Entry Point cannot be found issue": Firstly, please try to use regsvr32.exe to register the sti.dll in your Vista registry, the following KB article can help you: Explanation of Regsvr32 usage and error messages

     

    Then you can use P/Invoke to call the sti.dll in VB.NET like this: Private Declare Function Add Lib "sti.dll" (ByVal parameter As youNeed) As youNeed

     

    The following thread shows you the detailed solution: I am attempting to write my 1st DLL in Visual Basic

     

    2. RegisterLaunchApplication in sti.dll issue: Please take a look at Using Still Image articles in MSDN

    Once an STI-compatible application is installed, it must be registered as an application that can use push model with the STI API. This is done in one of two ways:

    • The install program can call RegisterLaunchApplication.
    • The application itself can call RegisterLaunchApplication the first time it runs.

    The application must be registered by invoking the IStillImage::RegisterLaunchApplication method at least once. It is actually preferable to have your application call RegisterLaunchApplication every time it runs. That way, the Still Image system is able to find the application even if it has been moved.

     

    Once the application is registered, the user must manually connect the application to device events by using the Still Image Control Panel.

     

    When a registered, push-model application is uninstalled, it must remove its information from the Still Image system. The STI method UnRegisterLaunchApplication removes this information.

     

    Hope that can help you.

     

    Thursday, October 18, 2007 10:31 AM
  • BuzzLightyear,

     

    The function “RegisterLaunchApplication” is a COM function for interface IStillImage, so you cannot import it with “DllImport”, which is used to import WIN32 API functions. The right way to invoke it is to either add a COM reference to the DLL if it has the type library, or defined the interop interface on your own. You can take a look at the following thread for some idea on how to achieve that:

     

    http://www.dotnet247.com/247reference/msgs/40/203841.aspx 

     

    I find the thread on RegisterLaunchApplication problem. It seems that the post creater called cgraus has used this kind of application. Please take a look at the thread and you may contact cgraus who is also an MVP. You may get some help from this MVP:

     

    Launch from IStillImage freezes the app

     

    Furthermore, I would like to provide you the following article on Still Image Architecture:

     

    WDM Still Image Architecture

     

    I hope that can provide you some idea. If I think out any other method, I would like to add to reply ASAP.

     

    Thanks again for your question and reply.

    Thursday, October 18, 2007 11:02 AM

All replies

  • BuzzLightyear,

     

    According to your question on "Entry point cannot be found" when using RegisterLaunchApplication in sti.dll, I would like to provide you the suggestions as follows:

     

    1. "Entry Point cannot be found issue": Firstly, please try to use regsvr32.exe to register the sti.dll in your Vista registry, the following KB article can help you: Explanation of Regsvr32 usage and error messages

     

    Then you can use P/Invoke to call the sti.dll in VB.NET like this: Private Declare Function Add Lib "sti.dll" (ByVal parameter As youNeed) As youNeed

     

    The following thread shows you the detailed solution: I am attempting to write my 1st DLL in Visual Basic

     

    2. RegisterLaunchApplication in sti.dll issue: Please take a look at Using Still Image articles in MSDN

    Once an STI-compatible application is installed, it must be registered as an application that can use push model with the STI API. This is done in one of two ways:

    • The install program can call RegisterLaunchApplication.
    • The application itself can call RegisterLaunchApplication the first time it runs.

    The application must be registered by invoking the IStillImage::RegisterLaunchApplication method at least once. It is actually preferable to have your application call RegisterLaunchApplication every time it runs. That way, the Still Image system is able to find the application even if it has been moved.

     

    Once the application is registered, the user must manually connect the application to device events by using the Still Image Control Panel.

     

    When a registered, push-model application is uninstalled, it must remove its information from the Still Image system. The STI method UnRegisterLaunchApplication removes this information.

     

    Hope that can help you.

     

    Thursday, October 18, 2007 10:31 AM
  • I registered again sti.dll, but P/Invoke fails again saying that no entry point named RegisterLaunchApplication can be found in sti.dll.

    Is there any practical example on how to use it or is there any other method to make it work?
    Thursday, October 18, 2007 10:49 AM
  • BuzzLightyear,

     

    The function “RegisterLaunchApplication” is a COM function for interface IStillImage, so you cannot import it with “DllImport”, which is used to import WIN32 API functions. The right way to invoke it is to either add a COM reference to the DLL if it has the type library, or defined the interop interface on your own. You can take a look at the following thread for some idea on how to achieve that:

     

    http://www.dotnet247.com/247reference/msgs/40/203841.aspx 

     

    I find the thread on RegisterLaunchApplication problem. It seems that the post creater called cgraus has used this kind of application. Please take a look at the thread and you may contact cgraus who is also an MVP. You may get some help from this MVP:

     

    Launch from IStillImage freezes the app

     

    Furthermore, I would like to provide you the following article on Still Image Architecture:

     

    WDM Still Image Architecture

     

    I hope that can provide you some idea. If I think out any other method, I would like to add to reply ASAP.

     

    Thanks again for your question and reply.

    Thursday, October 18, 2007 11:02 AM