Tech Off Thread

3 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Problem after publish program in vb

Back to Forum: Tech Off
  • User profile image


    I don't know what to do and where to get some help on my program.

    I have created a VB program to capture image and later user will answer the questionnaire based on the image the cllick.

    After I have publish my program in VB 10, I try to run the program in different computer. It able to work partially.

    My problem:

    1. When I save data, it stated successfully saved but when I check in database (Ms Access 2007) nothing in there 

    2. I manage to publish my my program to project. Its partially working. When I try to use Hot key function ALT Z, (To capture image) this error appears:

    See the end of this message for details on invoking 

    just-in-time (JIT) debugging instead of this dialog box.


    ************** Exception Text **************
    System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
       at System.Drawing.Image.Save(String filename, ImageCodecInfo encoder, EncoderParameters encoderParams)
       at System.Drawing.Image.Save(String filename, ImageFormat format)
       at WindowsApplication1.frmmain.WndProc(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)



    This is the simple code where it start to capture image...


     If m.Msg = WM_HOTKEY Then
    Dim id As IntPtr = m.WParam
    Select Case (id.ToString)
    Case "100"
    ' Button2_Click(Nothing, Nothing)
    'add 07/02/11
    imagename = Replace(Now.Date, "/", "") & "-" & Int(Now.TimeOfDay.TotalSeconds)
    sc.CaptureScreen.Save("sc1/" & imagename & ".jpg", System.Drawing.Imaging.ImageFormat.Jpeg)
    Dim rs As New OleDb.OleDbCommand("INSERT INTO tblcapture (imagename) VALUES ('" & imagename & "')", con)

    Please if anyone can help me upon this.


    Thank you in
  • User profile image

    @nonie: Better that you ask this on the VB MSDN forums....


  • User profile image

    @nonie : I am assuming you are using WebCam or some Compatible image capture device to capture the image.


     For problem 1 :

    a. check connection string and other settings are ok

    b. try putting proper try - catch for capturing the error if any are occuring while saving to mdb.


    For problem 2 :

    a. One of the possibilities is that your capture devices driver is not properly installed. Install it properly.

    b. If you have created InterOp with specific device you should install/register the DLL and should  have access to the DLL

    c. If possible try using generic solutions like or EasyCAM from codeplex ( or there seems to be other image capture projects), which will make it easier for you to capture image.

    d. Try running the program in Admin mode  

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.