Click here to Skip to main content
15,891,513 members
Please Sign up or sign in to vote.
1.80/5 (4 votes)
See more:
hi I have some unsafe code in asp.net
when i m assigning any text to my messagebox it is not displaying.
is there any solution by which we can handle our control in unsafe code function..??

C#
public void UserResultFuc(
                    object pContext,
                    int imageStatus,
                    APIWrapper.ImageData image,
                    APIWrapper.CG4ImageType imageType,
                    int detectedOdbjects)
        {
            try
            {
                APIWrapper.CG4_Controls_SetLEDs(APIWrapper.CG4LedType.CG4_LED_EXTEND, 1);
                Thread.Sleep(300);
                APIWrapper.CG4_Controls_SetLEDs(APIWrapper.CG4LedType.CG4_LED_EXTEND, 0);
                string fileName = "";
                strFlag = "Veri";
                ///verification
                if (strFlag == "Veri")
                {
                    string strName = "";
                    //string targetFolder = GetBulkTargetFolder();
                    fileName = "Images/veri.bmp";
                    //PARIVESH
                    int count = (int)image.Width * (int)image.Height;
                    byte[] dst = new byte[count];
                    Marshal.Copy(image.Buffer, dst, 0, count);
                    Bitmap bmp = CreateGreyscaleBitmap(dst, (int)image.Width, (int)image.Height);
                    bmp.RotateFlip(RotateFlipType.Rotate180FlipX);
                    bmp.Save(Server.MapPath (fileName));
                  
                 
                    intTmTimer = 1;
                                       
                    try
                    {                              

                        //CG4Essentials.NetWrapperSample.FingerPrintBOBVerification.Service obj = new CG4Essentials.NetWrapperSample.FingerPrintBOBVerification.Service();
                        //string veriFlag = obj.VerifyFingerPrint(lblEmployeeId.Text);
                       

                    string    veriFlag = "true";
                        if (veriFlag.ToString().Equals("true"))
                        {
                          
                                textBox1.Text += "FINGERPRINT VERIFICATION SUCCESSFUL" + Environment.NewLine;
                                
                          
                        }
                        else
                        {
                          
                                textBox1.Text += "FINGERPRINT VERIFICATION UNSUCCESSFUL" + Environment.NewLine;
                           
                        }

actually this above code is for capturing finger print
device will take finger template and if it is matching it will give message box or it will display in lable that capture successfully.
i have written messg showing code in function used for capturing.
but it is not invoking that messagebox.in windows form it gets invoke..becoz i have used methodinvoker delegates there
thanx
Posted
Updated 11-Jul-12 0:51am
v6
Comments
Sergey Alexandrovich Kryukov 11-Jul-12 1:53am    
Please, this is not nice. You are asking about unsafe code problem, but don't show your unsafe code.
Also, why using it? with controls?
Language is not tagged (yes, I can guess, so what? tag it!).

As the question is formulated, there is nothing to discuss right now. Can you see "Improve question" above?
--SA
MAU787 11-Jul-12 1:56am    
have updated the question
thanx
OriginalGriff 11-Jul-12 3:10am    
It's still not a question we can answer.
The problem is in your code somewhere, but we can't see the code - so how can we help?
Remember that we can't see your screen, access your HDD, or read your mind.
Use the "Improve question" widget to edit your question and provide better information.
MAU787 11-Jul-12 3:28am    
one of ur member has told me to remove my code which i added previously....

Please, this is not nice. You are asking about unsafe code problem, but don't show your unsafe code.
Also, why using it? with controls?
Language is not tagged (yes, I can guess, so what? tag it!).

As the question is formulated, there is nothing to discuss right now. Can you see "Improve question" above?
--SA
Richard MacCutchan 11-Jul-12 3:43am    
I have rolled back your question to the one with the code in it. now you need to explain exactly what you are doing in this code and where this method gets called. If it is not within your main form then it will not have access to the text boxes you are trying to reference. Is this some third party library you are using?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900