I hope anyone can help me on this.
I am new to vb and willing to learn from all of you. My program works well in development(with no errors). Its a program to capture warning message. By using hotkey then image will be captured and stored in a folder. Later user will have to answer some questions(survey type) based on the image that they captured.
When I publish the program and run from the setup, something is going wrong.
1. I have to put my .txt file on this path C:\Documents and Settings\newuser Instead of the correct path C:\Documents and Settings\newuser\Local Settings\Apps\2.0\Z8EWEQ8D.702\E1QZ0N3Z.7V8
2. I recived GDI+ error when I press my hotkey. The message as below:
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)
Below is the place where I save the image: From my reading, it is well said that If the image is locked that this will happen. But I don't have any idea what does it mean. Please let me know if you guys need some more details.
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
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)
con.Open()
Dim rs As New OleDb.OleDbCommand("INSERT INTO tblcapture (imagename) VALUES ('" & imagename & "')", con)
rs.ExecuteNonQuery()
con.Close()
Seriously I don't know what to do. Based on the codes SC1 refers to the folder where the image capture will be stored. Again if I place it here C:\Documents and Settings\newuser\Local Settings\Apps\2.0\Z8EWEQ8D.702\E1QZ0N3Z.7V8 the GDI+ error pop up.
I'm not sure why this thing could happen.
Please anyone if you could help me.
Thank you very much

New Topic/Question
Reply



MultiQuote



|