Search Results

Search found 163 results on 7 pages for 'usman ahmad'.

Page 5/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • How to effectively use WorkbookBeforeClose event correctly?

    - by Ahmad
    On a daily basis, a person needs to check that specific workbooks have been correctly updated with Bloomberg and Reuters market data ie. all data has pulled through and that the 'numbers look correct'. In the past, people were not checking the 'numbers' which led to inaccurate uploads to other systems etc. The idea is that 'something' needs to be developed to prevent the use from closing/saving the workbook unless he/she has checked that the updates are correct/accurate. The numbers look correct action is purely an intuitive exercise, thus will not be coded in any way. The simple solution was to prompt users prior to closing the specific workbook to verify that the data has been checked. Using VSTO SE for Excel 2007, an Add-in was created which hooks into the WorkbookBeforeClose event which is initialised in the add-in ThisAddIn_Startup private void wb_BeforeClose(Xl.Workbook wb, ref bool cancel) { //.... snip ... if (list.Contains(wb.Name)) { DailogResult result = MessageBox.Show("some message", "sometitle", MessageBoxButtons.YesNo); if (result != DialogResult.Yes) { cancel = true; // i think this prevents the whole application from closing } } } I have found the following ThisApplication.WorkbookBeforeSave vs ThisWorkbook.Application.WorkbookBeforeSave which recommends that one should use the ThisApplication.WorkbookBeforeClose event which I think is what I am doing since will span all files opened. The issue I have with the approach is that assuming that I have several files open, some of which are in my list, the event prevents Excel from closing all files sequentially. It now requires each file to be closed individually. Am I using the event correctly and is this effective & efficient use of the event? Should I use the Application level event or document level event? Is there a way to prevent the above behaviour? Any other suggestions are welcomed VS 2005 with VSTO SE

    Read the article

  • Why Exception occured getting address of COM function ?

    - by Usman
    I am getting address of COM function by loading type library (TLB) and iterating over types using ITypeLib and ITypeInfo. After calling AddressOfMember function of ITypeInfo I am facing the following exception: System.Runtime.InteropServices.COMException (0x800288BD): Wrong module kind for the operation. (Exception from HRESULT: 0x800288BD (TYPE_E_BADMODULEKIND)) at System.Runtime.InteropServices.ComTypes.ITypeInfo.AddressOfMember(Int32 memid, INVOKEKIND invKind, IntPtr& ppv). Any idea how to get rid of this excpetion?

    Read the article

  • webBrowser popup window loses session

    - by Usman
    I am using WebBrowser control of .NET to login into a website. When i click on a button that popups a new window the popup window asks me to login again. However i am not asked to login again if i open the webpage in internet explorer. Is there any way to make the WebBrowser control store session so that i do not have to login again on the popup window.

    Read the article

  • Need to call COM component using reflection in .NET

    - by Usman
    I need to determine the COM component(unmanaged code) type and invoke the exposed interface's methods using reflection in C# at runtime. First What member of "Type" tells that type is COM component and we can take CLSID at runtime? Is Type.COMObject? I need to call methods of exposed interfaces as they called in unmanaged code using CoCreateInstance by passing CLSID and REFID ... I am using InvokeMember but it returns null or 0 as out parameter. How to pass out parameter in this case.? Is there any need to pass out parameter? As all my COM unmanaged code suppose to take last parameter as an OUT parameter and after executing it puts the result into that out param. But I've converted all my unmanaged COM code to .NET managed assemblies using tlbimp.exe.

    Read the article

  • DDB unknown file

    - by Ahmad Hajou
    I have a .ddb file that is used as a telephone directory for an application written in flash/VB.net (i guess). The problem is that the application is crashing and my only was to access the application is through the mysterious (*.ddb) file (99% of the application size.) The application contains an also mysterious dll (NK_SQLite.dll). So far I have tried: SQLite Browser tried opening the file in PL/SQL tried opening the file in SQL Server Any ideas about how to solve this issue,

    Read the article

  • Facing Memory Leaks in AES Encryption Method.

    - by Mubashar Ahmad
    Can anyone please identify is there any possible memory leaks in following code. I have tried with .Net Memory Profiler and it says "CreateEncryptor" and some other functions are leaving unmanaged memory leaks as I have confirmed this using Performance Monitors. but there are already dispose, clear, close calls are placed wherever possible please advise me accordingly. its a been urgent. public static string Encrypt(string plainText, string key) { //Set up the encryption objects byte[] encryptedBytes = null; using (AesCryptoServiceProvider acsp = GetProvider(Encoding.UTF8.GetBytes(key))) { byte[] sourceBytes = Encoding.UTF8.GetBytes(plainText); using (ICryptoTransform ictE = acsp.CreateEncryptor()) { //Set up stream to contain the encryption using (MemoryStream msS = new MemoryStream()) { //Perform the encrpytion, storing output into the stream using (CryptoStream csS = new CryptoStream(msS, ictE, CryptoStreamMode.Write)) { csS.Write(sourceBytes, 0, sourceBytes.Length); csS.FlushFinalBlock(); //sourceBytes are now encrypted as an array of secure bytes encryptedBytes = msS.ToArray(); //.ToArray() is important, don't mess with the buffer csS.Close(); } msS.Close(); } } acsp.Clear(); } //return the encrypted bytes as a BASE64 encoded string return Convert.ToBase64String(encryptedBytes); } private static AesCryptoServiceProvider GetProvider(byte[] key) { AesCryptoServiceProvider result = new AesCryptoServiceProvider(); result.BlockSize = 128; result.KeySize = 256; result.Mode = CipherMode.CBC; result.Padding = PaddingMode.PKCS7; result.GenerateIV(); result.IV = new byte[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; byte[] RealKey = GetKey(key, result); result.Key = RealKey; // result.IV = RealKey; return result; } private static byte[] GetKey(byte[] suggestedKey, SymmetricAlgorithm p) { byte[] kRaw = suggestedKey; List<byte> kList = new List<byte>(); for (int i = 0; i < p.LegalKeySizes[0].MaxSize; i += 8) { kList.Add(kRaw[(i / 8) % kRaw.Length]); } byte[] k = kList.ToArray(); return k; }

    Read the article

  • Internationalization & Localization issue

    - by Ahmad
    Hi all, My application supports internationalization and localization, each user can choose his preference language and the application will reflect it perfectly. the issue is when the first user selects English and the second one selects French the resource bundle for the first user will read from the French resource after refreshing his page. I am using the following code to change between the two languages: public void changeToEnglish() { FacesContext context = FacesContext.getCurrentInstance(); Locale currentLocale = context.getViewRoot().getLocale(); String locale = "en_US"; Locale newLocale = new Locale(locale); if(!currentLocale.equals(newLocale)) context.getViewRoot().setLocale(newLocale); } I have the following in my faces_config.xml: <locale-config> <default-locale>en</default-locale> <supported-locale>fr</supported-locale> </locale-config> the application respond very well to changing languages but I think when setting the locale from the FacesContext it reflects all the users locales. Please help me on this....

    Read the article

  • Explaining verity index and document search limits

    - by Ahmad
    As present, we currently have a CF8 standard edition server which have some limitations around verity indexing. According to Adobe Verity Server has the following document search limits (limits are for all collections registered to Verity Server): - 10,000 documents for ColdFusion Developer Edition - 125,000 documents for ColdFusion Standard Edition - 250,000 documents for ColdFusion Enterprise Edition We have now reached a stage where the server wide number of documents indexed exceed 125k. However, the largest verity collection consists of about 25k documents(and this is expected to grow). Only one collection is ever searched at a time. In my understanding, this means that I can still search an entire collection with no restrictions. Is this correct? Or does it mean that only documents that were indexed across all collection prior to reaching the limit are actually searchable? We are considering moving to CF9 standard as a solution to this and to use the Solr solution which has no restrictions. The coldfusionjedi highlights some differences between Verity and Solr. However, before we upgrade I am trying to gain a clearer understanding of this before we commit to an upgrade. Can someone provide me a clear explanation as to what this means and how it actually affects verity searching and indexing?

    Read the article

  • WCF - Network Cost

    - by Mubashar Ahmad
    Dear Devs I have a wcf service deployed on IIS with basicHttpBinding and aspNetCompatibilityEnabled=true I have a test client as well which invokes multiple service functions simultaneously. To check the performance of service call on client and server I calculated the Avg time it takes to complete a service request on client(in proxy code) and on server as well. after a test of 8 hrs (server and client were on the same machine) i came to know that average response time on client is around 34ms where as the Avg execution time on server is around 3ms so the difference is 31ms. I would like to know why every call is taking 31ms is it justified? and how can i reduce this?

    Read the article

  • Write-Through Cache

    - by Mubashar Ahmad
    Dear All I am trying to do an C# implementation of Write-through Cache to minimize the read hits on db i need your suggestions, articles or sample codes to fulfill this assignment. Initially this would be use only on one server but will be updated to work in clustered environment. I only able to get a worth reading article on Oracle Site. Please share your views Regards Mubashar

    Read the article

  • How to Setup Eclipse to Start Writing Web Services using Axis2

    - by Mubashar Ahmad
    Dear Gurus I am a .net Developer but now a days i want to setup Eclipse to write a sample web services to test the capacity of Java/Axis over WCF/BasicHttpBindings. I found a couple of articles regarding the setup procedures but they are too old or their wording is may be for java or eclipse experts. Can anyone please give me detailed instruction on how can I get to work quickly. I tried my best but i can't even setup TomCat properly its not starting and throwing exception when i try to start it from eclipse servers windows. Please some one give me a latest and novice level article. Regards

    Read the article

  • Performance Counters in Server Development

    - by Mubashar Ahmad
    Dear Gurus All you be agree with the value and worth of Performance Counters while developing and maintaining a server kind application I would like to know what is the best way to implement those, Specifically using C#? Usually performance counters have the following attributes They are shared global Writing requires locks to ensure Synchronization Reading Some times requires locks too. Is it better to update them Asynchronously and what is the best way to make them so. (I am planning to use the ThreadPool.QueuWorketItem function, pls tell me you opinion on this too.) If my question seems a bit vague can you just take the example of a HelloWorld Wcf service and i wanted to know following how many times its being hit overall and within a certain period Average/min/max Response Times overall and within a certain period. Moreover if any one knows about the Specialized way provided by DotNet or WCF then please let me know as well.

    Read the article

  • Execute linux AT Command via PHP

    - by ahmad Rabie
    When I run this code via ssh echo wget http://domain.com/send_me_email.php | at 12:54 it run correctly and send me an email at that time. but if I run a php Like this exec("echo wget http://domain.com/send_me_email.php | at 12:54"); exec("atq",$arr); print_r($arr); result of that code is something like this : job 63 at 2011-11-27 12:54 ,As you can see the job created successfully but I don't receive any Email at that time?! I test this line in php exec("wget http://domain.com/send_me_email.php"); and it send me an email, it means that I have permission to run exec and wget via php.but what is problem? I cant understand what is my problem. Please help me. thanks

    Read the article

  • Parsing plain Win32 PE File (Exe/DLL) in .NET

    - by Usman
    I need to parse plain Win32 DLL/Exe and need to get all imports and exports from it and to show it on console or GUI(say Win Forms). Is it possible to parse Win32 DLL/Exe in C#.NET, read its export table,import table and get managed types from it. As its unmanaged PE(.NET doesn't allows you to convert unmanaged PE files to managed .NET assemblies, only it generates COM managed assemblies). So how to parse export and import tables of PE files and take all methods(signatures from it) in managed form.(e.g if char* as argument, it should display as IntPtr)

    Read the article

  • WCF Service Memory Leaks

    - by Mubashar Ahmad
    Dear Devs I have a very small wcf service hosted in a console app. [ServiceContract] public interface IService1 { [OperationContract] void DoService(); } [ServiceBehavior(InstanceContextMode=InstanceContextMode.PerCall)] public class Service1 : IService1 { public void DoService() { } } and its being called as using (ServiceReference1.Service1Client client = new ServiceReference1.Service1Client()) { client.DoService(new DoServiceRequest()); client.Close(); } Please remember that service is published on basicHttpBindings. Problem Now when i performed above client code in a loop of 1000 i found big difference between "All Heap bytes" and "Private Bytes" performance counters (i used .net memory profiler). After investigation i found some of the objects are not properly disposed following are the list of those objects (1000 undisposed instance were found -- equals to the client calls) (namespace for all of them is System.ServiceModel.Channels) HttpOutput.ListenerResponseHttpOutput.ListenerResponseOutputStream BodyWriterMessage BufferedMessage HttpRequestContext.ListenerHttpContext.ListenerContextHttpInput.ListenerContextInputStream HttpRequestContext.ListenerHttpContext Questions Why do we have lot of undisposed objects and how to control them. Please Help

    Read the article

  • Data Annotations on ViewModels or Domain Objects

    - by Ahmad
    Where would data annotations be more suitable: ViewModels or Domain Objects or Both I am struggling to decide where these will be more suited. I have not as yet fully utilized them but this question came to mind. From most of the examples I have seen, they are generally placed on Models and simply use the required attributes for validation using ModelState.IsValid. I have also seen another question on SO where the use of data annotations alone is not sufficient and advocate. Option 1 - I will still need to validate again in my service layer. ( I think that my service layer should be complete and this include validation, since its planned to be used elsewhere) Option 2 - How will I then get the benefits of the built in validation both client and server side. Option 3 - there will be a repetition of validation logic, however I was wondering if one could use a MetaData class approach that can be used for both ViewModels and Domain Objects. ( This is completely of the top of my head, so it may be nonsensical) I wonder if this question even makes sense. If not, can someone please help in understanding this better. Have I completely misunderstood the use of data annotations?

    Read the article

  • Save Jquery Object without losing its binding

    - by Ahmad Satiri
    Hi I have object created using jquery where each object has it's own binding. function closeButton(oAny){ var div = create_div(); $(div).attr("id","btn_"+$(oAny).attr("id")); var my_parent = this; $(div).html("<img src='"+ my_parent._base_url +"/assets/images/close.gif'>"); $(div).click(function(){ alert("do some action here"); }); return div; } var MyObject = WindowObject(); var btn = closeButton(MyObject); $(myobject).append(btn); $("body").append(myobject); //at this point button will work as i expected //save to array for future use ObjectCollections[0] = myobject; //remove $(myobject).remove(); $(body).append(ObjectCollections[0]); // at this point button will not work For the first time i can show my object and close button is working as i expected. But if i save myobject to any variable for future use. It will loose its binding. Anybody ever try to do this ? Is there any work around ? or It is definitely a bad idea ? .And thanks for answering my question.

    Read the article

  • How to store multiple cookies through PHP Curl

    - by Ahmad
    'SOUP.IO' is not providing any api. So Iam trying to use 'PHP Curl' to login and submit data through PHP. Iam able to login the website successfully(through cUrl), but when I try to submit data through cUrl, it gives me error of 'invalid user'. When I tried to analysed the code and website, I came to know that cUrl is getting values of only 1-2 cookies. Where as when I open the same page in FireFox, it shows me 6-7 cookies related to 'SOUP.IO'. Can some one guide me how to get all these 7 cookies values. Following cookies are getable by cUrl: soup_session_id Following cookies are shown in Firefox (not through cUrl): __qca, __utma, __utmb, __utmc, __utmz Following is my cUrl code: $cookie_file_path = getcwd()."/cookie/cookie.txt"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://www.soup.io'); curl_setopt($ch, CURLOPT_VERBOSE, 1); curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, FALSE); curl_setopt($ch, CURLOPT_HEADER, TRUE); curl_setopt($ch, CURLOPT_ENCODING, 'gzip,deflate'); curl_setopt($ch, CURLOPT_COOKIEJAR, $cookie_file_path); curl_setopt($ch, CURLOPT_COOKIEFILE, $cookie_file_path); curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.9.2.3) Gecko/20100401 Firefox/3.6.3 (.NET CLR 3.5.30729) FirePHP/0.4'); curl_setopt($ch, CURLOPT_MAXREDIRS, 10); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE); curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); $result = curl_exec($ch); curl_close($ch); print_r($result); ? Can some one guide me in this regards Thanks in advance

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >